-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathPackage.swift
More file actions
44 lines (41 loc) · 2.39 KB
/
Package.swift
File metadata and controls
44 lines (41 loc) · 2.39 KB
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
38
39
40
41
42
43
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: "skip",
defaultLocalization: "en",
platforms: [
.iOS(.v16),
.macOS(.v13),
.tvOS(.v16),
.watchOS(.v9),
.macCatalyst(.v16),
],
products: [
.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, .linux]))]),
.testTarget(name: "SkipTestTests", dependencies: ["SkipTest"]),
.testTarget(name: "SkipDriveTests", dependencies: ["SkipDrive"]),
]
)
let env = Context.environment
if (env["SKIPLOCAL"] != nil || env["PWD"]?.hasSuffix("skipstone") == true) {
package.dependencies += [.package(path: env["SKIPLOCAL"] ?? "../skipstone")]
package.targets += [.executableTarget(name: "skip", dependencies: [.product(name: "SkipBuild", package: "skipstone")])]
} else {
#if os(macOS)
package.targets += [.binaryTarget(name: "skip", url: "https://source.skip.tools/skip/releases/download/1.8.9/skip-macos.zip", checksum: "29237e05eb6c7114bed5acc66dc3112bc3118e6583a5b6528b432b952d5709ea")]
#elseif os(Linux)
package.targets += [.binaryTarget(name: "skip", url: "https://source.skip.tools/skip/releases/download/1.8.9/skip-linux.zip", checksum: "c5df110705af3ce1b5a318b0fa35b43e1fd27e9bf6675e7cfb273f1b28aa0d0a")]
#else
package.dependencies += [.package(url: "https://source.skip.tools/skipstone.git", exact: "1.8.9")]
package.targets += [.executableTarget(name: "skip", dependencies: [.product(name: "SkipBuild", package: "skipstone")])]
#endif
}