-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add support for using JBang #575
Conversation
Looks for `jbang.properties` as a marker similar to `pom.xml` and `settings.gradle`. It is not required for jbang to work, thus we could also just look for a standard source file i.e. `src/main.java` Also handles `binary: myFile.java` as a way to customize which of possible "scripts" to use. Also allow using Groovy (.groovy) and Kotlin (.kt) via JBang, but that is untested for now.
todo:
|
Related to this, if we want to add a template: https://github.com/pulumi/templates/pull/283/files |
Yes - I'm happy to complete this just looking for some pointers to my question in the pr description. Thanks! |
cmdutil.Exit(err) | ||
} | ||
case ".java", ".kt", ".groovy": | ||
cmd, err := probeJBangExecutor() |
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.
Looks like this pathway is for letting users set binary:
option in the Pulumi.yaml and have a non-standard entry-point file. Sounds great!
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.
exactly
Thank you for contributing this! I'm just learning about JBang here but I love the idea - it's a great match for short Pulumi programs. Taking it out for a spin shortly. Please let us know if you can resolve the merge conflicts or need some help with that. |
Also - apologies for CI showing as red. This is a setup problem not necessarily a problem with code #557 - something I will be cleaning up next week. |
That's relatively simple to explain. Pulumi CLI would sometimes call InstallDependencies that would call the jvmExecutor "build". The intension here is to prebuild and pre-fetch dependencies. I believe this is called right after template expansion in
An executor that does nothing for the "build" command I think should work fine also. It will simply defer the dep fetching until |
Looks for `jbang.properties` as a marker similar to `pom.xml` and `settings.gradle`. It is not required for jbang to work, thus we could also just look for a standard source file i.e. `src/main.java` Also handles `binary: myFile.java` as a way to customize which of possible "scripts" to use. Also allow using Groovy (.groovy) and Kotlin (.kt) via JBang, but that is untested for now.
pushed fixes + rebase with main. |
so i think it should just work - but didn't find a way to trigger the code thus far. |
Wonderful! Works on my machine, I'll find a way to hitch it up to CI and merge. Thank you! |
/run-acceptance-tests |
/run-acceptance-tests |
Want to merge pulumi/templates#283 too to get matching templates ? |
In principle yes, I'd wait until this change gets released next week though. |
I saw 0.3.0 was released but its release notes does not seem to include this change. Was something missing to make it in? |
Included in https://github.com/pulumi/pulumi-java/blob/main/CHANGELOG.md#030-2022-06-01 ? Where is it not propagating? |
https://github.com/pulumi/pulumi-java/releases latest release don't have it in the change log and it's still in the incoming change log as part of 0.4 |
#Descripton
Adds support for jbang like there are for maven and gradle.
Advantage is you don't need to have extra files and deep structures if you are just doing some pulumi sripting.
Minimal requirement as implemented here is:
Could even cut it down and look for
src/main.java
if nojbang.properties
found.Dependencies are done via
//DEPS
in the .java file, i.e.:or simply:
notes:
Looks for
jbang.properties
as a marker similar topom.xml
andsettings.gradle
.It is not required for jbang to work, thus we could also just look for a standard source file i.e.
src/main.java
Also handles
binary: myFile.java
as a way to customize which of possible "scripts" to use.Also allow using Groovy (.groovy) and Kotlin (.kt) via JBang, but that is untested for now.- Fix typo and use GAV that exist in maven central
Checklist