Skip to content

Commit 252f447

Browse files
authored
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`).
1 parent 139f70b commit 252f447

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,12 @@ val assembleNative by
6969
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
7070
wraps(assembleNativeWindowsAmd64)
7171
}
72-
buildInfo.os.isWindows && buildInfo.targetArch == "aarch64" -> {
73-
logger.warn("Windows Aarch64 is not supported by GraalVM, skipping assembleNative")
74-
}
75-
buildInfo.musl -> {
76-
throw GradleException("Building musl on ${buildInfo.os} is not supported")
77-
}
7872
else -> {
79-
throw GradleException(
80-
"Unsupported os/arch pair: ${buildInfo.os.name}/${buildInfo.targetArch}"
81-
)
73+
doLast {
74+
throw GradleException(
75+
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
76+
)
77+
}
8278
}
8379
}
8480
}
@@ -109,16 +105,12 @@ val testNative by
109105
buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> {
110106
dependsOn(testNativeWindowsAmd64)
111107
}
112-
buildInfo.os.isWindows && buildInfo.targetArch == "aarch64" -> {
113-
logger.warn("Windows Aarch64 is not supported by GraalVM, skipping testNative")
114-
}
115-
buildInfo.musl -> {
116-
throw GradleException("Building musl on ${buildInfo.os} is not supported")
117-
}
118108
else -> {
119-
throw GradleException(
120-
"Unsupported os/arch pair: ${buildInfo.os.name}/${buildInfo.targetArch}"
121-
)
109+
doLast {
110+
throw GradleException(
111+
"Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}"
112+
)
113+
}
122114
}
123115
}
124116
}

0 commit comments

Comments
 (0)