mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Adjust native lifecycle builds to not throw during configuration phase (#1356)
Allow Gradle to run other tasks on unsupported machines, but throw when running native lifecycle tasks (e.g. `buildNative`).
This commit is contained in:
@@ -69,19 +69,15 @@ val assembleNative by
|
||||
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||
wraps(assembleNativeWindowsAmd64)
|
||||
}
|
||||
buildInfo.os.isWindows && buildInfo.targetArch == "aarch64" -> {
|
||||
logger.warn("Windows Aarch64 is not supported by GraalVM, skipping assembleNative")
|
||||
}
|
||||
buildInfo.musl -> {
|
||||
throw GradleException("Building musl on ${buildInfo.os} is not supported")
|
||||
}
|
||||
else -> {
|
||||
doLast {
|
||||
throw GradleException(
|
||||
"Unsupported os/arch pair: ${buildInfo.os.name}/${buildInfo.targetArch}"
|
||||
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val testNative by
|
||||
tasks.registering {
|
||||
@@ -109,19 +105,15 @@ val testNative by
|
||||
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||
dependsOn(testNativeWindowsAmd64)
|
||||
}
|
||||
buildInfo.os.isWindows && buildInfo.targetArch == "aarch64" -> {
|
||||
logger.warn("Windows Aarch64 is not supported by GraalVM, skipping testNative")
|
||||
}
|
||||
buildInfo.musl -> {
|
||||
throw GradleException("Building musl on ${buildInfo.os} is not supported")
|
||||
}
|
||||
else -> {
|
||||
doLast {
|
||||
throw GradleException(
|
||||
"Unsupported os/arch pair: ${buildInfo.os.name}/${buildInfo.targetArch}"
|
||||
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val checkNative by
|
||||
tasks.registering {
|
||||
|
||||
Reference in New Issue
Block a user