Browse Source

Rename nativeExecutables to nativeDistributions

pull/28/head
Alexey Tsvetkov 4 years ago committed by Alexey Tsvetkov
parent
commit
991b7ff6a7
  1. 2
      examples/imageviewer/desktop/build.gradle.kts
  2. 14
      gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/ApplicationPlugin.kt
  3. 6
      gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/Application.kt
  4. 2
      gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/NativeDistributions.kt

2
examples/imageviewer/desktop/build.gradle.kts

@ -25,7 +25,7 @@ compose.desktop {
application { application {
mainClass = "example.imageviewer.MainKt" mainClass = "example.imageviewer.MainKt"
nativeExecutables { nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "ImageViewer" packageName = "ImageViewer"
modules("jdk.crypto.ec") modules("jdk.crypto.ec")

14
gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/ApplicationPlugin.kt

@ -73,7 +73,7 @@ internal fun Project.configurePackagingTasks(apps: Collection<Application>) {
} }
internal fun Project.configurePackagingTasks(app: Application): TaskProvider<DefaultTask> { internal fun Project.configurePackagingTasks(app: Application): TaskProvider<DefaultTask> {
val packageFormats = app.nativeExecutables.targetFormats.map { targetFormat -> val packageFormats = app.nativeDistributions.targetFormats.map { targetFormat ->
tasks.composeTask<AbstractJPackageTask>( tasks.composeTask<AbstractJPackageTask>(
taskName("package", app, targetFormat.name), taskName("package", app, targetFormat.name),
args = listOf(targetFormat) args = listOf(targetFormat)
@ -91,7 +91,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
val targetPlatformSettings = when (targetOS) { val targetPlatformSettings = when (targetOS) {
OS.Linux -> { OS.Linux -> {
app.nativeExecutables.linux.also { linux -> app.nativeDistributions.linux.also { linux ->
linuxShortcut.set(provider { linux.shortcut }) linuxShortcut.set(provider { linux.shortcut })
linuxAppCategory.set(provider { linux.appCategory }) linuxAppCategory.set(provider { linux.appCategory })
linuxAppRelease.set(provider { linux.appRelease }) linuxAppRelease.set(provider { linux.appRelease })
@ -103,7 +103,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
} }
} }
OS.Windows -> { OS.Windows -> {
app.nativeExecutables.windows.also { win -> app.nativeDistributions.windows.also { win ->
winConsole.set(provider { win.console }) winConsole.set(provider { win.console })
winDirChooser.set(provider { win.dirChooser }) winDirChooser.set(provider { win.dirChooser })
winPerUserInstall.set(provider { win.perUserInstall }) winPerUserInstall.set(provider { win.perUserInstall })
@ -115,7 +115,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
} }
} }
OS.MacOS -> { OS.MacOS -> {
app.nativeExecutables.macOS.also { mac -> app.nativeDistributions.macOS.also { mac ->
macPackageName.set(provider { mac.packageName }) macPackageName.set(provider { mac.packageName })
macPackageIdentifier.set(provider { mac.packageIdentifier }) macPackageIdentifier.set(provider { mac.packageIdentifier })
macSign.set(provider { mac.signing.sign }) macSign.set(provider { mac.signing.sign })
@ -127,7 +127,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
} }
} }
app.nativeExecutables.let { executables -> app.nativeDistributions.let { executables ->
packageName.set(provider { executables.packageName ?: project.name }) packageName.set(provider { executables.packageName ?: project.name })
packageDescription.set(provider { executables.description }) packageDescription.set(provider { executables.description })
packageCopyright.set(provider { executables.copyright }) packageCopyright.set(provider { executables.copyright })
@ -138,7 +138,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
}) })
} }
destinationDir.set(app.nativeExecutables.outputBaseDir.map { it.dir("${app.name}/${targetFormat.id}") }) destinationDir.set(app.nativeDistributions.outputBaseDir.map { it.dir("${app.name}/${targetFormat.id}") })
javaHome.set(provider { app.javaHomeOrDefault() }) javaHome.set(provider { app.javaHomeOrDefault() })
launcherMainJar.set(app.mainJar.orNull) launcherMainJar.set(app.mainJar.orNull)
@ -159,7 +159,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(app: Application) {
files.from(project.configurations.named(target.runtimeElementsConfigurationName)) files.from(project.configurations.named(target.runtimeElementsConfigurationName))
} }
} }
modules.set(provider { app.nativeExecutables.modules }) modules.set(provider { app.nativeDistributions.modules })
launcherMainClass.set(provider { app.mainClass }) launcherMainClass.set(provider { app.mainClass })
launcherJvmArgs.set(provider { app.jvmArgs }) launcherJvmArgs.set(provider { app.jvmArgs })
launcherArgs.set(provider { app.args }) launcherArgs.set(provider { app.args })

6
gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/Application.kt

@ -56,8 +56,8 @@ open class Application @Inject constructor(
this.jvmArgs.addAll(jvmArgs) this.jvmArgs.addAll(jvmArgs)
} }
val nativeExecutables: NativeExecutables = objects.newInstance(NativeExecutables::class.java) val nativeDistributions: NativeDistributions = objects.newInstance(NativeDistributions::class.java)
fun nativeExecutables(fn: Action<NativeExecutables>) { fun nativeDistributions(fn: Action<NativeDistributions>) {
fn.execute(nativeExecutables) fn.execute(nativeDistributions)
} }
} }

2
gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/NativeExecutables.kt → gradle-plugins/compose-desktop-application/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/NativeDistributions.kt

@ -7,7 +7,7 @@ import org.gradle.api.model.ObjectFactory
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
open class NativeExecutables @Inject constructor( open class NativeDistributions @Inject constructor(
objects: ObjectFactory, objects: ObjectFactory,
layout: ProjectLayout layout: ProjectLayout
) { ) {
Loading…
Cancel
Save