Browse Source

Added support to add files to jpackage resources argument.

pull/3647/head
Justin Rajewski 1 year ago
parent
commit
b8db03b70b
  1. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/PlatformSettings.kt
  2. 3
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureJvmApplication.kt
  3. 5
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

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

@ -6,6 +6,7 @@
package org.jetbrains.compose.desktop.application.dsl
import org.gradle.api.Action
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.model.ObjectFactory
import javax.inject.Inject
@ -17,6 +18,7 @@ abstract class AbstractPlatformSettings {
val iconFile: RegularFileProperty = objects.fileProperty()
var packageVersion: String? = null
var installationPath: String? = null
val jpackageResourceDir: DirectoryProperty = objects.directoryProperty()
}
abstract class AbstractMacOSPlatformSettings : AbstractPlatformSettings() {

3
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureJvmApplication.kt

@ -377,6 +377,7 @@ internal fun JvmApplicationContext.configurePlatformSettings(
packageTask.linuxRpmLicenseType.set(provider { linux.rpmLicenseType })
packageTask.iconFile.set(linux.iconFile.orElse(defaultResources.get { linuxIcon }))
packageTask.installationPath.set(linux.installationPath)
packageTask.jpackageResourcesDir.set(linux.jpackageResourceDir)
}
}
OS.Windows -> {
@ -390,6 +391,7 @@ internal fun JvmApplicationContext.configurePlatformSettings(
packageTask.winUpgradeUuid.set(provider { win.upgradeUuid })
packageTask.iconFile.set(win.iconFile.orElse(defaultResources.get { windowsIcon }))
packageTask.installationPath.set(win.installationPath)
packageTask.jpackageResourcesDir.set(win.jpackageResourceDir)
}
}
OS.MacOS -> {
@ -415,6 +417,7 @@ internal fun JvmApplicationContext.configurePlatformSettings(
packageTask.nonValidatedMacSigningSettings = app.nativeDistributions.macOS.signing
packageTask.iconFile.set(mac.iconFile.orElse(defaultResources.get { macIcon }))
packageTask.installationPath.set(mac.installationPath)
packageTask.jpackageResourcesDir.set(mac.jpackageResourceDir)
}
}
}

5
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

@ -276,6 +276,9 @@ abstract class AbstractJPackageTask @Inject constructor(
@get:Internal
val appResourcesDir: DirectoryProperty = objects.directoryProperty()
@get:Internal
val jpackageResourcesDir: DirectoryProperty = objects.directoryProperty()
/**
* Gradle runtime verification fails,
* if InputDirectory is not null, but a directory does not exist.
@ -509,6 +512,8 @@ abstract class AbstractJPackageTask @Inject constructor(
.writeToFile(jpackageResources.ioFile.resolve("product-def.plist"))
}
}
jpackageResourcesDir.ioFileOrNull?.copyRecursively(jpackageResources.ioFile, overwrite = true)
}
override fun jvmToolEnvironment(): MutableMap<String, String> =

Loading…
Cancel
Save