-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift.template
More file actions
96 lines (85 loc) · 3.74 KB
/
Package.swift.template
File metadata and controls
96 lines (85 loc) · 3.74 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// swift-tools-version: 6.2
import PackageDescription
// GENERATOR MARK: HEADER
let package = Package(
name: "CPicoSDK",
products: [
.library(name: "CPicoSDK", targets: ["CPicoSDK"]),
.plugin(name: "PIOASM", targets: ["PIOASMPlugin"]),
.plugin(name: "PrepareEnvironment", targets: ["PrepareEnvironmentPlugin"]),
.plugin(name: "FinalizeBinary", targets: ["FinalizeBinaryPlugin"]),
],
traits: [
// TODO: The generator needs to define traits. This needs to be implemented.
.trait(name: "Platform_RP2350"),
.trait(name: "Platform_RP2350_arm_s"),
.trait(name: "Platform_RP2350_riscv"),
.trait(name: "Platform_Host"),
.trait(name: "Variant_RP2350A"),
.trait(name: "Variant_RP2350B"),
.trait(name: "Radio_None"),
.trait(name: "Radio_CYW43439"),
.trait(name: "BootStage2_W25Q080"),
.trait(name: "BootStage2_GENERIC_03H"),
.trait(name: "BootStage2_W25X10CL"),
.trait(name: "BootStage2_IS25LP080"),
.trait(name: "BootStage2_AT25SF128A"),
.trait(name: "StdIO_Automatic", description: "Enables stdio through USB when using picotool and UART when using cortex-debug."),
.trait(name: "StdIO_UART", description: "Enables stdio operations through UART pins"),
.trait(name: "StdIO_USB", description: "Enables stdio operations through USB"),
.trait(name: "StdIO_RTT", description: "Enables stdio operations through the RTT debugging protocol"),
// GENERATOR MARK: TRAITS
],
dependencies: [
.package(url: "https://github.com/sympatito/PicoSDKDownloader", from: "0.0.4"),
],
targets: [
// GENERATOR MARK: TARGETS
// Mixed targets
.target(
name: "CPicoSDK",
dependencies: [
// GENERATOR MARK: TARGET DEPENDENCIES
]
),
// Manually defined targets
.plugin(
name: "PIOASMPlugin",
capability: .buildTool,
dependencies: ["PIOASM", "pioasm-swift"]
),
.binaryTarget(name: "PIOASM", path: "Sources/PIOASM/PIOASM.artifactbundle"),
.executableTarget(name: "pioasm-swift", path: "Sources/PIOASM/pioasm-swift"),
.plugin(
name: "GenerateCPicoSDKPlugin",
capability: .command(
intent: .custom(verb: "generate-cpicosdk", description: "Generates CPicoSDK target files"),
permissions: [
.writeToPackageDirectory(reason: "Needs to write CPicoSDK target files, can't generate using prebuildCommand yet because it's a .h header file."),
]
)
),
.plugin(
name: "PrepareEnvironmentPlugin",
capability: .command(
intent: .custom(verb: "prepare-rp2xxx-environment", description: "Ensure environment for CPicoSDK is in place"),
permissions: [
.writeToPackageDirectory(reason: "Returns bash code that prepares the environment for building with CPicoSDK."),
.allowNetworkConnections(scope: .all(), reason: "Downloads Pico SDK, ARM toolchain and other dependencies.")
]
),
dependencies: [
.product(name: "pico-bootstrap", package: "PicoSDKDownloader"),
]
),
.plugin(
name: "FinalizeBinaryPlugin",
capability: .command(
intent: .custom(verb: "finalize-rp2xxx-binary", description: "Generates CPicoSDK target files"),
permissions: [
.writeToPackageDirectory(reason: "Finalizes build by linking with pico-sdk and generates UF2 and ELF binaries."),
]
)
),
]
)