Skip to content

Commit

Permalink
Merge pull request #98 from 417-72KI/xcode-15
Browse files Browse the repository at this point in the history
Xcode 15 compatible
  • Loading branch information
417-72KI authored Jul 2, 2024
2 parents ba12217 + d7c5493 commit f94c108
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"xcode_version": [
"14.2"
"15.4",
"15.2"
]
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
test:
name: Test
needs: generate-matrix
runs-on: macOS-12
runs-on: macOS-14
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
test_demo:
name: Test demo app
needs: generate-matrix
runs-on: macOS-12
runs-on: macOS-14
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
report:
name: Report
needs: [test, test_demo]
runs-on: macOS-12
runs-on: macOS-14
if: ${{ (success() || failure()) }}
steps:
- uses: actions/download-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
release-assets:
name: Release Assets
runs-on: macOS-12
runs-on: macOS-14
env:
EXECUTABLE_NAME: buildconfigswift
EXECUTABLE_VERSION: ${{ github.ref_name }}
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
podspec:
name: Podspec
needs: release-assets
runs-on: macOS-12
runs-on: macOS-14
env:
POD_VERSION: ${{ github.ref_name }}
steps:
Expand Down
8 changes: 3 additions & 5 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ excluded:
- Dangerfile.swift
allow_zero_lintable_files: true
opt_in_rules: [all]
analyzer_rules:
- capture_variable
- explicit_self
- unused_declaration
- unused_import
analyzer_rules: [all]
disabled_rules:
- anonymous_argument_in_multiline_closure
- explicit_acl
Expand All @@ -28,8 +24,10 @@ disabled_rules:
- missing_docs
- no_extension_access_modifier
- no_grouping_extension
- one_declaration_per_file
- prefixed_toplevel_constant
- required_deinit
- shorthand_argument
- sorted_enum_cases
- strict_fileprivate
- switch_case_on_newline
Expand Down
39 changes: 19 additions & 20 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
// swift-tools-version:5.7
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let isDevelop = true

let devDependencies: [Package.Dependency] = isDevelop ? [
.package(url: "https://github.com/realm/SwiftLint.git", from: "0.53.0"),
] : []
let devPlugins: [Target.PluginUsage] = isDevelop ? [
.plugin(name: "SwiftLintPlugin", package: "SwiftLint")
] : []

let package = Package(
name: "BuildConfig.swift",
platforms: [.macOS(.v12)],
platforms: [.macOS(.v14)],
products: [
.executable(
name: "buildconfigswift",
Expand All @@ -32,48 +25,43 @@ let package = Package(
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/SwiftGen/StencilSwiftKit.git", from: "2.10.1"),
.package(url: "https://github.com/Kuniwak/MirrorDiffKit.git", from: "5.0.1"),
] + devDependencies,
],
targets: [
.executableTarget(
name: "buildconfigswift",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Core"
],
plugins: devPlugins
]
),
.target(
name: "Core",
dependencies: [
"Common",
"Parser",
"Generator"
],
plugins: devPlugins
]
),
.target(
name: "Common",
dependencies: [
"PathKit",
.product(name: "SourceKittenFramework", package: "SourceKitten"),
],
plugins: devPlugins
]
),
.target(
name: "Parser",
dependencies: [
"Common",
.product(name: "Yaml", package: "YamlSwift"),
],
plugins: devPlugins
]
),
.target(
name: "Generator",
dependencies: [
"Common",
"StencilSwiftKit"
],
plugins: devPlugins
]
),
.testTarget(
name: "buildconfigswiftTests",
Expand Down Expand Up @@ -107,3 +95,14 @@ let package = Package(
],
swiftLanguageVersions: [.v5]
)

if isDevelop {
package.dependencies += [
.package(url: "https://github.com/realm/SwiftLint.git", from: "0.55.0"),
]
package.targets.filter { $0.type == .regular }.forEach { target in
target.plugins = (target.plugins ?? []) + [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
}
}
2 changes: 1 addition & 1 deletion Sources/Generator/CodeGenerator/CodeGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension CodeGenerator {
withJSONObject: json,
options: [.sortedKeys, .prettyPrinted]
)
rawDataString = String(data: rawData, encoding: .utf8) ?? ""
rawDataString = String(decoding: rawData, as: UTF8.self)
}
return try render(with: .rawData(asBinary: asBinary), dictionary: ["rawData": rawDataString])
}
Expand Down

0 comments on commit f94c108

Please sign in to comment.