8b37b09ac6
https://bugzilla.xamarin.com/show_bug.cgi?id=58479 _AssignAppExtensionConfiguration assigns project configuration from `$(CurrentSolutionConfigurationContents)`, using the `AssignProjectConfiguration` task, which is set if `$(BuildingSolutionFile)` or `$(BuildingVisualStudio)` is true. We check only for the former. It would be simpler to just check for .. `$(CurrentSolutionConfigurationContents) != ''` .. like the iOS targets. This mapping from this task is used when invoking `GetBundleTargetPath` on the extension project: Properties="%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)" Details: This failed for a project that had a reference to an app extension project, with VSMac/msbuild. The app extension project was being built with `Configuration==Debug` and `Platform==x86` for which the project does not define any properties (like `$(OutputPath)`). When the main project is built, we invoke `GetBundleTargetPath` on the extension project, which in this case, has a different config+platform mapping than the one for the referencing project. But since the earlier `AssignProjectConfiguration` was skipped due to the incorrect condition, `GetBundleTargetPath` is invoked with no config+platform, thus falling back to extension project's defaults. Note: The referencing project was being built with Debug|x86 and the referenced project was expected to be built with Debug|AnyCPU . This project: - VSMac/xbuild - Works - This happens to work because the default from the extension project is Debug|AnyCPU, so even though `AssignProjectConfiguration` didn't set those properties, it builds just fine. - command line xbuild/msbuild - works! - `AssignProjectConfiguration` works because this time the condition `$(BuildingSolutionFile) == 'true'` is True. - VSMac/msbuild - fails - In this case, the default case does not work because in VSMac, we use `SetGlobalProperty` to set config+platform properties when starting the build for the referencing project. - And when the referencing project builds the referenced project (via `GetBundleTargetPath`), it is built with config+platform global properties set, and thus defaults from the referenced don't get picked up! <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - With the `AssignProjectConfiguration` fix, we set the properties via the `MSBuild` task, so it works. But this needs to be fixed in VSMac anyway. |
||
---|---|---|
builds | ||
docs | ||
external | ||
fsharp | ||
jenkins | ||
mk | ||
mono/4.5 | ||
msbuild | ||
opentk | ||
runtime | ||
src | ||
tests | ||
tools | ||
.gitignore | ||
.gitmodules | ||
LICENSE | ||
Make.config | ||
Makefile | ||
NuGet.config | ||
README.md | ||
Versions-ios.plist.in | ||
Versions-mac.plist.in | ||
Xamarin.Mac.sln | ||
Xamarin.iOS.sln | ||
banner.png | ||
configure | ||
product.snk | ||
system-dependencies.sh | ||
versions-check.csharp |
README.md
Xamarin.iOS & Xamarin.Mac
Status | |
---|---|
master |
Welcome!
This module is the main repository for both Xamarin.iOS and Xamarin.Mac.
These frameworks allow us to create native iOS, tvOS, watchOS and Mac applications using the same UI controls we would in Objective-C and Xcode, except with the flexibility and elegance of a modern language (C#), the power of the .NET Base Class Library (BCL), and two first-class IDEs—Xamarin Studio and Visual Studio—at our fingertips.
Continuous Builds
You can download continuous builds of our main development branches from our wiki page.
Build requirements
-
Autoconf, automake and libtool.
You can use brew, or this script to get it directly from gnu.org (you'll have to edit your PATH to include /opt/bin if you use the script)
To install brew and all the tool dependencies:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew update $ brew install libtool autoconf automake bison flex
-
CMake
You can use brew, or download manually from cmake.org.
CMake must be in PATH, so if you install it somewhere else, you'll have to fix up your PATH accordingly (not necessary if installed using brew).
To install using brew:
$ brew install cmake
-
Xcode
To build the Xamarin.iOS and Xamarin.Mac SDKs you need a certain version of Xcode. The build will tell you exactly which version you need.
You can download the Xcode version you need from Apple's Developer Center (requires an Apple Developer account).
To ease development with different versions of the SDK that require different versions of Xcode, we require Xcode to be in a non-standard location (based on the Xcode version).
For example Xcode 7.0 must be installed in /Applications/Xcode7.app.
The recommended procedure is to download the corresponding Xcode dmg from Apple's Developer Center, extract Xcode.app to your system, and rename it before launching it the first time. Renaming Xcode.app after having launched it once may confuse Xcode, and strange errors start occuring.
-
Mono MDK.
The build will tell you if you need to update, and where to get it.
-
Xamarin Studio.
The build will tell you if you need to update, and where to get it.
-
You can also provision some of the dependencies with an included script:
$ ./system-dependencies.sh --provision-[xcode|xamarin-studio|mono|all]
Quick build & install
Follow the following steps to build and install Xamarin.iOS and Xamarin.Mac:
-
Clone this repository and its submodules
$ git clone --recursive git@github.com:xamarin/xamarin-macios.git $ cd xamarin-macios
-
Fetch dependencies and build everything
$ make world
-
Make sure permissions are OK to install into system directories (this will ask for your password)
$ make fix-install-permissions
-
Install into the system
$ make install-system
-
Build again after any local changes
Don't use
make world
again to rebuild, because it resets dependencies and causes unnecessary rebuilds. Instead use the standardmake all install
(our Makefiles are parallel safe, which greatly speeds up the build):$ make all -j8 && make install -j8
Configure
There is a configure script that can optionally be used to configure the build. By default, everything required for both Xamarin.iOS and Xamarin.Mac will be built.
-
--disable-mac: Disable Mac-related parts.
-
--disable-ios: Disable iOS-related parts.
In both cases the resulting build will contain both iOS and Mac bits because:
-
Parts of the iOS build depends on Mac parts (in particular mtouch uses Xamarin.Mac).
-
The class libraries builds can not be disabled because a very common error is to end up with code that only works/builds in either iOS or Mac.
-
-
--enable-ccache: Enables cached builds with
ccache
(default ifccache
is found in the path). -
--disable-ccache: Disables cached builds with
ccache
, even if it is present. -
--disable-strip: If executables should be stripped or not. This makes it easier to debug native executables using lldb.
-
--help: Show the help.
Contributing
Mailing Lists
To discuss this project, and participate in the design, we use the macios-devel@lists.xamarin.com mailing list.
Chat
There is also a gitter chat room that can be used to discuss this project, and participate in the design:
Coding Guidelines
We use Mono's Coding Guidelines.
Reporting Bugs
We use Bugzilla to track issues.