Skip to content

Commit

Permalink
Set minimum platform for macOS (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
art-divin committed Mar 29, 2024
1 parent 8599afb commit dcc9fc5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions SourcerySwift/Sources/SwiftTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ open class SwiftTemplate {
return binaryFile
}

#if os(macOS)
private var manifestCode: String {
return """
// swift-tools-version:5.7
Expand All @@ -285,6 +286,9 @@ open class SwiftTemplate {
let package = Package(
name: "SwiftTemplate",
platforms: [
.macOS(.v10_15)
],
products: [
.executable(name: "SwiftTemplate", targets: ["SwiftTemplate"])
],
Expand All @@ -295,7 +299,27 @@ open class SwiftTemplate {
)
"""
}
#else
private var manifestCode: String {
return """
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SwiftTemplate",
products: [
.executable(name: "SwiftTemplate", targets: ["SwiftTemplate"])
],
targets: [
.target(name: "SourceryRuntime"),
.executableTarget(name: "SwiftTemplate", dependencies: ["SourceryRuntime"])
]
)
"""
}
#endif
var cacheKey: String? {
var contents = code

Expand Down

0 comments on commit dcc9fc5

Please sign in to comment.