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

add jbang catalog #54

Closed
wants to merge 1 commit into from
Closed

add jbang catalog #54

wants to merge 1 commit into from

Conversation

maxandersen
Copy link

@maxandersen maxandersen commented Sep 17, 2024

just a proposal to add jbang-catalog.json so you can run this as jbang jlama@tjake/jlama

+ automatic dependency updates and verification of the jbang catalog content.

if this was instead put in tjake/jbang-catalog repo it would be even shorter to run and not "overlap" with jlama itself.

updated readme and remove jlama.java as redundant now with tjake/jbang-catalog#1

@@ -48,7 +48,7 @@ The CLI can be run with [jbang](https://www.jbang.dev/download/).
curl -Ls https://sh.jbang.dev | bash -s - app setup

#Install Jlama CLI (will ask if you trust the source)
jbang app install -j 21 --name=jlama --force https://raw.githubusercontent.com/tjake/Jlama/main/jlama.java
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to state Java 21 here as script now requires it. You can still add it if you want to try with higher Java version.

Also name is redundant as it would derive it from the file name anyway.


jobs:
build:
uses: jbanghub/.github/.github/workflows/shared-build.yml@main
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow file just ensures that the JBang catalog scripts can resolve all its deps and compile.

jlama.java Outdated
@@ -1,8 +1,9 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
//COMPILE_OPTIONS -source 20
//JAVA 21+
//PREVIEW
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This automatically handles --enable-preview and source targets are aligned.

You can also do it all manually and explicitly but lets things that can break this way.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually 20+ does that also handle --enable-preview?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i put 21 as thats what you put in the readme. //preview will take the java version and apply for --source/--release so its all aligned and you don't have to change them all just because you try it out with java 23 for example.

want me to change it to //JAVA 20+ ?

Copy link
Owner

@tjake tjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of like your suggestion of the separate repo so I made one here

One question I had, can I have the installer include this compiler directives file I couldn't see how to do that without placing it manually?

Thanks for your help!

jlama.java Outdated
@@ -1,8 +1,9 @@
///usr/bin/env jbang "$0" "$@" ; exit $?
//COMPILE_OPTIONS -source 20
//JAVA 21+
//PREVIEW
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually 20+ does that also handle --enable-preview?

@maxandersen
Copy link
Author

I kind of like your suggestion of the separate repo so I made one here

cool - I'll "port" this pr over there.

One question I had, can I have the installer include this compiler directives file I couldn't see how to do that without placing it manually?

TIL - java compiler directives files!

I think there is a way to support it nicely using jbangs "remote file arguments" feature https://www.jbang.dev/documentation/guide/latest/running.html#remote-file-arguments

allows you to do jbang something.java %https://github.com/tjake/Jlama/blob/main/inlinerules.json% but in this case its for the build part....I'll have a think on how that would be doable.

@maxandersen
Copy link
Author

fyi, the remote file argument trick does not work at this time. I opened jbangdev/jbang#1838 to see if can make it work.

@tjake
Copy link
Owner

tjake commented Sep 21, 2024

Closing this since its in jbang-catalog repo. Thank you!

@tjake tjake closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants