Skip to content

Commit 1ac73e4

Browse files
Update Package.swift (#347)
1 parent a3791cf commit 1ac73e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func findJavaHome() -> String {
3232
}
3333

3434

35-
if ProcessInfo.processInfo.environment["SPI_PROCESSING"] == "1" {
36-
// just ignore that we're missing a JAVA_HOME when building in Swift Package Index
35+
if ProcessInfo.processInfo.environment["SPI_PROCESSING"] == "1" && ProcessInfo.processInfo.environment["SPI_BUILD"] == nil {
36+
// Just ignore that we're missing a JAVA_HOME when building in Swift Package Index during general processing where no Java is needed. However, do _not_ suppress the error during SPI's compatibility build stage where Java is required.
3737
return ""
3838
}
3939
fatalError("Please set the JAVA_HOME environment variable to point to where Java is installed.")

0 commit comments

Comments
 (0)