Skip to content

Commit

Permalink
Migrate to Swift 5️⃣.5️⃣ (#250)
Browse files Browse the repository at this point in the history
GH Actions' macOS 11 images have Xcode 13 available which means that
Swift 5.5 is available to use in CI.

https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode

## Changes

- Update `ci.yml`:
  + `DEVELOPER_DIR` to point to Xcode 13.2.1.
  + `IOS_SDK` to point to `iphonesimulator15.2`.
  + `PLATFORM_TARGET` to point to `x86_64-apple-ios15.2-simulator`.

- Update Package.swift's `// swift-tools-version` to 5.5.

- Update podspec's `swift_version` to 5.5.

- Set Swift 5 version at the project level.

- Update `carthage.sh` workaround for Carthage/Carthage#3019 to handle
Xcode 13.

- Update `README.md`.
  • Loading branch information
p4checo authored Feb 9, 2022
1 parent 58d5838 commit 5dc9b0f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
# https://github.com/actions/virtual-environments/tree/main/images/macos
DEVELOPER_DIR: /Applications/Xcode_12.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer

jobs:
env-details:
Expand All @@ -34,8 +34,8 @@ jobs:
WORKSPACE: Alicerce.xcworkspace
SCHEME: Alicerce

IOS_SDK: iphonesimulator
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 12 Pro,OS=latest"
IOS_SDK: iphonesimulator15.2
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 13 Pro,OS=latest"

DERIVED_DATA_PATH: build
steps:
Expand All @@ -62,7 +62,7 @@ jobs:
name: SwiftPM Build
runs-on: macOS-11
env:
PLATFORM_TARGET: x86_64-apple-ios14.0-simulator
PLATFORM_TARGET: x86_64-apple-ios15.2-simulator
steps:
- name: git checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Alicerce.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/Mindera/Alicerce.git', :tag => "#{s.version}" }

s.module_name = 'Alicerce'
s.swift_version = '5.4'
s.swift_version = '5.5'

s.ios.deployment_target = '10.0'

Expand Down
12 changes: 2 additions & 10 deletions Alicerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Tests/AlicerceTests/AlicerceTests-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2230,7 +2229,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Tests/AlicerceTests/AlicerceTests-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -2287,7 +2285,6 @@
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -2341,7 +2338,6 @@
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -2382,7 +2378,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -2416,7 +2411,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.alicerce.DummyHostApp;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -2455,7 +2449,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DummyHostApp.app/DummyHostApp";
};
Expand Down Expand Up @@ -2489,7 +2482,6 @@
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.alicerce.HostAppRequiringTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DummyHostApp.app/DummyHostApp";
VALIDATE_PRODUCT = YES;
Expand Down Expand Up @@ -2557,7 +2549,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
WARNING_CFLAGS = (
"-Wall",
"-Wextra",
Expand Down Expand Up @@ -2604,7 +2596,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
WARNING_CFLAGS = (
"-Wall",
"-Wextra",
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.5

import PackageDescription

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/Mindera/Alicerce/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/Mindera/Alicerce.svg)](https://github.com/Mindera/Alicerce/releases)
![platforms](https://img.shields.io/badge/platforms-iOS-lightgrey.svg)
[![Swift 5.4](https://img.shields.io/badge/Swift-5.4-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Swift 5.5](https://img.shields.io/badge/Swift-5.5-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods](https://img.shields.io/cocoapods/v/Alicerce.svg)](https://cocoapods.org/)
[![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-orange.svg)](#swift-package-manager)
Expand Down Expand Up @@ -50,7 +50,13 @@ TODO

## Compatibility ✅

### `0.13.0` ... `master`
### `master`

- iOS 10.0+
- Xcode 13
- Swift 5.5

### `0.13.0` ... `0.14.0`

- iOS 10.0+
- Xcode 12.5
Expand Down
6 changes: 3 additions & 3 deletions script/carthage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ set -euo pipefail
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# For Xcode 12 and 13 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1300 = arm64 arm64e armv7 armv7s armv6 armv8' >> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"
carthage "$@"

0 comments on commit 5dc9b0f

Please sign in to comment.