Skip to content

Commit fcc1d00

Browse files
authored
Merge pull request swiftlang#83781 from compnerd/documentation
2 parents 31c6cb2 + 7204559 commit fcc1d00

File tree

1 file changed

+78
-57
lines changed

1 file changed

+78
-57
lines changed

utils/build.ps1

Lines changed: 78 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,98 +15,119 @@ This script performs various steps associated with building the Swift toolchain:
1515
- Optionally stages build artifacts for CI
1616
1717
.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'
2021
2122
.PARAMETER BinaryCache
2223
The path to a directory where to write build system files and outputs.
24+
Default: 'S:\b'
2325
2426
.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:\'
2830
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.
3134
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.
3437
35-
.PARAMETER AndroidAPILevel
36-
The API Level to target when building the Android SDKs
38+
.PARAMETER PinnedSHA256
39+
The SHA256 for the pinned toolchain.
3740
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.
4044
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.
4348
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"
4652
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"
4956
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
5260
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.
5665
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
5969
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.
6276
6377
.PARAMETER AndroidNDKVersion
6478
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")
6593
6694
.PARAMETER WinSDKVersion
6795
The version number of the Windows SDK to be used.
6896
Overrides the value resolved by the Visual Studio command prompt.
6997
If no such Windows SDK is installed, it will be downloaded from nuget.
7098
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")
83102
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")
87106
88107
.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.
90110
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.
94114
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.
97117
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
101121
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.
104125
105126
.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.
107128
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.
110131
111132
.EXAMPLE
112133
PS> .\Build.ps1

0 commit comments

Comments
 (0)