33import common.*
44import common.Platform
55import me.saket.bytesize.*
6- import org.jetbrains.kotlin.gradle.utils.extendsFrom
76
87plugins {
98 application
@@ -119,44 +118,6 @@ graalvmNative {
119118 toolchainDetection = true
120119}
121120
122- /* *
123- * Creates a custom sourceset(`graal`) for GraalVM native image build time configurations. The
124- * following configurations will
125- * - Creates a `graal` source set.
126- * - Add `main` output to `graal` compile and runtime classpath.
127- * - Add `main` dependencies to `graal` compile and runtime classpath.
128- * - Add `graal` dependencies (graalImplementation) to native-image classpath.
129- * - Add `graal` output to native-image classpath.
130- *
131- * For each source set added to the project, the Java plugins add a few
132- * [dependency configurations](https://docs.gradle.org/current/userguide/java_plugin.html#java_source_set_configurations)
133- * - graalImplementation
134- * - graalCompileOnly
135- * - graalRuntimeOnly
136- * - graalCompileClasspath (CompileOnly + Implementation)
137- * - graalRuntimeClasspath (RuntimeOnly + Implementation)
138- *
139- * [Configure-Custom-SourceSet](https://docs.gradle.org/current/userguide/java_testing.html#sec:configuring_java_integration_tests)
140- */
141- val graal by
142- sourceSets.registering {
143- compileClasspath + = sourceSets.main.get().output
144- runtimeClasspath + = sourceSets.main.get().output
145- }
146-
147- configurations {
148- val graalImplementation by existing
149- val graalRuntimeOnly by existing
150-
151- // graalImplementation extendsFrom main source set implementation
152- graalImplementation.extendsFrom(implementation)
153- graalRuntimeOnly.extendsFrom(runtimeOnly)
154-
155- // Finally, nativeImage classpath extendsFrom graalImplementation
156- // This way all main + graal dependencies are also available at native image build time.
157- nativeImageClasspath.extendsFrom(graalImplementation)
158- }
159-
160121tasks {
161122 val archiveTgz by
162123 registering(Tar ::class ) {
@@ -182,7 +143,6 @@ tasks {
182143 }
183144
184145 nativeCompile { finalizedBy(archiveTgz) }
185-
186146 // shadowJar { mergeServiceFiles() }
187147}
188148
@@ -201,10 +161,4 @@ val niArchiveName
201161 append(" .tar.gz" )
202162 }
203163
204- dependencies {
205- // Dependencies required for native-image build. Use "graalCompileOnly" for compile only deps.
206- " graalCompileOnly" (libs.graal.sdk)
207- nativeImageCompileOnly(graal.map { it.output })
208- compileOnly(libs.graal.sdk)
209- // "graalImplementation"(libs.classgraph)
210- }
164+ dependencies { compileOnly(libs.graal.sdk) }
0 commit comments