Skip to content

Commit

Permalink
Supports for Xcode 15
Browse files Browse the repository at this point in the history
  • Loading branch information
tid-kijyun committed Feb 22, 2024
1 parent 86bca4f commit e2cc244
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:

jobs:
mac:
runs-on: macos-11
runs-on: macos-14
strategy:
matrix:
xcode: [11.7, 12.5.1, 13.1]
xcode: [14.3.1, 15.2]
fail-fast: false
name: Xcode ${{ matrix.xcode }}
env:
Expand All @@ -21,9 +21,9 @@ jobs:
run: |
set -o pipefail
xcodebuild build-for-testing test-without-building -scheme Kanna -configuration Release ENABLE_TESTABILITY=YES | xcpretty -c
xcodebuild build-for-testing test-without-building -scheme Kanna -configuration Release -sdk iphonesimulator -destination "name=iPhone 8" ENABLE_TESTABILITY=YES | xcpretty -c
xcodebuild build-for-testing test-without-building -scheme Kanna -configuration Release -sdk iphonesimulator -destination "name=iPhone 15" ENABLE_TESTABILITY=YES | xcpretty -c
xcodebuild build-for-testing test-without-building -scheme Kanna -configuration Release -sdk appletvsimulator -destination "name=Apple TV" ENABLE_TESTABILITY=YES | xcpretty -c
xcodebuild -scheme Kanna -configuration Release -sdk watchsimulator -destination "name=Apple Watch Series 4 - 40mm"
xcodebuild -scheme Kanna -configuration Release -sdk watchsimulator -destination "name=Apple Watch Series 8 (45mm)"
- name: swiftpm build and test
run: |
swift build
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2
5.9
60 changes: 49 additions & 11 deletions Kanna.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
1E76C39D2B86F5EA009A89B9 /* Bundle+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */; };
1E7ADC3D1DF4F3FC006E1815 /* Kanna.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E7ADC331DF4F3FC006E1815 /* Kanna.framework */; };
1E7ADC561DF4F567006E1815 /* CSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E7ADC4F1DF4F567006E1815 /* CSS.swift */; };
1E7ADC581DF4F567006E1815 /* Kanna.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E7ADC511DF4F567006E1815 /* Kanna.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -41,6 +42,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+.swift"; sourceTree = "<group>"; };
1E7ADC331DF4F3FC006E1815 /* Kanna.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Kanna.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1E7ADC3C1DF4F3FC006E1815 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1E7ADC4F1DF4F567006E1815 /* CSS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CSS.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -152,6 +154,7 @@
1E7ADC8C1DF55B37006E1815 /* KannaTutorialsTest.swift */,
1E7ADC9A1DF5907F006E1815 /* Data */,
1E7ADC8A1DF55B37006E1815 /* Info.plist */,
1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */,
);
path = KannaTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -240,8 +243,9 @@
1E7ADC2A1DF4F3FC006E1815 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1520;
ORGANIZATIONNAME = "Atsushi Kiwaki";
TargetAttributes = {
1E7ADC321DF4F3FC006E1815 = {
Expand Down Expand Up @@ -340,6 +344,7 @@
buildActionMask = 2147483647;
files = (
1E7ADC931DF55B37006E1815 /* KannaHTMLTests.swift in Sources */,
1E76C39D2B86F5EA009A89B9 /* Bundle+.swift in Sources */,
1E7ADC941DF55B37006E1815 /* KannaTutorialsTest.swift in Sources */,
1EB4A01F204C1F240003D7A2 /* KannaCSSTests.swift in Sources */,
1E7E698A204C1D6300516E31 /* KannaXMLModifyingTests.swift in Sources */,
Expand Down Expand Up @@ -385,6 +390,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -394,9 +400,11 @@
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
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 Down Expand Up @@ -453,6 +461,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -462,9 +471,11 @@
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
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,8 +488,9 @@
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_INCLUDE_PATHS = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -493,17 +505,25 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Sources/Kanna/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
OTHER_LDFLAGS = "-lxml2";
PRODUCT_BUNDLE_IDENTIFIER = com.tid.Kanna;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -520,17 +540,25 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_MODULE_VERIFIER = YES;
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Sources/Kanna/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
OTHER_LDFLAGS = "-lxml2";
PRODUCT_BUNDLE_IDENTIFIER = com.tid.Kanna;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -548,9 +576,14 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = DP9Q5R8635;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = com.tid.KannaTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -566,9 +599,14 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = DP9Q5R8635;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_BUNDLE_IDENTIFIER = com.tid.KannaTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
24 changes: 10 additions & 14 deletions Kanna.xcodeproj/xcshareddata/xcschemes/Kanna.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E7ADC321DF4F3FC006E1815"
BuildableName = "Kanna.framework"
BlueprintName = "Kanna"
ReferencedContainer = "container:Kanna.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E7ADC321DF4F3FC006E1815"
BuildableName = "Kanna.framework"
BlueprintName = "Kanna"
ReferencedContainer = "container:Kanna.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:Kanna.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
13 changes: 9 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

Expand Down Expand Up @@ -50,8 +50,13 @@ let package = Package(
),
.testTarget(
name: "KannaTests",
dependencies: ["Kanna"]
dependencies: ["Kanna"],
exclude: [
"Info.plist",
],
resources: [
.process("Data"),
]
)
],
swiftLanguageVersions: [.v5]
]
)
19 changes: 19 additions & 0 deletions Tests/KannaTests/Bundle+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Bundle+.swift
// Tests
//
// Created by Atsushi Kiwaki on 2024/02/22.
// Copyright © 2024 Atsushi Kiwaki. All rights reserved.
//

import Foundation

extension Bundle {
static func testBundle(for aClass: AnyClass) -> Bundle {
#if SWIFT_PACKAGE
module
#else
Bundle(for: aClass)
#endif
}
}
9 changes: 6 additions & 3 deletions Tests/KannaTests/KannaHTMLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class KannaHTMLTests: XCTestCase {
func testHTML4() {
// This is an example of a functional test case.
let filename = "test_HTML4"
guard let path = Bundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
guard let path = Bundle.testBundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
XCTFail()
return
}

Expand Down Expand Up @@ -103,7 +104,8 @@ class KannaHTMLTests: XCTestCase {

func testInnerHTML() {
let filename = "test_HTML4"
guard let path = Bundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
guard let path = Bundle.testBundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
XCTFail()
return
}

Expand Down Expand Up @@ -176,7 +178,8 @@ class KannaHTMLTests: XCTestCase {

func testOutOfDocument() {
let filename = "test_HTML4"
guard let path = Bundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
guard let path = Bundle.testBundle(for: KannaHTMLTests.self).path(forResource: filename, ofType: "html") else {
XCTFail()
return
}

Expand Down
Loading

0 comments on commit e2cc244

Please sign in to comment.