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

Supports for Xcode 15 #265

Merged
merged 2 commits into from
Feb 22, 2024
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
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
3 changes: 2 additions & 1 deletion Kanna.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ Pod::Spec.new do |s|
s.author = { "Atsushi Kiwaki" => "[email protected]" }
s.source = { :git => "https://github.com/tid-kijyun/Kanna.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/_tid_'
s.swift_versions = ["5.0", "5.1", "5.2"]
s.swift_versions = '5'

s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"
s.requires_arc = true
s.source_files = ['Sources/**/*.swift', 'Sources/**/*.h']
s.resource_bundles = {'kanna_privacy' => ['Kanna/PrivacyInfo.xcprivacy']}
s.xcconfig = {
'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2',
'OTHER_LDFLAGS' => '-lxml2'
Expand Down
64 changes: 53 additions & 11 deletions Kanna.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
1E76C39D2B86F5EA009A89B9 /* Bundle+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */; };
1E76C39F2B86F907009A89B9 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 1E76C39E2B86F907009A89B9 /* PrivacyInfo.xcprivacy */; };
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 +43,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+.swift"; sourceTree = "<group>"; };
1E76C39E2B86F907009A89B9 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; 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 @@ -129,6 +133,7 @@
1E7ADC551DF4F567006E1815 /* libxmlParserOption.swift */,
1EC805F91FA2FB2F0067D3DA /* Deprecated.swift */,
1E7ADC501DF4F567006E1815 /* Info.plist */,
1E76C39E2B86F907009A89B9 /* PrivacyInfo.xcprivacy */,
);
path = Kanna;
sourceTree = "<group>";
Expand All @@ -152,6 +157,7 @@
1E7ADC8C1DF55B37006E1815 /* KannaTutorialsTest.swift */,
1E7ADC9A1DF5907F006E1815 /* Data */,
1E7ADC8A1DF55B37006E1815 /* Info.plist */,
1E76C39C2B86F5EA009A89B9 /* Bundle+.swift */,
);
path = KannaTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -240,8 +246,9 @@
1E7ADC2A1DF4F3FC006E1815 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1520;
ORGANIZATIONNAME = "Atsushi Kiwaki";
TargetAttributes = {
1E7ADC321DF4F3FC006E1815 = {
Expand Down Expand Up @@ -281,6 +288,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1E76C39F2B86F907009A89B9 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -340,6 +348,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 +394,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 +404,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 +465,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 +475,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 +492,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 +509,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 +544,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 +580,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 +603,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
16 changes: 12 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 @@ -46,12 +46,20 @@ let package = Package(
"Kanna/Info.plist",
"Kanna/Kanna.h",
"../Tests/KannaTests/Data"
],
resources: [
.copy("Kanna/PrivacyInfo.xcprivacy"),
]
),
.testTarget(
name: "KannaTests",
dependencies: ["Kanna"]
dependencies: ["Kanna"],
exclude: [
"Info.plist",
],
resources: [
.process("Data"),
]
)
],
swiftLanguageVersions: [.v5]
]
)
14 changes: 14 additions & 0 deletions Sources/Kanna/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
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
Loading