Skip to content

Commit

Permalink
Add support for Xcode 12 and Swift 5.3
Browse files Browse the repository at this point in the history
Simplifies Xcode project dependency management by using the SPM Xcode
integration instead of the generated Swift package projects. Also bumps
some dependency versions:

- SwiftSyntax 0.50200.0 -> 0.50300.0
- XcodeProj: 7.0.0 -> 7.14.0
- SourceKitten: 0.24.0 -> 0.30.0
  • Loading branch information
andrewchang-bird committed Sep 22, 2020
1 parent 9c139f2 commit 2943d90
Show file tree
Hide file tree
Showing 38 changed files with 1,172 additions and 6,254 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/build-framework-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,51 @@ jobs:
- name: Test All Thunks
run: make clean-test

build-xcode-11_3_1:
name: Xcode 11.3.1 toolchain
build-xcode-12:
name: Xcode 12 toolchain
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2
- name: Set Up Environment
run: sudo xcode-select -s /Applications/Xcode_11.3.1.app/Contents/Developer
run: sudo xcode-select -s /Applications/Xcode_12.app/Contents/Developer
- name: Print Debug Info
run: make print-debug-info
- name: Set Up Project
run: make setup-project
- name: Clean
run: make clean
- name: Build Framework
run: make build-framework
- name: Build and Install CLI
run: |
make print-debug-info | grep "Mockingbird rpath: /var/tmp/mockingbird/$(make get-version)/libs"
PREFIX=$(pwd) USE_RELATIVE_RPATH=1 make print-debug-info
PREFIX=$(pwd) USE_RELATIVE_RPATH=1 make install
- name: Set Up Target
run: |
./bin/mockingbird install \
--target MockingbirdTests \
--source MockingbirdTestsHost \
--support Sources/MockingbirdSupport \
--output Tests/MockingbirdTests/Mocks/MockingbirdTestsHostMocks.generated.swift \
--header '// Header line 1' '// Header line 2' \
--diagnostics all \
--loglevel verbose \
--verbose
- name: Test
run: make clean-test
- name: Cached Test
run: make test

build-xcode-11_7:
name: Xcode 11.7 toolchain
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2
- name: Set Up Environment
run: sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer
- name: Print Debug Info
run: make print-debug-info
- name: Set Up Project
Expand Down
4 changes: 0 additions & 4 deletions .xcode/GeneratedModuleMap/_CSwiftSyntax/module.modulemap

This file was deleted.

4 changes: 0 additions & 4 deletions .xcode/GeneratedModuleMap/llbuildBasic/module.modulemap

This file was deleted.

4 changes: 0 additions & 4 deletions .xcode/GeneratedModuleMap/llbuildBuildSystem/module.modulemap

This file was deleted.

4 changes: 0 additions & 4 deletions .xcode/GeneratedModuleMap/llbuildCore/module.modulemap

This file was deleted.

4 changes: 0 additions & 4 deletions .xcode/GeneratedModuleMap/llvmSupport/module.modulemap

This file was deleted.

61 changes: 31 additions & 30 deletions .xcode/xcschemes/MockingbirdCli.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,15 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--targets MockingbirdTestsHost"
argument = "--target MockingbirdTests"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--destination MockingbirdTests"
argument = "--sources MockingbirdTestsHost"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--outputs ./MockingbirdTests/Mocks.generated.swift"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--asynchronous"
argument = "--outputs ./Tests/MockingbirdTests/Mocks/MockingbirdTestsHostMocks.generated.swift"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
Expand All @@ -99,43 +95,35 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--targets MockingbirdTestsHost"
argument = "--target MockingbirdTestsHost"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "generate"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--project /Users/andrew/api-ios/ios/Bird.xcodeproj"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--target BirdInterface"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--output /Users/andrew/api-ios/ios/Modules/BirdFoundation/BirdFoundationTestHelpers/Mocks.generated.swift"
isEnabled = "NO">
argument = "--project ./Mockingbird.xcodeproj"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--output /tmp/Mocks.generated.swift"
isEnabled = "NO">
argument = "--target MockingbirdTestsHost"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--project ./Mockingbird.xcodeproj"
isEnabled = "NO">
argument = "--output ./Tests/MockingbirdTests/Mocks/MockingbirdTestsHostMocks.generated.swift"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--target MockingbirdTestsHost"
argument = "--support ./Sources/MockingbirdSupport"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--output ./MockingbirdTests/Mocks.generated.swift"
isEnabled = "NO">
argument = "--verbose"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--disable-cache"
argument = "--diagnostics all"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
Expand All @@ -154,11 +142,24 @@
argument = "version"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--verbose"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "TARGET_NAME"
value = "WhatsAppTests"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "SRCROOT"
value = "/Users/typealias/whatsapp-ios"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "PROJECT_FILE_PATH"
value = "/Users/typealias/whatsapp-ios/WhatsApp.xcodeproj"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $(eval MOCKINGBIRD_RPATH = $(shell [[ $(USE_RELATIVE_RPATH) -eq 1 ]] && echo '@e

SIMULATOR_NAME=iphone11-mockingbird
SIMULATOR_DEVICE_TYPE=com.apple.CoreSimulator.SimDeviceType.iPhone-11
SIMULATOR_RUNTIME=com.apple.CoreSimulator.SimRuntime.iOS-13-6
SIMULATOR_RUNTIME=$(shell xcrun simctl list runtimes | pcregrep -o1 '(com\.apple\.CoreSimulator\.SimRuntime\.iOS\-.*)')

SWIFT_BUILD_FLAGS=--configuration release -Xlinker -weak-l_InternalSwiftSyntaxParser $(RELATIVE_RPATH_FLAG)
XCODEBUILD_FLAGS=-project 'Mockingbird.xcodeproj' DSTROOT=$(TEMPORARY_FOLDER)
Expand Down Expand Up @@ -129,9 +129,7 @@ clean: clean-mocks clean-xcode clean-swift clean-installables clean-dylibs

.PHONY: setup-project
setup-project:
(cd Sources && swift package resolve)
cp -rf .xcode/xcschemes/*.xcscheme Mockingbird.xcodeproj/xcshareddata/xcschemes
rsync -vhr .xcode/GeneratedModuleMap/** Mockingbird.xcodeproj/GeneratedModuleMap

.PHONY: bootstrap
bootstrap: setup-project
Expand All @@ -157,6 +155,7 @@ print-debug-info:
$(eval XCODEBUILD_VERSION = $(shell xcodebuild -version))
@echo "Xcodebuild version: $(XCODEBUILD_VERSION)"
@echo "Swift build flags: $(SWIFT_BUILD_FLAGS)"
@echo "Simulator runtime: $(SIMULATOR_RUNTIME)"

.PHONY: generate-embedded-dylibs
generate-embedded-dylibs:
Expand Down
25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/AEXML_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/Basic_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/CYaml_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/Clang_C_Info.plist

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/POSIX_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions Mockingbird.xcodeproj/PathKit_Info.plist

This file was deleted.

Loading

0 comments on commit 2943d90

Please sign in to comment.