@@ -84,6 +84,7 @@ KNOWN_SETTINGS=(
84
84
swiftpm-build-type " Debug" " the build variant for swiftpm"
85
85
swiftsyntax-build-type " Debug" " the build variant for swiftSyntax"
86
86
skstresstester-build-type " Debug" " the build variant for the SourceKit stress tester"
87
+ swiftevolve-build-type " Debug" " the build variant for the swift-evolve tool"
87
88
llbuild-enable-assertions " 1" " enable assertions in llbuild"
88
89
enable-asan " " " enable Address Sanitizer"
89
90
enable-ubsan " " " enable Undefined Behavior Sanitizer"
@@ -126,6 +127,7 @@ KNOWN_SETTINGS=(
126
127
skip-build-swiftpm " " " set to skip building swiftpm"
127
128
skip-build-swiftsyntax " " " set to skip building swiftSyntax"
128
129
skip-build-skstresstester " " " set to skip building the SourceKit stress tester"
130
+ skip-build-swiftevolve " " " set to skip building the swift-evolve tool"
129
131
skip-build-xctest " " " set to skip building xctest"
130
132
skip-build-foundation " " " set to skip building foundation"
131
133
skip-build-libdispatch " " " set to skip building libdispatch"
@@ -140,6 +142,7 @@ KNOWN_SETTINGS=(
140
142
skip-test-swiftpm " " " set to skip testing swiftpm"
141
143
skip-test-swiftsyntax " " " set to skip testing swiftSyntax"
142
144
skip-test-skstresstester " " " set to skip testing the SourceKit stress tester"
145
+ skip-test-swiftevolve " " " set to skip testing the swift-evolve tool"
143
146
skip-test-xctest " " " set to skip testing xctest"
144
147
skip-test-foundation " " " set to skip testing foundation"
145
148
skip-test-libdispatch " " " set to skip testing libdispatch"
@@ -197,6 +200,7 @@ KNOWN_SETTINGS=(
197
200
install-swiftsyntax " " " whether to install swiftsyntax"
198
201
skip-install-swiftsyntax-module " " " set to skip installing swiftsyntax modules"
199
202
install-skstresstester " " " whether to install the SourceKit stress tester"
203
+ install-swiftevolve " " " whether to install the swift-evolve tool"
200
204
install-xctest " " " whether to install xctest"
201
205
install-foundation " " " whether to install foundation"
202
206
install-libdispatch " " " whether to install libdispatch"
@@ -1177,7 +1181,9 @@ LLDB_SOURCE_DIR="${WORKSPACE}/lldb"
1177
1181
LLBUILD_SOURCE_DIR=" ${WORKSPACE} /llbuild"
1178
1182
SWIFTPM_SOURCE_DIR=" ${WORKSPACE} /swiftpm"
1179
1183
SWIFTSYNTAX_SOURCE_DIR=" ${WORKSPACE} /swift-syntax"
1180
- SKSTRESSTESTER_SOURCE_DIR=" ${WORKSPACE} /swift-stress-tester/SourceKitStressTester"
1184
+ STRESSTEST_PACKAGE_DIR=" ${WORKSPACE} /swift-stress-tester"
1185
+ SKSTRESSTESTER_SOURCE_DIR=" ${STRESSTEST_PACKAGE_DIR} /SourceKitStressTester"
1186
+ SWIFTEVOLVE_SOURCE_DIR=" ${STRESSTEST_PACKAGE_DIR} /SwiftEvolve"
1181
1187
XCTEST_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-xctest"
1182
1188
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
1183
1189
FOUNDATION_STATIC_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
@@ -1251,14 +1257,17 @@ fi
1251
1257
if [[ ! " ${SKIP_BUILD_SWIFTPM} " ]] ; then
1252
1258
PRODUCTS=(" ${PRODUCTS[@]} " swiftpm)
1253
1259
fi
1254
- # The SourceKit stress tester is dependent on SwiftSyntax, so it must be added
1255
- # to the list of build products first.
1260
+ # The SourceKit stress tester and swift-evolve are dependent on SwiftSyntax, so
1261
+ # it must be added to the list of build products first.
1256
1262
if [[ ! " ${SKIP_BUILD_SWIFTSYNTAX} " ]] ; then
1257
1263
PRODUCTS=(" ${PRODUCTS[@]} " swiftsyntax)
1258
1264
fi
1259
1265
if [[ ! " ${SKIP_BUILD_SKSTRESSTESTER} " ]] ; then
1260
1266
PRODUCTS=(" ${PRODUCTS[@]} " skstresstester)
1261
1267
fi
1268
+ if [[ ! " ${SKIP_BUILD_SWIFTEVOLVE} " ]] ; then
1269
+ PRODUCTS=(" ${PRODUCTS[@]} " swiftevolve)
1270
+ fi
1262
1271
1263
1272
# Checks if a given product is enabled (i.e. part of $PRODUCTS array)
1264
1273
function contains_product() {
@@ -1572,6 +1581,9 @@ function build_directory_bin() {
1572
1581
skstresstester)
1573
1582
echo " ${root} /${SKSTRESSTESTER_BUILD_TYPE} /bin"
1574
1583
;;
1584
+ swiftevolve)
1585
+ echo " ${root} /${SWIFTEVOLVE_BUILD_TYPE} /bin"
1586
+ ;;
1575
1587
xctest)
1576
1588
echo " ${root} /${XCTEST_BUILD_TYPE} /bin"
1577
1589
;;
@@ -1717,6 +1729,9 @@ function cmake_config_opt() {
1717
1729
skstresstester)
1718
1730
echo " --config ${SKSTRESSTESTER_BUILD_TYPE} "
1719
1731
;;
1732
+ swiftevolve)
1733
+ echo " --config ${SWIFTEVOLVE_BUILD_TYPE} "
1734
+ ;;
1720
1735
xctest)
1721
1736
echo " --config ${XCTEST_BUILD_TYPE} "
1722
1737
;;
@@ -1826,9 +1841,12 @@ function set_swiftsyntax_build_command() {
1826
1841
--filecheck-exec=" $( build_directory_bin ${LOCAL_HOST} llvm) /FileCheck" )
1827
1842
}
1828
1843
1829
- function set_skstresstester_build_command() {
1844
+ function set_stresstester_build_script_helper_command() {
1845
+ local package_name=" $1 "
1846
+ local package_build_type=" $2 "
1847
+
1830
1848
if [ " ${SKIP_BUILD_SWIFTSYNTAX} " ]; then
1831
- echo " Error: Cannot build the SourceKit stress tester without SwiftSyntax."
1849
+ echo " Error: Cannot build $package_name without SwiftSyntax."
1832
1850
exit 1
1833
1851
fi
1834
1852
@@ -1837,16 +1855,17 @@ function set_skstresstester_build_command() {
1837
1855
swiftsyntax_config=" release"
1838
1856
fi
1839
1857
local config=" debug"
1840
- if [[ $( is_cmake_release_build_type " ${SKSTRESSTESTER_BUILD_TYPE } " ) ]] ; then
1858
+ if [[ $( is_cmake_release_build_type " ${package_build_type } " ) ]] ; then
1841
1859
config=" release"
1842
1860
fi
1843
1861
1844
- skstresstester_build_command =(" ${SKSTRESSTESTER_SOURCE_DIR} /Utilities /build-script-helper.py" )
1862
+ stresstester_build_script_helper_command =(" ${STRESSTEST_PACKAGE_DIR} /build-script-helper.py" )
1845
1863
if [[ " ${VERBOSE_BUILD} " ]] ; then
1846
- skstresstester_build_command +=(-v)
1864
+ stresstester_build_script_helper_command +=(-v)
1847
1865
fi
1848
1866
1849
- skstresstester_build_command+=(
1867
+ stresstester_build_script_helper_command+=(
1868
+ --package-dir=" ${package_name} "
1850
1869
--build-dir=" ${build_dir} "
1851
1870
--swiftc-exec=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
1852
1871
--swift-build-exec=" ${SWIFT_BUILD} "
@@ -1856,6 +1875,16 @@ function set_skstresstester_build_command() {
1856
1875
--config=" ${config} " )
1857
1876
}
1858
1877
1878
+ function set_skstresstester_build_command() {
1879
+ set_stresstester_build_script_helper_command SourceKitStressTester " ${SKSTRESSTESTER_BUILD_TYPE} "
1880
+ skstresstester_build_command=(" ${stresstester_build_script_helper_command[@]} " )
1881
+ }
1882
+
1883
+ function set_swiftevolve_build_command() {
1884
+ set_stresstester_build_script_helper_command SwiftEvolve " ${SWIFTEVOLVE_BUILD_TYPE} "
1885
+ swiftevolve_build_command=(" ${stresstester_build_script_helper_command[@]} " )
1886
+ }
1887
+
1859
1888
# Construct the appropriate options to pass to an Xcode
1860
1889
# build of any LLDB target.
1861
1890
function set_lldb_xcodebuild_options() {
@@ -2544,6 +2573,16 @@ for host in "${ALL_HOSTS[@]}"; do
2544
2573
set_skstresstester_build_command
2545
2574
call " ${skstresstester_build_command[@]} "
2546
2575
2576
+ continue
2577
+ ;;
2578
+ swiftevolve)
2579
+ if [[ " $( uname -s) " != " Darwin" ]]; then
2580
+ echo " error: unable to build swift-evolve on this platform"
2581
+ continue
2582
+ fi
2583
+ set_swiftevolve_build_command
2584
+ call " ${swiftevolve_build_command[@]} "
2585
+
2547
2586
continue
2548
2587
;;
2549
2588
xctest)
@@ -3173,6 +3212,14 @@ for host in "${ALL_HOSTS[@]}"; do
3173
3212
call " ${skstresstester_build_command[@]} " test
3174
3213
continue
3175
3214
;;
3215
+ swiftevolve)
3216
+ if [[ " ${SKIP_TEST_SWIFTEVOLVE} " ]]; then
3217
+ continue
3218
+ fi
3219
+ echo " --- Running tests for ${product} ---"
3220
+ call " ${swiftevolve_build_command[@]} " test
3221
+ continue
3222
+ ;;
3176
3223
xctest)
3177
3224
if [[ " ${SKIP_TEST_XCTEST} " ]]; then
3178
3225
continue
@@ -3517,6 +3564,23 @@ for host in "${ALL_HOSTS[@]}"; do
3517
3564
call " ${skstresstester_build_command[@]} " --prefix=" ${host_install_destdir}${host_install_prefix} " install
3518
3565
continue
3519
3566
;;
3567
+ swiftevolve)
3568
+ if [[ -z " ${INSTALL_SWIFTEVOLVE} " ]] ; then
3569
+ continue
3570
+ fi
3571
+ if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
3572
+ echo " --install-destdir is required to install products."
3573
+ exit 1
3574
+ fi
3575
+ if [[ -z " ${INSTALL_SWIFTSYNTAX} " ]] ; then
3576
+ echo " --install-swiftsyntax is required to install swift-evolve"
3577
+ exit 1
3578
+ fi
3579
+
3580
+ echo " --- Installing ${product} ---"
3581
+ call " ${swiftevolve_build_command[@]} " --prefix=" ${host_install_destdir}${host_install_prefix} " install
3582
+ continue
3583
+ ;;
3520
3584
xctest)
3521
3585
if [[ -z " ${INSTALL_XCTEST} " ]] ; then
3522
3586
continue
0 commit comments