Skip to content

Commit 56808d3

Browse files
authored
Merge pull request #610 from nkcsgexi/skip-execution-flag
PrebuiltModuleGen: add an option for skipping the job execution
2 parents 76fe5e2 + 67d3701 commit 56808d3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/swift-build-sdk-interfaces/main.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ let coreMode = CommandLine.arguments.contains("-core")
4444
/// Verbose to print more info
4545
let verbose = CommandLine.arguments.contains("-v")
4646

47+
/// Skip executing the jobs
48+
let skipExecution = CommandLine.arguments.contains("-n")
49+
4750
do {
4851
let sdkPath = try VirtualPath(path: sdkPathRaw).absolutePath!
4952
if !localFileSystem.exists(sdkPath) {
@@ -117,6 +120,15 @@ do {
117120
executor: executor,
118121
compilerExecutableDir: swiftcPath.parentDirectory)
119122
let (jobs, danglingJobs) = try driver.generatePrebuitModuleGenerationJobs(with: inputMap, into: outputDir, exhaustive: !coreMode)
123+
if verbose {
124+
Driver.stdErrQueue.sync {
125+
stderrStream <<< "job count: \(jobs.count + danglingJobs.count)\n"
126+
stderrStream.flush()
127+
}
128+
}
129+
if skipExecution {
130+
exit(0)
131+
}
120132
let delegate = PrebuitModuleGenerationDelegate(jobs, diagnosticsEngine, verbose)
121133
do {
122134
try executor.execute(workload: DriverExecutorWorkload.init(jobs, nil, continueBuildingAfterErrors: true),

0 commit comments

Comments
 (0)