Browse Source

Expose 'licenseFile' option for native packaging (#1421)

pull/1455/head
Sebastian 3 years ago committed by GitHub
parent
commit
af31eacb74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/NativeDistributions.kt
  2. 1
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt
  3. 2
      tutorials/Native_distributions_and_local_execution/README.md

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

@ -8,6 +8,7 @@ package org.jetbrains.compose.desktop.application.dsl
import org.gradle.api.Action import org.gradle.api.Action
import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.ProjectLayout import org.gradle.api.file.ProjectLayout
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.model.ObjectFactory import org.gradle.api.model.ObjectFactory
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
@ -26,6 +27,7 @@ open class NativeDistributions @Inject constructor(
var vendor: String? = null var vendor: String? = null
var packageVersion: String? = null var packageVersion: String? = null
val appResourcesRootDir: DirectoryProperty = objects.directoryProperty() val appResourcesRootDir: DirectoryProperty = objects.directoryProperty()
val licenseFile: RegularFileProperty = objects.fileProperty()
val outputBaseDir: DirectoryProperty = objects.directoryProperty().apply { val outputBaseDir: DirectoryProperty = objects.directoryProperty().apply {
set(layout.buildDirectory.dir("compose/binaries")) set(layout.buildDirectory.dir("compose/binaries"))

1
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt

@ -212,6 +212,7 @@ internal fun AbstractJPackageTask.configurePackagingTask(
packageCopyright.set(provider { executables.copyright }) packageCopyright.set(provider { executables.copyright })
packageVendor.set(provider { executables.vendor }) packageVendor.set(provider { executables.vendor })
packageVersion.set(packageVersionFor(project, app, targetFormat)) packageVersion.set(packageVersionFor(project, app, targetFormat))
licenseFile.set(executables.licenseFile)
} }
destinationDir.set(app.nativeDistributions.outputBaseDir.map { it.dir("${app.name}/${targetFormat.outputDirName}") }) destinationDir.set(app.nativeDistributions.outputBaseDir.map { it.dir("${app.name}/${targetFormat.outputDirName}") })

2
tutorials/Native_distributions_and_local_execution/README.md

@ -241,6 +241,7 @@ The following properties are available in the `nativeDistributions` DSL block:
* `description` — application's description (default value: none); * `description` — application's description (default value: none);
* `copyright` — application's copyright (default value: none); * `copyright` — application's copyright (default value: none);
* `vendor` — application's vendor (default value: none). * `vendor` — application's vendor (default value: none).
* `licenseFile` — application's license (default value: none).
``` kotlin ``` kotlin
compose.desktop { compose.desktop {
@ -251,6 +252,7 @@ compose.desktop {
description = "Compose Example App" description = "Compose Example App"
copyright = "© 2020 My Name. All rights reserved." copyright = "© 2020 My Name. All rights reserved."
vendor = "Example vendor" vendor = "Example vendor"
licenseFile.set(project.file("LICENSE.txt"))
} }
} }
} }

Loading…
Cancel
Save