@@ -81,6 +81,7 @@ KNOWN_SETTINGS=(
81
81
playgroundsupport-build-type " Debug" " the build variant for PlaygroundSupport"
82
82
xctest-build-type " Debug" " the build variant for xctest"
83
83
swiftpm-build-type " Debug" " the build variant for swiftpm"
84
+ swiftsyntax-build-type " Debug" " the build variant for swiftSyntax"
84
85
llbuild-enable-assertions " 1" " enable assertions in llbuild"
85
86
enable-asan " " " enable Address Sanitizer"
86
87
enable-ubsan " " " enable Undefined Behavior Sanitizer"
@@ -121,6 +122,7 @@ KNOWN_SETTINGS=(
121
122
skip-build-lldb " " " set to skip building LLDB"
122
123
skip-build-llbuild " " " set to skip building llbuild"
123
124
skip-build-swiftpm " " " set to skip building swiftpm"
125
+ skip-build-swiftsyntax " " " set to skip building swiftSyntax"
124
126
skip-build-xctest " " " set to skip building xctest"
125
127
skip-build-foundation " " " set to skip building foundation"
126
128
skip-build-libdispatch " " " set to skip building libdispatch"
@@ -133,6 +135,7 @@ KNOWN_SETTINGS=(
133
135
skip-test-swift " " " set to skip testing Swift"
134
136
skip-test-llbuild " " " set to skip testing llbuild"
135
137
skip-test-swiftpm " " " set to skip testing swiftpm"
138
+ skip-test-swiftsyntax " " " set to skip testing swiftSyntax"
136
139
skip-test-xctest " " " set to skip testing xctest"
137
140
skip-test-foundation " " " set to skip testing foundation"
138
141
skip-test-libdispatch " " " set to skip testing libdispatch"
@@ -141,7 +144,7 @@ KNOWN_SETTINGS=(
141
144
skip-test-linux " " " set to skip testing Swift stdlibs for Linux"
142
145
skip-test-freebsd " " " set to skip testing Swift stdlibs for FreeBSD"
143
146
skip-test-cygwin " " " set to skip testing Swift stdlibs for Cygwin"
144
- skip-test-haiku " " " set to skip testing Swift stdlibs for Haiku"
147
+ skip-test-haiku " " " set to skip testing Swift stdlibs for Haiku"
145
148
skip-test-osx " " " set to skip testing Swift stdlibs for OS X"
146
149
skip-test-ios-32bit-simulator " " " set to skip testing Swift stdlibs for iOS 32bit simulators"
147
150
skip-test-ios-simulator " " " set to skip testing Swift stdlibs for iOS simulators (i.e. test devices only)"
@@ -1161,6 +1164,7 @@ CMARK_SOURCE_DIR="${WORKSPACE}/cmark"
1161
1164
LLDB_SOURCE_DIR=" ${WORKSPACE} /lldb"
1162
1165
LLBUILD_SOURCE_DIR=" ${WORKSPACE} /llbuild"
1163
1166
SWIFTPM_SOURCE_DIR=" ${WORKSPACE} /swiftpm"
1167
+ SWIFTSYNTAX_SOURCE_DIR=" ${WORKSPACE} /swift-syntax"
1164
1168
XCTEST_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-xctest"
1165
1169
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
1166
1170
LIBDISPATCH_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-libdispatch"
@@ -1207,22 +1211,27 @@ fi
1207
1211
if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " ]] ; then
1208
1212
PRODUCTS=(" ${PRODUCTS[@]} " libdispatch)
1209
1213
fi
1210
- # SwiftPM and XCTest are dependent on Foundation, so Foundation must be
1214
+ # LLBuild, SwiftPM, SwiftSyntax and XCTest are dependent on Foundation, so Foundation must be
1211
1215
# added to the list of build products first.
1212
1216
if [[ ! " ${SKIP_BUILD_FOUNDATION} " ]] ; then
1213
1217
PRODUCTS=(" ${PRODUCTS[@]} " foundation)
1214
1218
fi
1215
1219
if [[ ! " ${SKIP_BUILD_PLAYGROUNDSUPPORT} " ]] ; then
1216
1220
PRODUCTS=(" ${PRODUCTS[@]} " playgroundsupport)
1217
1221
fi
1218
- # SwiftPM is dependent on XCTest, so XCTest must be added to the list of
1222
+ # SwiftPM and SwiftSyntax are dependent on XCTest, so XCTest must be added to the list of
1219
1223
# build products first.
1220
1224
if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
1221
1225
PRODUCTS=(" ${PRODUCTS[@]} " xctest)
1222
1226
fi
1227
+ # SwiftSyntax is dependent on SwiftPM, so SwiftPM must be added to the list of
1228
+ # build products first.
1223
1229
if [[ ! " ${SKIP_BUILD_SWIFTPM} " ]] ; then
1224
1230
PRODUCTS=(" ${PRODUCTS[@]} " swiftpm)
1225
1231
fi
1232
+ if [[ ! " ${SKIP_BUILD_SWIFTSYNTAX} " ]] ; then
1233
+ PRODUCTS=(" ${PRODUCTS[@]} " swiftsyntax)
1234
+ fi
1226
1235
1227
1236
# Checks if a given product is enabled (i.e. part of $PRODUCTS array)
1228
1237
function contains_product() {
@@ -1530,6 +1539,9 @@ function build_directory_bin() {
1530
1539
swiftpm)
1531
1540
echo " ${root} /${SWIFTPM_BUILD_TYPE} /bin"
1532
1541
;;
1542
+ swiftsyntax)
1543
+ echo " ${root} /${SWIFTSYNTAX_BUILD_TYPE} /bin"
1544
+ ;;
1533
1545
xctest)
1534
1546
echo " ${root} /${XCTEST_BUILD_TYPE} /bin"
1535
1547
;;
@@ -1550,7 +1562,13 @@ function build_directory_bin() {
1550
1562
;;
1551
1563
esac
1552
1564
else
1553
- echo " ${root} /bin"
1565
+ if [[ " ${product} " == " swiftpm" ]] ; then
1566
+ # All projects that call this depend on SwiftPM so we know that
1567
+ # swiftpm_bootstrap_command has already been set
1568
+ echo " $( ${swiftpm_bootstrap_command[@]} --show-bin-path) "
1569
+ else
1570
+ echo " ${root} /bin"
1571
+ fi
1554
1572
fi
1555
1573
}
1556
1574
@@ -1660,6 +1678,9 @@ function cmake_config_opt() {
1660
1678
swiftpm)
1661
1679
echo " --config ${SWIFTPM_BUILD_TYPE} "
1662
1680
;;
1681
+ swiftsyntax)
1682
+ echo " --config ${SWIFTSYNTAX_BUILD_TYPE} "
1683
+ ;;
1663
1684
xctest)
1664
1685
echo " --config ${XCTEST_BUILD_TYPE} "
1665
1686
;;
@@ -1702,6 +1723,10 @@ function set_swiftpm_bootstrap_command() {
1702
1723
echo " Error: Cannot build swiftpm without llbuild (swift-build-tool)."
1703
1724
exit 1
1704
1725
fi
1726
+ if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]]; then
1727
+ echo " Error: Cannot build swiftpm when llbuild is built using Xcode."
1728
+ exit 1
1729
+ fi
1705
1730
swiftpm_bootstrap_command=(" ${SWIFTPM_SOURCE_DIR} /Utilities/bootstrap" " ${swiftpm_bootstrap_options[@]} " )
1706
1731
# Add --release if we have to build in release mode.
1707
1732
if [[ " ${SWIFTPM_BUILD_TYPE} " == " Release" ]] ; then
@@ -1731,6 +1756,29 @@ function set_swiftpm_bootstrap_command() {
1731
1756
fi
1732
1757
}
1733
1758
1759
+ function set_swiftsyntax_build_command() {
1760
+ if [ " ${SKIP_BUILD_SWIFTPM} " ]; then
1761
+ echo " Error: Cannot build swiftsyntax without swiftpm."
1762
+ exit 1
1763
+ fi
1764
+
1765
+ swiftsyntax_build_command=(" ${SWIFTSYNTAX_SOURCE_DIR} /build-script.py" )
1766
+ # Add --release if we have to build in release mode.
1767
+ if [[ $( is_cmake_release_build_type " ${SWIFTSYNTAX_BUILD_TYPE} " ) ]] ; then
1768
+ swiftsyntax_build_command+=(--release)
1769
+ fi
1770
+ if [[ " ${VERBOSE_BUILD} " ]] ; then
1771
+ swiftsyntax_build_command+=(-v)
1772
+ fi
1773
+ swiftsyntax_build_command+=(
1774
+ --build-dir=" ${build_dir} "
1775
+ --swift-build-exec=" $( build_directory_bin ${LOCAL_HOST} swiftpm) /swift-build"
1776
+ --swift-test-exec=" $( build_directory_bin ${LOCAL_HOST} swiftpm) /swift-test"
1777
+ --swiftc-exec=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
1778
+ --swift-syntax-test-exec=" $( build_directory_bin ${LOCAL_HOST} swift) /swift-syntax-test"
1779
+ --filecheck-exec=" $( build_directory_bin ${LOCAL_HOST} llvm) /FileCheck" )
1780
+ }
1781
+
1734
1782
# Construct the appropriate options to pass to an Xcode
1735
1783
# build of any LLDB target.
1736
1784
function set_lldb_xcodebuild_options() {
@@ -2381,6 +2429,12 @@ for host in "${ALL_HOSTS[@]}"; do
2381
2429
call " ${swiftpm_bootstrap_command[@]} "
2382
2430
2383
2431
# swiftpm installs itself with a bootstrap method. No further cmake building is performed.
2432
+ continue
2433
+ ;;
2434
+ swiftsyntax)
2435
+ set_swiftsyntax_build_command
2436
+ call " ${swiftsyntax_build_command[@]} "
2437
+
2384
2438
continue
2385
2439
;;
2386
2440
xctest)
@@ -2899,6 +2953,15 @@ for host in "${ALL_HOSTS[@]}"; do
2899
2953
# As swiftpm tests itself, we break early here.
2900
2954
continue
2901
2955
;;
2956
+ swiftsyntax)
2957
+ if [[ " ${SKIP_TEST_SWIFTSYNTAX} " ]]; then
2958
+ continue
2959
+ fi
2960
+ echo " --- Running tests for ${product} ---"
2961
+ call " ${swiftsyntax_build_command[@]} " -t
2962
+ # As swiftSyntax tests itself, we break early here.
2963
+ continue
2964
+ ;;
2902
2965
xctest)
2903
2966
if [[ " ${SKIP_TEST_XCTEST} " ]]; then
2904
2967
continue
@@ -3178,6 +3241,10 @@ for host in "${ALL_HOSTS[@]}"; do
3178
3241
# As swiftpm bootstraps the installation itself, we break early here.
3179
3242
continue
3180
3243
;;
3244
+ swiftsyntax)
3245
+ # SwiftSyntax is not installed as part of the toolchain
3246
+ continue
3247
+ ;;
3181
3248
xctest)
3182
3249
if [[ -z " ${INSTALL_XCTEST} " ]] ; then
3183
3250
continue
0 commit comments