Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swift 6 support #204

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
27 changes: 23 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,33 @@ on:
- master

jobs:
build:
runs-on: macOS-13
# Device list: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
build-xcode-15:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer

steps:
- uses: actions/checkout@v1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.4.0"
- name: Run iOS tests
run: make test-ios
run: make test-ios-17
- name: Run tvOS tests
run: make test-tvos

build-xcode-16:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer

steps:
- uses: actions/checkout@v1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.1.0"
- name: Run iOS tests
run: make test-ios-18
- name: Run tvOS tests
run: make test-tvos
45 changes: 31 additions & 14 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -217,8 +217,9 @@
9D98822F19BC69CA00B790C6 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1120;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1620;
ORGANIZATIONNAME = "Kaishin & Co";
TargetAttributes = {
0007E16523809E9C000FED9F = {
Expand Down Expand Up @@ -338,7 +339,10 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(SRCROOT)/Demo-tvOS/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = Gifu;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.redalemeden.Gifu-tvOSDemo";
Expand All @@ -347,7 +351,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 13.2;
TVOS_DEPLOYMENT_TARGET = 18.0;
};
name = Debug;
};
Expand All @@ -368,15 +372,19 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(SRCROOT)/Demo-tvOS/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = Gifu;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.redalemeden.Gifu-tvOSDemo";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 13.2;
TVOS_DEPLOYMENT_TARGET = 18.0;
};
name = Release;
};
Expand Down Expand Up @@ -413,6 +421,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -428,7 +437,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -469,6 +478,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -477,7 +487,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -493,8 +503,11 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Demo-iOS/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = Gifu;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = net.4rays.Gifu.Demo;
PRODUCT_NAME = "Gifu-iOSDemo";
Expand All @@ -513,13 +526,17 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Demo-iOS/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = Gifu;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = net.4rays.Gifu.Demo;
PRODUCT_NAME = "Gifu-iOSDemo";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1620"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 5 additions & 5 deletions Gifu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Pod::Spec.new do |s|
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Reda Lemeden" => "[email protected]" }
s.source = { :git => "https://github.com/kaishin/Gifu.git", :tag => "v#{s.version}", :submodules => true }
s.platform = :ios, "9.0"
s.platform = :tvos, "9.0"
s.swift_versions = ["5.0", "5.1", "5.2", "5.3", "5.4"]
s.platform = :ios, "14.0"
s.platform = :tvos, "14.0"
s.swift_versions = ["5.0", "5.1", "5.2", "5.3", "5.4", "6.0", "6.1", "6.2"]
s.ios.source_files = "Sources/**/*.{h,swift}"
s.tvos.source_files = "Sources/**/*.{h,swift}"
s.ios.deployment_target = "9.0"
s.tvos.deployment_target = "9.0"
s.ios.deployment_target = "14.0"
s.tvos.deployment_target = "14.0"
end
14 changes: 9 additions & 5 deletions Gifu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1540;
LastUpgradeCheck = 1620;
ORGANIZATIONNAME = "Kaishin & Co";
TargetAttributes = {
009BD1351BBC7F6500FC982B = {
Expand Down Expand Up @@ -335,7 +335,7 @@
DEVELOPMENT_TEAM = 5G38N4D8G2;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -363,7 +363,7 @@
DEVELOPMENT_TEAM = 5G38N4D8G2;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -386,6 +386,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -447,6 +448,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -511,7 +513,7 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -527,6 +529,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 15.6;
};
name = Debug;
};
Expand All @@ -545,7 +548,7 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -561,6 +564,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 15.6;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Gifu.xcodeproj/xcshareddata/xcschemes/Gifu.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1620"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
test-ios:
test-ios-18:
set -o pipefail && \
xcodebuild test \
-project Gifu.xcodeproj \
-scheme Gifu \
-destination platform="iOS Simulator,name=iPhone 15" \
| xcpretty
-destination "platform=iOS Simulator,name=iPhone 16,OS=18.1" \
| xcbeautify

test-ios-17:
set -o pipefail && \
xcodebuild test \
-project Gifu.xcodeproj \
-scheme Gifu \
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.5" \
| xcbeautify

test-tvos:
set -o pipefail && \
xcodebuild test \
-project Gifu.xcodeproj \
-scheme Gifu \
-destination platform="tvOS Simulator,name=Apple TV" \
| xcpretty
-destination "platform=tvOS Simulator,name=Apple TV" \
| xcbeautify
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import PackageDescription
let package = Package(
name: "Gifu",
platforms: [
.iOS(.v12),
.tvOS(.v12),
.iOS(.v14),
.tvOS(.v14),
.visionOS(.v1),
],
products: [
Expand Down
33 changes: 33 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// swift-tools-version:6.0

import PackageDescription

let package = Package(
name: "Gifu",
platforms: [
.iOS(.v16),
.tvOS(.v16),
.visionOS(.v1),
],
products: [
.library(
name: "Gifu",
targets: ["Gifu"]
)
],
dependencies: [],
targets: [
.target(
name: "Gifu",
dependencies: []
)
],
swiftLanguageModes: [.v6]
)

for target in package.targets {
target.swiftSettings = target.swiftSettings ?? []
target.swiftSettings?.append(contentsOf: [
.enableUpcomingFeature("ExistentialAny")
])
}
Loading