Add missing jpackage options#5227
Conversation
|
Not tested yet, only made sure to copy the values from documentation. Not sure how I can make a snapshot build from this to test in a sample projects. If there is an easy way to publish this as snapshot I have a sample repo to test these changes |
|
Please add a reference to https://youtrack.jetbrains.com/issue/CMP-2236 in the PR description |
|
I haven't used |
|
I agree, the documentation is bad there. I just spun up an ubuntu docker container to check this. I could confirm that the option accepts parameters and those affect the output .deb: This is the .deb I got with this jpackage command: While the .deb without dependencies does not have this dependency ( Somewhat incomplete history of commands in case you want to reproduce (missing apt install openjdk tmux, but this will depend on the image) |
|
Just some more tests, you can add multiple dependencies separated by comma:
And just putting it there without arguments does not add any binaries:
But this only works when its the last argument, otherwise it consumes the next one: |
|
One more evidence that behaviour is different from documentation - this is the definition of the argument in code, its a string argument: |
…ike --linux-package-deps, so accept any string for now
|
could this be merged? Edit: I think |
|
Yeah would be nice to get this merged soon 😄 I guess we are waiting for Igor Demin (@igordmn) review to complete? |
|
Thanks for chipping away at the missing jpackage options here! 🙏 A thought while this is open, since it's in the same area: this PR (and a few like it) is plumbing jpackage flags one at a time: The problem is there's currently no supported way for a user to put files into that directory. In @get:LocalState
protected val jpackageResources: Provider<Directory> =
project.layout.buildDirectory.dir("compose/tmp/resources")
// in the task action:
fileOperations.clearDirs(jpackageResources)
if (currentOS == OS.MacOS) {
InfoPlistBuilder(...).writeToFile(jpackageResources.ioFile.resolve("Info.plist"))
}
...
cliArg("--resource-dir", jpackageResources)Because A small, additive change that would unblock a whole class of these overrides at once is to merge user-provided files into the dir after the clear + @get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
val jpackageResourcesDir: ConfigurableFileCollection = objects.fileCollection()
// after clearDirs + Info.plist:
fileOperations.copy {
from(jpackageResourcesDir)
into(jpackageResources)
}exposed in the DSL as e.g.: nativeDistributions {
jpackageResources.from("jpackage-resources")
}It's non-breaking (defaults to empty), it reuses jpackage's own documented filename contract rather than inventing new semantics, and it would collapse a number of "please expose flag X" requests into "put a file in the resource dir." Might be worth considering either here or as a companion PR. |
Describe proposed changes and the issue being fixed
Adds additional jpackage options, introduced in jdk 17 and 21:
Fixes
Testing
Describe how you tested your changes. If possible and needed:
This should be tested by QA
Release Notes
Features - Desktop
jpackageoptions--win-shortcut-prompt,--win-update-url,--linux-package-depsand--mac-dmg-content