Skip to content

Commit 0f4209b

Browse files
committed
[build_script.py] Glob source files to build
Maintaining a list of source files to build in the build_script requires a change to that file every time a new source file is added. Instead, automatically pick up any new source files with a .swift extension.
1 parent e480d02 commit 0f4209b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

build_script.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#
1111

1212
import argparse
13+
import glob
1314
import os
1415
import subprocess
1516
import tempfile
@@ -73,17 +74,8 @@ def main():
7374
if not os.path.exists(build_dir):
7475
run("mkdir -p {}".format(build_dir))
7576

76-
sourceFiles = [
77-
"XCTAssert.swift",
78-
"XCTestCaseProvider.swift",
79-
"XCTestCase.swift",
80-
"XCTimeUtilities.swift",
81-
"XCTestMain.swift",
82-
]
83-
sourcePaths = []
84-
for file in sourceFiles:
85-
sourcePaths.append("{0}/Sources/XCTest/{1}".format(SOURCE_DIR, file))
86-
77+
sourcePaths = glob.glob(os.path.join(
78+
SOURCE_DIR, 'Sources', 'XCTest', '*.swift'))
8779

8880
if args.build_style == "debug":
8981
style_options = "-g"

0 commit comments

Comments
 (0)