Skip to content

Commit

Permalink
Raise minimum required OS and Swift Versions to Async-Support version…
Browse files Browse the repository at this point in the history
…s. (#999)

* Update minimum versions

- Swift is now 5.6 and later
- Xcode is now 13.3.1 and later
- iOS is now 13 and later
- tvOS is now 13 and later
- watchOS is now 6 and later
- macOS is now 10.15 and later

* Quote the developer dir env variable in ci

* run CI on macos 12, not 11

* The API for NSHastTable.description is not guaranteed to be the same between OS or xcode versions. Or even platforms

* Apparently apple changed the naming for later versions of watch simulators
  • Loading branch information
younata authored Oct 21, 2022
1 parent 6861b27 commit 1a22f49
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 52 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-swiftpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ on:
jobs:
swiftpm_darwin:
name: SwiftPM, Darwin, Xcode ${{ matrix.xcode }}
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
xcode: ["12.5", "13.0"]
xcode: ["13.3.1", "14.0.1"]
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
steps:
- uses: actions/checkout@v3
- run: ./test swiftpm
Expand All @@ -29,8 +29,8 @@ jobs:
strategy:
matrix:
container:
- swift:5.4
- swift:5.5
- swift:5.6
- swift:5.7
# - swiftlang/swift:nightly
fail-fast: false
container: ${{ matrix.container }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-xcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ on:
jobs:
xcode:
name: Xcode ${{ matrix.xcode }} (Xcode Project)
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
xcode: ["12.5", "13.0"]
xcode: ["13.3.1", "14.0.1"]
fail-fast: false
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
steps:
- uses: actions/checkout@v3
- run: ./test macos
Expand All @@ -29,13 +29,13 @@ jobs:

xcode_spm:
name: Xcode ${{ matrix.xcode }} (Swift Package)
runs-on: macos-11
runs-on: macos-12
strategy:
matrix:
xcode: ["12.5", "13.0"]
xcode: ["13.3.1", "14.0.1"]
fail-fast: false
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
steps:
- uses: actions/checkout@v3
- run: ./test macos_xcodespm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
cocoapods:
name: CocoaPods Lint
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
Expand Down
8 changes: 4 additions & 4 deletions Nimble.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Pod::Spec.new do |s|
s.homepage = "https://github.com/Quick/Nimble"
s.license = { :type => "Apache 2.0", :file => "LICENSE" }
s.author = "Quick Contributors"
s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.10"
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "5.0"
s.ios.deployment_target = "13.0"
s.osx.deployment_target = "10.15"
s.tvos.deployment_target = "13.0"
s.watchos.deployment_target = "6.0"
s.source = { :git => "https://github.com/Quick/Nimble.git",
:tag => "v#{s.version}" }

Expand Down
24 changes: 8 additions & 16 deletions Nimble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 10.15;
METAL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
Expand All @@ -2225,9 +2226,10 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 5.0;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2278,7 +2280,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 10.15;
METAL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand All @@ -2291,10 +2294,11 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 5.0;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Release;
};
Expand All @@ -2316,7 +2320,6 @@
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = Sources/Nimble/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2355,7 +2358,6 @@
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
INFOPLIST_FILE = Sources/Nimble/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2387,7 +2389,6 @@
"$(inherited)",
);
INFOPLIST_FILE = Tests/NimbleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -2407,7 +2408,6 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = Tests/NimbleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -2459,7 +2459,6 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2501,7 +2500,6 @@
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
};
Expand All @@ -2522,7 +2520,6 @@
PRODUCT_NAME = NimbleTests;
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
Expand All @@ -2546,7 +2543,6 @@
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
};
Expand All @@ -2573,7 +2569,6 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
METAL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -2612,7 +2607,6 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
METAL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -2645,7 +2639,6 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
METAL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = NimbleTests;
Expand All @@ -2666,7 +2659,6 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
METAL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "net.jeffhui.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = NimbleTests;
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// swift-tools-version:5.4
// swift-tools-version:5.6
import PackageDescription

