|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
package org.jetbrains.compose.desktop.application.tasks |
|
|
|
|
|
|
|
|
|
import org.gradle.api.file.RegularFileProperty |
|
|
|
|
import org.gradle.api.provider.ListProperty |
|
|
|
|
import org.gradle.api.provider.Property |
|
|
|
|
import org.gradle.api.tasks.Input |
|
|
|
|
import org.gradle.api.tasks.InputFile |
|
|
|
|
import org.gradle.api.tasks.Optional |
|
|
|
|
import org.jetbrains.compose.desktop.application.dsl.RuntimeCompressionLevel |
|
|
|
|
import org.jetbrains.compose.desktop.application.internal.* |
|
|
|
|
import org.jetbrains.compose.desktop.application.internal.JavaRuntimeProperties |
|
|
|
|
import org.jetbrains.compose.desktop.application.internal.cliArg |
|
|
|
|
import org.jetbrains.compose.desktop.application.internal.notNullProperty |
|
|
|
|
import org.jetbrains.compose.desktop.application.internal.nullableProperty |
|
|
|
@ -16,6 +20,12 @@ abstract class AbstractJLinkTask : AbstractJvmToolOperationTask("jlink") {
|
|
|
|
|
@get:Input |
|
|
|
|
val modules: ListProperty<String> = objects.listProperty(String::class.java) |
|
|
|
|
|
|
|
|
|
@get:Input |
|
|
|
|
val includeAllModules: Property<Boolean> = objects.notNullProperty() |
|
|
|
|
|
|
|
|
|
@get:InputFile |
|
|
|
|
val javaRuntimePropertiesFile: RegularFileProperty = objects.fileProperty() |
|
|
|
|
|
|
|
|
|
@get:Input |
|
|
|
|
internal val stripDebug: Property<Boolean> = objects.notNullProperty(true) |
|
|
|
|
|
|
|
|
@ -33,7 +43,11 @@ abstract class AbstractJLinkTask : AbstractJvmToolOperationTask("jlink") {
|
|
|
|
|
internal val compressionLevel: Property<RuntimeCompressionLevel?> = objects.nullableProperty() |
|
|
|
|
|
|
|
|
|
override fun makeArgs(tmpDir: File): MutableList<String> = super.makeArgs(tmpDir).apply { |
|
|
|
|
modules.get().forEach { m -> |
|
|
|
|
val modulesToInclude = |
|
|
|
|
if (includeAllModules.get()) { |
|
|
|
|
JavaRuntimeProperties.readFromFile(javaRuntimePropertiesFile.ioFile).availableModules |
|
|
|
|
} else modules.get() |
|
|
|
|
modulesToInclude.forEach { m -> |
|
|
|
|
cliArg("--add-modules", m) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|