mirror of
https://github.com/apple/pkl.git
synced 2026-04-25 17:58:50 +02: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" -> {
|
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||||
wraps(assembleNativeWindowsAmd64)
|
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 -> {
|
else -> {
|
||||||
|
doLast {
|
||||||
throw GradleException(
|
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
|
val testNative by
|
||||||
tasks.registering {
|
tasks.registering {
|
||||||
@@ -109,19 +105,15 @@ val testNative by
|
|||||||
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
|
||||||
dependsOn(testNativeWindowsAmd64)
|
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 -> {
|
else -> {
|
||||||
|
doLast {
|
||||||
throw GradleException(
|
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
|
val checkNative by
|
||||||
tasks.registering {
|
tasks.registering {
|
||||||
|
|||||||
Reference in New Issue
Block a user