Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Xcode ${{ matrix.xcode }}
strategy:
matrix:
xcode: ["11"]
xcode: ["11", "12_beta"]
steps:
- uses: actions/checkout@master
- name: Set Xcode
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- Added ability to set custom LLDBInit scripts for launch and test schemes [#929](https://github.com/yonaskolb/XcodeGen/pull/929) @polac24
- Adds App Clip support. [#909](https://github.com/yonaskolb/XcodeGen/pull/909) @brentleyjones @dflems

#### Internal
- Updates CI to run on Xcode 12 beta. [#936](https://github.com/yonaskolb/XcodeGen/pull/936) @dflems

#### Fixed
- Allow SDK dependencies to be embedded. [#922](https://github.com/yonaskolb/XcodeGen/pull/922) @k-thorat

Expand Down
19 changes: 8 additions & 11 deletions Tests/Fixtures/TestProject/build.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
#!/bin/bash
set -e

XCODE_VERSION=$(/usr/libexec/PlistBuddy -c "Print :DTXcode" "$(xcode-select -p)/../Info.plist")

CARTHAGE_DYNAMIC_FRAMEWORKS=(Result)
CARTHAGE_STATIC_FRAMEWORKS=(SwiftyJSON swift-nonempty)

carthage bootstrap $CARTHAGE_DYNAMIC_FRAMEWORKS --cache-builds

# Prepare xcconfig for static bootstrapping
STATIC_CONFIG=$(mktemp -d)/static.xcconfig
echo "MACH_O_TYPE = staticlib" > $STATIC_CONFIG
XCODE_XCCONFIG_FILE="$PWD/carthage_dynamic.xcconfig" \
carthage bootstrap $CARTHAGE_DYNAMIC_FRAMEWORKS --cache-builds

XCODE_XCCONFIG_FILE=$STATIC_CONFIG \
XCODE_XCCONFIG_FILE="$PWD/carthage_static.xcconfig" \
carthage bootstrap $CARTHAGE_STATIC_FRAMEWORKS --cache-builds

XCODE_VERSION=$(/usr/libexec/PlistBuddy -c "Print :DTXcode" "$(xcode-select -p)/../Info.plist")

echo "
⚙️ Building iOS app"
xcodebuild -quiet -workspace Workspace.xcworkspace -scheme "App_iOS Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
xcodebuild -quiet -workspace Workspace.xcworkspace -scheme "App_iOS Test" -configuration "Test Debug" -xcconfig fixtures.xcconfig
echo "✅ Successfully built iOS app"

if [[ "$XCODE_VERSION" == 12* ]]; then
echo "
⚙️ Building iOS app (Xcode 12+)"
xcodebuild -quiet -project ProjectXcode12.xcodeproj -scheme "App_iOS_With_Clip Test" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
xcodebuild -quiet -project ProjectXcode12.xcodeproj -scheme "App_iOS_With_Clip Test" -configuration "Test Debug" -xcconfig fixtures.xcconfig
echo "✅ Successfully built iOS app (Xcode 12+)"
fi

echo "
⚙️ Building macOS app"
xcodebuild -quiet -workspace Workspace.xcworkspace -scheme "App_macOS" -configuration "Test Debug" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
xcodebuild -quiet -workspace Workspace.xcworkspace -scheme "App_macOS" -configuration "Test Debug" -xcconfig fixtures.xcconfig
echo "✅ Successfully built macOS app"
1 change: 1 addition & 0 deletions Tests/Fixtures/TestProject/carthage_dynamic.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "xcode12_workaround.xcconfig"
2 changes: 2 additions & 0 deletions Tests/Fixtures/TestProject/carthage_static.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "xcode12_workaround.xcconfig"
MACH_O_TYPE = staticlib
7 changes: 7 additions & 0 deletions Tests/Fixtures/TestProject/fixtures.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "xcode12_workaround.xcconfig"

// Common settings for fixtures
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
CODE_SIGN_ENTITLEMENTS =
CODE_SIGNING_ALLOWED = NO
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything not related to Xcode 12, can we put in the actual spec? I'd like to have that as buildable as possible without custom xcodebuild args

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yonaskolb These were already explicit overrides in the script that built the fixtures. It made the command line a lot shorter to extract them to this xcconfig. They shouldn't go in the spec because they're only needed for CI builds (which does not have certs/profiles available to do code signing)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was able to replace:

xcodebuild ... CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"

with:

xcodebuild ... -xcconfig fixtures.xcconfig

and apply the xcode 12 overrides all in one shot

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right you are, apologies. My glance was too quick 😀

9 changes: 9 additions & 0 deletions Tests/Fixtures/TestProject/xcode12_workaround.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// See https://github.com/Carthage/Carthage/issues/3019
//
// Skips building ARM slices for simulators until Carthage can support it
//

EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS_1200=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))
EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS_$(XCODE_VERSION_MAJOR))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only set EXCLUDED_ARCHS if building with Xcode 12. It works around an issue where Carthage fails to create fat Simulator + Device binaries. For instance, creation of fat dylibs/archives fail because iphonesimulator builds targeting Apple silicon share the arm* archs with iphoneos. We'll probably need this workaround until Carthage supports xcframeworks or some other means of being able to build frameworks per-platform.