Skip to content

Commit c7adc8e

Browse files
authored
Build: don't crash when building in SPI and JAVA_HOME is missing (#329)
1 parent 342b5ea commit c7adc8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Package.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ func findJavaHome() -> String {
3131
return home
3232
}
3333

34+
35+
if ProcessInfo.processInfo.environment["SPI_BUILD"] == "1" {
36+
// just ignore that we're missing a JAVA_HOME when building in Swift Package Index
37+
return ""
38+
}
3439
fatalError("Please set the JAVA_HOME environment variable to point to where Java is installed.")
3540
}
3641

0 commit comments

Comments
 (0)