-
Notifications
You must be signed in to change notification settings - Fork 41
/
Package.swift
37 lines (35 loc) · 2.01 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "skip",
defaultLocalization: "en",
platforms: [
.iOS(.v16),
.macOS(.v13),
.tvOS(.v16),
.watchOS(.v9),
.macCatalyst(.v16),
],
products: [
.executable(name: "skip", targets: ["skip"]),
.plugin(name: "skipstone", targets: ["skipstone"]),
.plugin(name: "skiplink", targets: ["Create SkipLink"]),
.library(name: "SkipDrive", targets: ["SkipDrive"]),
.library(name: "SkipTest", targets: ["SkipTest"]),
],
targets: [
.plugin(name: "skipstone", capability: .buildTool(), dependencies: ["skip"], path: "Plugins/SkipPlugin"),
.plugin(name: "Create SkipLink", capability: .command(intent: .custom(verb: "SkipLink", description: "Create local links to transpiled output"), permissions: [.writeToPackageDirectory(reason: "This command will create local links to the skipstone output for the specified package(s), enabling access to the transpiled Kotlin")]), dependencies: ["skip"], path: "Plugins/SkipLink"),
.target(name: "SkipDrive", dependencies: ["skipstone", .target(name: "skip")]),
.target(name: "SkipTest", dependencies: [.target(name: "SkipDrive", condition: .when(platforms: [.macOS]))]),
.testTarget(name: "SkipTestTests", dependencies: ["SkipTest"]),
.testTarget(name: "SkipDriveTests", dependencies: ["SkipDrive"]),
.binaryTarget(name: "skip", url: "https://source.skip.tools/skip/releases/download/1.1.24/skip.zip", checksum: "845b3b07f256c3b1a7b008564e865137d53b610a7d6b97a27fc4b38557ae98d0")
]
)
import Foundation
let env = ProcessInfo.processInfo.environment
if (env["SKIPLOCAL"] != nil || env["PWD"]?.hasSuffix("skipstone") == true) {
package.dependencies = package.dependencies.dropLast() + [.package(path: env["SKIPLOCAL"] ?? "../skipstone")]
package.targets = package.targets.dropLast() + [.executableTarget(name: "skip", dependencies: [.product(name: "SkipBuild", package: "skipstone")])]
}