There are two options to installing Xcode:
-
Use automatic provisioning. This is done by executing
make provision
inmaccore/tools/tom-swifty
, but it may take a while to download Xcode unless you're in the Boston office, in which case it might be better to download Xcode manually (next option). -
Download Xcode manually from https://download.developer.apple.com/Developer_Tools/Xcode_9.2/Xcode_9.2.xip
- Extract and copy Xcode_9.2.xip to
/Applications/Xcode_9.2.app
(if you already have Xcode 9.2 in/Applications/Xcode92.app
, you can just create a symlink:ln -s /Applications/Xcode92.app /Applications/Xcode_9.2.app
) sudo xcode-select -s /Applications/Xcode_9.2.app/
- Extract and copy Xcode_9.2.xip to
- there are other requirements (e.g.
cmake
,ninja
) that I already have, most of them are likely needed to buildxamarin-macios
. It’s possible that I have some for others reasons too. Please update this document if you find any missing requirements.
Create a directory to dedicate to Binding Tools for Swift, e.g.
mkdir ~/git/binding-tools-for-swift
cd ~/git/binding-tools-for-swift
Clone maccore
git clone git@github.com:xamarin/maccore
Build everything. This will build the swift dependency (only if needed [1]) and binding-tools-for-swift.
cd tools/tom-swifty
make
[1] The build script will first check if a prepackaged version of the swift
toolchain is available in Azure, and if so, download and use that version.
This behavior can be overriden by doing export FORCE_SWIFT_BUILD=1
.
The above steps are doing a full debug build for swift. build-script can also produce different builds, e.g.
-d | --debug
: full debug (like above)-R | --release
: release-r | --release-debuginfo
: release with debug info
Running build-script
takes a very long time, so building extraneous local configurations is optional.
cd maccore/tools/tom-swifty/tests/tom-swifty-test/
make
- The new (incompatible but much more powerful) NUnit 3 runner means using the usual
FIXTURES
variable has to use a different syntax. E.g. to run a single test case from the command line you would do
FIXTURES="--where=test=SwiftReflector.LinkageTests.TestMissingNSObject" make
SwiftReflector/IOUtils/SwiftModuleList.g.cs
is generated via theupdate_module_list.csharp
script../update_module_list.csharp SwiftToolchain-v2-8efccc1464890d6c906fb2c40f909b5324da950d