Skip to content

Commit dade421

Browse files
committed
[xcodegen] Show caveat for --stdlib-swift too
While here, also add a caveat for the fact that `--stdlib-swift` is disabled by default since it's surprised a couple of folks now.
1 parent e04efdd commit dade421

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

utils/swift-xcodegen/Sources/swift-xcodegen/SwiftXcodegen.swift

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,38 @@ struct SwiftXcodegen: AsyncParsableCommand, Sendable {
288288
return task
289289
}
290290

291-
func generate() async throws {
292-
let buildDirPath = buildDir.absoluteInWorkingDir.resolvingSymlinks
293-
log.info("Generating project for '\(buildDirPath)'...")
291+
func showCaveatsIfNeeded() {
292+
guard log.logLevel <= .note else { return }
294293

294+
var notes: [String] = []
295295
if projectOpts.useBuildableFolders {
296-
log.note("""
297-
Buildable folders are enabled by default, which requires Xcode 16. You \
298-
can pass '--no-buildable-folders' to disable this. See the '--help' entry \
299-
for more info.
296+
notes.append("""
297+
- Buildable folders are enabled by default, which requires Xcode 16. You
298+
can pass '--no-buildable-folders' to disable this. See the '--help'
299+
entry for more info.
300300
""")
301301
}
302302

303+
if !projectOpts.addStdlibSwift {
304+
notes.append("""
305+
- Swift standard library targets are disabled by default since they require
306+
using a development snapshot of Swift with Xcode. You can pass '--stdlib-swift'
307+
to enable. See the '--help' entry for more info.
308+
""")
309+
}
310+
guard !notes.isEmpty else { return }
311+
log.note("Caveats:")
312+
for note in notes {
313+
for line in note.components(separatedBy: .newlines) {
314+
log.note(line)
315+
}
316+
}
317+
}
318+
319+
func generate() async throws {
320+
let buildDirPath = buildDir.absoluteInWorkingDir.resolvingSymlinks
321+
log.info("Generating project for '\(buildDirPath)'...")
322+
303323
let projectRootDir = self.projectRootDir?.absoluteInWorkingDir
304324
let buildDir = try NinjaBuildDir(at: buildDirPath, projectRootDir: projectRootDir)
305325
let outputDir = miscOptions.outputDir?.absoluteInWorkingDir ?? buildDir.projectRootDir
@@ -350,6 +370,7 @@ struct SwiftXcodegen: AsyncParsableCommand, Sendable {
350370
try lldbLLVMWorkspace.write("LLDB+LLVM", into: outputDir)
351371
}
352372
}
373+
showCaveatsIfNeeded()
353374
}
354375

355376
func run() async {

0 commit comments

Comments
 (0)