Skip to content

Commit 58d3c86

Browse files
committed
[build-script] Add flag that forwards to SwiftSytnax --verify-generated-files
This will allow us to set up a CI bot that can test that all generated sources in SwiftSyntax are up-to-date.
1 parent cfae1a3 commit 58d3c86

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/build-script-impl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ KNOWN_SETTINGS=(
200200
install-swiftpm "" "whether to install swiftpm"
201201
install-swiftsyntax "" "whether to install swiftsyntax"
202202
skip-install-swiftsyntax-module "" "set to skip installing swiftsyntax modules"
203+
swiftsyntax-verify-generated-files "" "set to verify that the generated files in the source tree match the ones that would be generated from current master"
203204
install-xctest "" "whether to install xctest"
204205
install-foundation "" "whether to install foundation"
205206
install-libcxx "" "whether to install libc++"
@@ -1244,7 +1245,7 @@ PRODUCTS=("${PRODUCTS[@]}" swift)
12441245
if [[ ! "${SKIP_BUILD_LLDB}" ]] ; then
12451246
PRODUCTS=("${PRODUCTS[@]}" lldb)
12461247
fi
1247-
# LLBuild, SwiftPM, SwiftSyntax and XCTest are dependent on Foundation, so
1248+
# LLBuild, SwiftPM, SwiftSyntax and XCTest are dependent on Foundation, so
12481249
# Foundation must be added to the list of build products first.
12491250
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
12501251
PRODUCTS=("${PRODUCTS[@]}" libdispatch)
@@ -1264,12 +1265,12 @@ fi
12641265
if [[ ! "${SKIP_BUILD_PLAYGROUNDSUPPORT}" ]] ; then
12651266
PRODUCTS=("${PRODUCTS[@]}" playgroundsupport)
12661267
fi
1267-
# SwiftPM and SwiftSyntax are dependent on XCTest, so XCTest must be added to
1268+
# SwiftPM and SwiftSyntax are dependent on XCTest, so XCTest must be added to
12681269
# the list of build products first.
12691270
if [[ ! "${SKIP_BUILD_XCTEST}" ]] ; then
12701271
PRODUCTS=("${PRODUCTS[@]}" xctest)
12711272
fi
1272-
# SwiftSyntax is dependent on SwiftPM, so SwiftPM must be added to the list of
1273+
# SwiftSyntax is dependent on SwiftPM, so SwiftPM must be added to the list of
12731274
# build products first.
12741275
if [[ ! "${SKIP_BUILD_SWIFTPM}" ]] ; then
12751276
PRODUCTS=("${PRODUCTS[@]}" swiftpm)
@@ -1852,6 +1853,9 @@ function set_swiftsyntax_build_command() {
18521853
--syntax-parser-lib-dir="$(build_directory ${host} swift)/lib"
18531854
--swift-syntax-test-exec="$(build_directory_bin ${LOCAL_HOST} swift)/swift-syntax-test"
18541855
--filecheck-exec="$(build_directory_bin ${LOCAL_HOST} llvm)/FileCheck")
1856+
if [[ "${SWIFTSYNTAX_VERIFY_GENERATED_FILES}" ]] ; then
1857+
swiftsyntax_build_command+=(--verify-generated-files)
1858+
fi
18551859
}
18561860

18571861
#

0 commit comments

Comments
 (0)