-
Notifications
You must be signed in to change notification settings - Fork 136
Simplifies/Unifies settings + JUnit tests + auto JDK download #258
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
Conversation
…anged when modifying or adding new stuff; iconFile was not present in gradle PackageTask before, added that; renamed appName to name (gradle); renamed appDescription to description (gradle);
…ePackagerSettings
Closures make easier to initialize complex objects, such as WinConfig, MacConfig, LinuxConfig, Scripts, ...: task packageForMac(type: GradlePackageTask, dependsOn: build) {
description = 'Packages the application as a native Mac OS app and bundles it in a tarball'
javapackager{
platform = 'mac'
createTarball = true
description = 'Hello World app'
}
scripts {
bootstrap = file('assets/bootstrap.sh')
}
macConfig {
infoPlist.additionalEntries = '''
<key>LSUIElement</key>
<true/>
'''
}
}
|
Ah ok gotta update the docs. |
I plan to add new MOJOs and Tasks, in order to split packaging logic in several goals/tasks ( So, I have a question for you ... how would you implement those new tasks or MOJOs? |
Maybe, instead of merge all settings in one class,
I think it's not clear ... should those closures be inside javapackager extension? |
Well since we now got a lot of stuff simplified you could, easily duplicate the GradlePackageTask for example, rename it to GradleCreateDmgTask, and then register it in the PackagePlugin class. For compatibility, I would still have a single package task that does all the stuff like before. |
But this task doesn't need all those properties ... just a few and/or expose internal artifact generator properties? |
Well they don't really need to, I think it would make the refactoring for users easier since then there arent any exceptions aka settings that need to be inside of the task scope and not the extension scope. Idk if that would work anyways since then we might run into maven problems again. |
Maybe we can use an object mapper like |
Sorry, I know you have been working hard on this stuff, but I need to think more about all this, because I implemented this part of the plugin (to support Gradle/Maven) months or even years ago and I need to refresh my ideas and understand why things were done the way they were done at the time, and see if the new changes are worth it or not. Thanks!!! |
I know I'm stubborn, but I don't like the idea that refactoring the plugin will change the way you use it |
Never used an object mapper, but if you say its possible then it should be ^^ The changes I did should at least make it easier to implement a customizable package task.
Yeah, no worries ;) |
There is still the possibility of generating java source code, aka generating all the individual maven/gradle classes from a single class (or json file etc.) with defaults. I tried that, but it was way more work than it was worth. It would be like a plugin to generate unified maven/gradle plugins. |
Hi @Osiris-Team!
I'm pretty sure your changes have been a great effort to make the plugin easier to maintain, but for now I don't want to cross this line: change the way the plugin is used. As I already told you, I plan to add new tasks/MOJOs, and each one should have its own properties. So, I prefer the option of generating code from a model, as it will make easier to create new tasks and MOJOs. I think we only have to generate an abstract class for each task and MOJO with the same properties, and then implement these classes, so we don't have to touch them, as they will be regenerated each time the plugin is validated by Gradle, or something so (just before the code is compiled). Maybe we can use javapoet, jcodemodel, or simply Velocity templates. I'll do some more research about this and share my conclusions here ASAP. I'm going to merge only the part of the code used to download JDKs and skip the refactored part for now, because there are quite a few pending issues to be resolved and I'm a bit stuck. Thanks so much!!! |
Sorry ... I don't know what the hell I did. I merged this PR in the wrong branch ( |
Its ok Im gonna delete this and the reverted branch (u gotta do this), since I added the changes to the devel branch of my fork. |
Contains following breaking changes:
Show example
name
property toappName
.