@@ -15,98 +15,119 @@ This script performs various steps associated with building the Swift toolchain:
15
15
- Optionally stages build artifacts for CI
16
16
17
17
. PARAMETER SourceCache
18
- The path to a directory where projects contributing to the Swift.
19
- toolchain have been cloned.
18
+ The path to a directory where projects contributing to the Swift toolchain have
19
+ been cloned.
20
+ Default: 'S:\SourceCache'
20
21
21
22
. PARAMETER BinaryCache
22
23
The path to a directory where to write build system files and outputs.
24
+ Default: 'S:\b'
23
25
24
26
. PARAMETER ImageRoot
25
- The path to a directory that mimics a file system image root,
26
- under which "Library" and " Program Files" subdirectories will be created
27
- with the files installed by CMake.
27
+ The path to a directory that mimics a file system image root, under which the
28
+ " Program Files" subdirectories will be created with the files installed by CMake.
29
+ Default: 'S:\'
28
30
29
- . PARAMETER CDebugFormat
30
- The debug information format for C/C++ code: dwarf or codeview.
31
+ . PARAMETER Stage
32
+ The path to a directory where built msi's and the installer executable should be
33
+ staged (for CI). Leave empty for local development builds.
31
34
32
- . PARAMETER SwiftDebugFormat
33
- The debug information format for Swift code: dwarf or codeview .
35
+ . PARAMETER PinnedBuild
36
+ The pinned bootstrap Swift toolchain used to build the Swift components with .
34
37
35
- . PARAMETER AndroidAPILevel
36
- The API Level to target when building the Android SDKs
38
+ . PARAMETER PinnedSHA256
39
+ The SHA256 for the pinned toolchain.
37
40
38
- . PARAMETER Android
39
- When set, build android SDKs.
41
+ . PARAMETER EnableCaching
42
+ Enable build caching using sccache to speed up rebuilds. Requires sccache to be
43
+ configured via environment variables. Recommended for repeated builds.
40
44
41
- . PARAMETER AndroidSDKVersions
42
- An array of SDKs to build for the Android OS.
45
+ . PARAMETER IncludeSBoM
46
+ Include Software Bill of Materials generation using syft. Used for compliance
47
+ tracking.
43
48
44
- . PARAMETER AndroidSDKArchitectures
45
- An array of architectures for which the Android Swift SDK should be built.
49
+ . PARAMETER ProductVersion
50
+ The product version to be used when building the installer. Supports semantic
51
+ version strings (e.g., "1.0.0"). Default: "0.0.0"
46
52
47
- . PARAMETER WindowsSDKVersions
48
- An array of SDKs to build for the Windows OS.
53
+ . PARAMETER ToolchainIdentifier
54
+ The toolchain version identifier for the toolchain being built.
55
+ Default: Uses TOOLCHAIN_VERSION environment variable or "$USERNAME.development"
49
56
50
- . PARAMETER WindowsSDKArchitectures
51
- An array of architectures for which the Windows Swift SDK should be built.
57
+ . PARAMETER HostArchName
58
+ The architecture where the toolchain will execute. Automatically detected from
59
+ system. Valid values: AMD64, ARM64
52
60
53
- . PARAMETER ProductVersion
54
- The product version to be used when building the installer.
55
- Supports semantic version strings.
61
+ . PARAMETER DebugInfo
62
+ Include debug information in the builds. Useful for debugging the toolchain
63
+ itself.
64
+ Note: This significantly increases build time and disk usage.
56
65
57
- . PARAMETER PinnedBuild
58
- The toolchain snapshot to build the early components with.
66
+ . PARAMETER CDebugFormat
67
+ The debug information format for C/C++ code. Valid values: dwarf, codeview.
68
+ Default: dwarf
59
69
60
- . PARAMETER PinnedSHA256
61
- The SHA256 for the pinned toolchain.
70
+ . PARAMETER SwiftDebugFormat
71
+ The debug information format for Swift code. Valid values: dwarf, codeview.
72
+ Default: dwarf
73
+
74
+ . PARAMETER Android
75
+ Build Android SDKs. Requires Android NDK to be available.
62
76
63
77
. PARAMETER AndroidNDKVersion
64
78
The version number of the Android NDK to be used.
79
+ Format: r{number}[{letter}] (e.g., r27c)
80
+ Default: "r27c"
81
+
82
+ . PARAMETER AndroidAPILevel
83
+ The API Level to target when building the Android SDKs. Must be between 1 and 36.
84
+ Default: 28
85
+
86
+ . PARAMETER AndroidSDKVersions
87
+ An array of SDKs to build for the Android OS.
88
+ Default: @("Android", "AndroidExperimental")
89
+
90
+ . PARAMETER AndroidSDKArchitectures
91
+ An array of architectures for which the Android Swift SDK should be built.
92
+ Default: @("aarch64", "armv7", "i686", "x86_64")
65
93
66
94
. PARAMETER WinSDKVersion
67
95
The version number of the Windows SDK to be used.
68
96
Overrides the value resolved by the Visual Studio command prompt.
69
97
If no such Windows SDK is installed, it will be downloaded from nuget.
70
98
71
- . PARAMETER IncludeDS2
72
- Include the ds2 remote debug server in the SDK.
73
- This component is currently only supported in Android builds.
74
-
75
- . PARAMETER SkipBuild
76
- If set, does not run the build phase.
77
-
78
- . PARAMETER SkipPackaging
79
- If set, skips building the msi's and installer
80
-
81
- . PARAMETER DebugInfo
82
- If set, debug information will be generated for the builds.
99
+ . PARAMETER WindowsSDKVersions
100
+ An array of SDKs to build for the Windows OS.
101
+ Default: @("Windows", "WindowsExperimental")
83
102
84
- . PARAMETER EnableCaching
85
- If true, use `sccache` to cache the build rules. Configuration of sccache must be done through
86
- the environment variables defined by the sccache project.
103
+ . PARAMETER WindowsSDKArchitectures
104
+ An array of architectures for which the Windows Swift SDK should be built.
105
+ Default: @("X64","X86","ARM64")
87
106
88
107
. PARAMETER Clean
89
- If true, clean non-compiler builds while building.
108
+ Clean non-compiler builds while building. Use this for a fresh build when
109
+ experiencing issues.
90
110
91
- . PARAMETER Test
92
- An array of names of projects to run tests for.
93
- '*' runs all tests
111
+ . PARAMETER SkipBuild
112
+ Skip the build phase entirely. Useful for testing packaging or other post-build
113
+ steps.
94
114
95
- . PARAMETER Stage
96
- The path to a directory where built msi's and the installer executable should be staged ( for CI) .
115
+ . PARAMETER SkipPackaging
116
+ Skip building the MSI installers and packaging. Useful for development builds .
97
117
98
- . PARAMETER ToBatch
99
- When set, runs the script in a special mode which outputs a listing of command invocations
100
- in batch file format instead of executing them.
118
+ . PARAMETER Test
119
+ An array of names of projects to run tests for. Use '*' to run all tests.
120
+ Available tests: lld, lldb, swift, dispatch, foundation, xctest, swift-format, sourcekit-lsp
101
121
102
- . PARAMETER HostArchName
103
- The architecture where the toolchain will execute.
122
+ . PARAMETER IncludeDS2
123
+ Include the ds2 remote debug server in the SDK.
124
+ This component is currently only supported in Android builds.
104
125
105
126
. PARAMETER IncludeNoAsserts
106
- If set, the no-assert toolchain variant is also build and included in the output.
127
+ Build and include the no-assert toolchain variant in the output.
107
128
108
- . PARAMETER FoundationTestConfiguration
109
- Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration .
129
+ . PARAMETER Summary
130
+ Display a build time summary at the end of the build. Helpful for performance analysis .
110
131
111
132
. EXAMPLE
112
133
PS> .\Build.ps1
0 commit comments