diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/PlatformSettings.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/PlatformSettings.kt index a22553cdae..b57c0c9d05 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/PlatformSettings.kt +++ b/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() { diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureJvmApplication.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureJvmApplication.kt index 83707cf8b5..7ba99e74c5 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureJvmApplication.kt +++ b/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) } } } diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt index 30836d61eb..b45fab02e2 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt +++ b/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 =