let package = Package(
name: "Nimble",
platforms: [
.macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v5)
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)
],
products: [
.library(name: "Nimble", targets: ["Nimble"]),
Expand Down
8 changes: 0 additions & 8 deletions Tests/LinuxMain.swift

This file was deleted.

22 changes: 14 additions & 8 deletions Tests/NimbleTests/objc/ObjCHaveCountTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,37 @@ - (void)testHaveCountForNSHashtable {
expect(table).to(haveCount(3));
expect(table).notTo(haveCount(1));

NSString *tableDescription = [table.description stringByReplacingOccurrencesOfString:@"\n" withString:@""];

NSString *msg = [NSString stringWithFormat:
@"expected to have NSHashTable {[2] 2[12] 1[13] 3}with count 1, got 3\nActual Value: %@",
[table.description stringByReplacingOccurrencesOfString:@"\n" withString:@""]];
@"expected to have %@with count 1, got 3\nActual Value: %@",
tableDescription,
tableDescription];
expectFailureMessage(msg, ^{
expect(table).to(haveCount(@1));
});

msg = [NSString stringWithFormat:
@"expected to not have NSHashTable {[2] 2[12] 1[13] 3}with count 3, got 3\nActual Value: %@",
[table.description stringByReplacingOccurrencesOfString:@"\n" withString:@""]];
@"expected to not have %@with count 3, got 3\nActual Value: %@",
tableDescription,
tableDescription];
expectFailureMessage(msg, ^{
expect(table).notTo(haveCount(@3));
});


msg = [NSString stringWithFormat:
@"expected to have NSHashTable {[2] 2[12] 1[13] 3}with count 1, got 3\nActual Value: %@",
[table.description stringByReplacingOccurrencesOfString:@"\n" withString:@""]];
@"expected to have %@with count 1, got 3\nActual Value: %@",
tableDescription,
tableDescription];
expectFailureMessage(msg, ^{
expect(table).to(haveCount(1));
});

msg = [NSString stringWithFormat:
@"expected to not have NSHashTable {[2] 2[12] 1[13] 3}with count 3, got 3\nActual Value: %@",
[table.description stringByReplacingOccurrencesOfString:@"\n" withString:@""]];
@"expected to not have %@with count 3, got 3\nActual Value: %@",
tableDescription,
tableDescription];
expectFailureMessage(msg, ^{
expect(table).notTo(haveCount(3));
});
Expand Down
4 changes: 2 additions & 2 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function test_watchos {
run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-watchOS" -configuration "Debug" -destination "generic/platform=watchOS" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build | xcpretty

run osascript -e 'tell app "Simulator" to quit'
run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-watchOS" -configuration "Debug" -sdk "watchsimulator$BUILD_WATCHOS_SDK_VERSION" -destination "name=Apple Watch Series 6 - 40mm,OS=$RUNTIME_WATCHOS_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty
run set -o pipefail && xcodebuild -project Nimble.xcodeproj -scheme "Nimble-watchOS" -configuration "Debug" -sdk "watchsimulator$BUILD_WATCHOS_SDK_VERSION" -destination "name=Apple Watch Series 6 (40mm),OS=$RUNTIME_WATCHOS_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty
}

function test_macos {
Expand Down Expand Up @@ -113,7 +113,7 @@ function test_xcode_spm_watchos {
run osascript -e 'tell app "Simulator" to quit'
mv Nimble.xcodeproj Nimble.xcodeproj.bak
trap 'mv Nimble.xcodeproj.bak Nimble.xcodeproj' EXIT
run set -o pipefail && xcodebuild -scheme "Nimble" -configuration "Debug" -sdk "watchsimulator$BUILD_WATCHOS_SDK_VERSION" -destination "name=Apple Watch Series 6 - 40mm,OS=$RUNTIME_WATCHOS_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty
run set -o pipefail && xcodebuild -scheme "Nimble" -configuration "Debug" -sdk "watchsimulator$BUILD_WATCHOS_SDK_VERSION" -destination "name=Apple Watch Series 6 (40mm),OS=$RUNTIME_WATCHOS_VERSION" OTHER_SWIFT_FLAGS='$(inherited) -suppress-warnings' build-for-testing test-without-building | xcpretty
}

function test_podspec {
Expand Down

0 comments on commit 1a22f49

Please sign in to comment.