Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to add files to jpackage resources argument #3647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand All @@ -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 -> {
Expand All @@ -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)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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> =
Expand Down