-
-
Notifications
You must be signed in to change notification settings - Fork 131
feat: support for jbang built extensions #1951
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
@@ -34,6 +34,8 @@ public interface Extension extends Domain, EnabledAware { | |||
|
|||
String getDirectory(); | |||
|
|||
String getJBang(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle DSL requires a similar update
Line 32 in 522d6f9
interface Extension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha - i'm wondering if it would make sense to make room for jbang arguments ?
i.e. technically you can affect/modify the build with jbang arguments like jbang -Dkey=value --compile-options etc.
maybe that should be a jbang-args
flag ?
jbang:
- scriptref: myext.java
- args: ...
is an alternative but would be sad to loose the simplicity of jbang: myext.java
...or do you allow maps|string option in jreleaser elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there's a map in environment: for extra properties but it may not necessarily be available at the time extensions are loaded.
Also would prefer if the additional args were set closer to where they are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would have to decide how to do it as changing the type after the next release would constitute a breaking change.
What other elements may be required besides script
and args
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar as https://github.com/jbangdev/jbang-gradle-plugin and maven ones...
the main ones are script, jbang-args and trust (although trust we could consider auto add/remove in calls but feels risky ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so we need 4 properties:
- script
- args
- jbangArgs
- trusts
To keep compatibility with names found in other UIs. This means adding a pair of classes in model-api and model-impl following the patterns for other Domain subtypes. The gradle DSL would require similar changes, which I can take care of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args itself does not make sense here - as jreleaser does its own init and skips any main method calling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version should also be specified otherwise the default bundled version will always be chosen.
I can refactor the code later after merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but thats the same for maven ?
core/jreleaser-model-impl/src/main/java/org/jreleaser/model/internal/extensions/Extension.java
Show resolved
Hide resolved
@@ -65,6 +66,11 @@ public String getDirectory() { | |||
return directory; | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've bumped +1 but also //TODO'ed as i dont have a serial version generator handy
sdks/jreleaser-tool-java-sdk/src/main/java/org/jreleaser/sdk/tool/AbstractTool.java
Outdated
Show resolved
Hide resolved
sdks/jreleaser-tool-java-sdk/src/main/java/org/jreleaser/sdk/tool/AbstractTool.java
Outdated
Show resolved
Hide resolved
sdks/jreleaser-tool-java-sdk/src/main/resources/META-INF/jreleaser/tools/jbang.properties
Show resolved
Hide resolved
...releaser-engine/src/main/java/org/jreleaser/extensions/internal/DefaultExtensionManager.java
Outdated
Show resolved
Hide resolved
Build failed due to checkstyle
|
...er-gradle-plugin/src/main/groovy/org/jreleaser/gradle/plugin/dsl/extensions/Extension.groovy
Show resolved
Hide resolved
I pushed update that adds recursive scanning of .jar in extension directories + use jbang export portable instead of jbang export local. And it works...BUT you get: out/jreleaser/extensions/github-summary/ which seems wasteful :) I see two things:
|
I made jreleaser/jreleaser.github.io#91 as suggestion for docs. |
Fixes #1952
Context
Adds support for using jbang to define extensions.
Checklist
Apache License 2.0, e.g. the code was written by
you or the original code is licensed under a license compatible to Apache License 2.0.