Skip to content

Commit

Permalink
Add minimum deployment target in template (#165)
Browse files Browse the repository at this point in the history
* Add minimum deployment target in template

* import TokamakDOM instead of Shim to avoid minimum deployment issue

* Bump initial Tokamak version 0.5.1
  • Loading branch information
kateinoigakukun authored Nov 9, 2020
1 parent c3bbfb3 commit c9777dd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Sources/carton/Model/Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,22 @@ extension Template {
static func createManifest(
fileSystem: FileSystem,
project: Project,
platforms: [String] = [],
dependencies: [PackageDependency] = [],
targetDepencencies: [TargetDependency] = [],
_ terminal: InteractiveWriter
) throws {
try fileSystem.writeFileContents(project.path.appending(component: "Package.swift")) {
"""
var content = """
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "\(project.name)",
name: "\(project.name)",\n
"""
if !platforms.isEmpty {
content += " platforms: [\(platforms.joined(separator: ",\n"))],\n"
}
content += """
products: [
.executable(name: "\(project.name)", targets: ["\(project.name)"])
],
Expand All @@ -114,7 +120,7 @@ extension Template {
]
)
"""
.write(to: $0)
content.write(to: $0)
}
}
}
Expand Down Expand Up @@ -168,11 +174,12 @@ extension Templates {
try createManifest(
fileSystem: fileSystem,
project: project,
platforms: [".macOS(.v10_15)"],
dependencies: [
.init(
name: "Tokamak",
url: "https://github.com/TokamakUI/Tokamak",
version: .from("0.5.0")
version: .from("0.5.1")
),
],
targetDepencencies: [
Expand All @@ -186,7 +193,7 @@ extension Templates {
"main.swift"
)) {
"""
import TokamakShim
import TokamakDOM
struct TokamakApp: App {
var body: some Scene {
Expand Down

0 comments on commit c9777dd

Please sign in to comment.