Releases: jbangdev/jbang
v0.106.3
v0.106.1
v0.106.0
Changelog
This enables use of GPT with JBang.
To use it you need an OPENAI_API_KEY and use the --preview
flag.
export OPENAI_API_KEY=sk-xxxxxxx-x-xxxxxx
jbang init gh.java "connect to github an fetch all repositories under jbangdev and collect how many stars they have"
And JBang will call out using ChatGPT's API to initialize and create a jbang script that attempts to do what you expressed on the command line.
You can see it in action in this video: https://www.youtube.com/watch?v=4Ol3sMm8xDM
Enjoy!
🚀 Features
- 152424f support use of ChatGPT in init
🐛 Fixes
- 39ada52 remove codeblocks and make magiccontent part of init
- 37ae906 essential space
- 4388052 trim trailing whitespaces in //MODULE directive (#1602)
- 010a613 [minor]
Contributors
We'd like to thank the following people for their contributions:
Max Rydahl Andersen, GitHub, Fred Bricon
v0.105.2
v0.105.1
Magic jbang edit
jbang edit yourfile.java
now assumes your IDE has one of the jbang plugins installed (see https://jbang.dev/ide).
Since jbang edit
install and run vscodium by default if you simply use jbang edit
things will just work.
If you want the old behavior (which is great with emacs, vi, etc.) then just enable sandbox using (-b
) jbang edit -b yourfile.java
JBang will based on the arguments you pass take an educated guess on which folder you want to open based on the source file.
It will look at package/directory names, for common editor markers (.vscode,.project,.idea, etc) and build files (pom.xml, build.gradle,etc) to find the best place to open an IDE.
Module cleanup
In previous versions we introduced support for building modular applications. You indicate to JBang with a //MODULE
command or by having a module-info.java
file then JBang will automatically switch to using modulepaths over classpath. This release continues to clean things up and make it easier to use.
Export jlink
jbang export jlink
is now an option. Allowing you write a jbang app/script and export it as an application that has the Java runtime embedded within it.
Changelog
🐛 Fixes
- 0a5a45a exlude naming.ldap from module list and support package in package name
🛠 Build
- 8d81b9e fix formatting
- 1e13a0b [patch]
Contributors
We'd like to thank the following people for their contributions:
Max Rydahl Andersen
v0.104.0
@quintesse been on fire and added some long-time coming improvements! Java 17, module support and magic file replacement.
Default to Java 17, still work with Java 8+
JBang will now default to install Java 17 if no other Java is available. Mainly done since Java 13+ has features that makes symbolic
links work by default better on Windows; but also just that Java 17 is a better default to use for Java code these days. Note: JBang will continue to work with Java 8+ to ensure JBang is available on as many platforms as possible.
(Experimental) Support for Java Modules
You can now add a //MODULE
line to your java sources and JBang will build and run it as a Java Module. Any //DEPS
gets converted to a requires
module and the module path rather than classpath is used for dependencies.
Try it out and tell if it works for your Java Module usecases.
Magical remote file expansion
JBang will now download remote files on the command line and replace them with file references. i.e. '%https://some.url/a.txt' or '%{https://some.url/a.txt}'.
This allows you utilize jbang's file download/caching mechanism to enhance scripts that deal with local files to handle remote urls:
jbang wordcount %https://github.com/dwyl/english-words/raw/master/words.txt
Similarly we've added this support to --javaagent
too allowing you do things like:
jbang --verbose --javaagent=byteman@maxandersen=boot:$(jbang info classpath byteman@maxandersen),script:%{https://raw.githubusercontent.com/bytemanproject/byteman/main/sample/scripts/FileMonitor.btm} env@jbangdev
Which fetches the byteman agent using the alias byteman@maxandersen
and fetches remotely the FileMonitor.btm
file to inject its instructions.
Enabling to use and run agents without having to install any java or agent scripts - all without having to change byteman.
Changelog
🚀 Features
- 427fb31 added support for modules (#1567)
- 0e8fe6d added support for remote-file arguments (#1577)
- d52e090 set Java 17 as the default for new installations (#1583)
🐛 Fixes
- 2dd639d Fixed NPE dealing with jdk providers (#1586)
- 5398043 Symbolic link permission issues on Windows (#1575)
- 418614c all default values can be set by config (#1578)
- ef74350 fixed issue with PowerShell quoting
- b1b0b08
jdk list --available
now takes into account os/arch (#1573) - f467fa4
info tools
now downloads JDKs again (#1571)
- 7cce78e [minor]
- 1836382 add davsclaus as a contributor for code (#1581)
- 483883e Upgrade (c) from 2022 to 2023 (#1580)
- b96e296 add docs for reason on camelcase vs noncase
Contributors
We'd like to thank the following people for their contributions:
Claus Ibsen, Tako Schotanus, Max Rydahl Andersen, GitHub, allcontributors[bot]
v0.103.2
v0.103.1
Fixed regression where if you swapped from new jbang to older jbang things could go bad due to the new caching.
Changelog
🐛 Fixes
- fcd7ea4 make sure our new etags don't break old jbangs
Contributors
We'd like to thank the following people for their contributions:
Tako Schotanus, Max Rydahl Andersen
v0.103.0
A new release and this one is a silent but beautiful one.
First there is a bunch of small fixes after last release custom JDK support introduced some regressions - like breaking Groovy support; but that is now back. Thanks for all the feedback!
export fat jar
jbang export fatjar
now exists. It merges all dependencies into a single combined jar allowing you to easily copy/distribute as a single command . It merges overlapping META-INF/services
and for most things that seem sufficient.
If you use it and things does not work, open issues and we can look at improving it.
native image now honored by alias
@kanha-gupta contributed his first fix making it so --native
for building native images
works for aliases.
jbang will now get latest version, reducing need to use --fresh
Since forever jbang aliases were defined in a catalog and if that catalog was updated
AFTER you fetched something the first time you would not get the latest updates unless you used --fresh
.
Now @quintesse implemented proper cache eviction so that
a) when you run an alias jbang newcommand@somecatalog
and that newcommand
is not found locally then
jbang will now force reload the catalog to see if there is a new command.
b) By default every 12 hours the cache will be refreshed, meaning updates to alias catalogs (not just new ones will automatically be downloaded)
This allows for much smoother updates and ensuring users have the latest and greatest.
If for some reason you as a user do NOT want that (i.e. you really want zero updates) you have multiple options dependent on your usecase:
- To get similar behavior as before, set
cache-evict
to never, i.e.jbang config set cache-evict never
- run with
--offline
thenjbang
will not do any remote requests, including cache updates. - install/use aliases with a specific version or even SHA. i.e.
jbang cmd@myorg//2.0
orjbang kill@quarkusio//5b58242
to lock in a specific alias.
Changelog
🚀 Features
- 7281285 now always using latest aliases
- b9f61f4
config list --show-available
now shows descriptions - 9848c8c caching now supports ETag
- 8febe9c cached files are now checked with HEAD
- 53d1e6c implemented first version of
export fatjar
- 7682219 improved Linux/Mac startup script (#1551)
🐛 Fixes
- 9ba1084 broken JDK links no longer cause problems
- 6ea7835
jdk install --force
was not forcing install - f0917fa minor fix in log messages
- 01d26c4 artifact up-to-date check is more lenient
- 15680bc fixed minor GAV resolve ordering problem
- 465c941 fixes duplicate classpath entries
- 098d7fe Groovy compiler now runs correctly
- 006959a we don't blindly import JAR metadata anymore (#1549)
- 66c9f3a Alias command now properly sets nativeImage (#1547)
♻️ Changes
- ac44ea4 Gist handling now uses core code for downloads
🧰 Tasks
- a465522 prefer installing default java version
- f0b1bbc minor update in logging and cache-evict default
- 662fa9e recompiled
hellojar.jar
with Java 8 - 5501090
app setup
now tells user about--force
(#1550) - b1756bf verbose mode now includes timing (#1552)
🛠 Build
- a27766c added tests for new ETag caching code
- 862e6da added tests for the new caching code
- 47b43ca report github rate limit
Contributors
We'd like to thank the following people for their contributions:
Tako Schotanus, Max Rydahl Andersen, kanha gupta, GitHub
v0.102.0
Its 2023 and time to get releases going again :)
Basic Auth
Michael Meyers added basic auth support for loading scripts allowing you to specify a username/password for secured scripts:
export JBANG_BASIC_AUTH_USERNAME=myname
export JBANG_BASIC_AUTH_PASSWORD=supersecret
jbang https://some.private/location.java
Download sources
IDE's and Users can now tell JBang to download sources. Useful to have IDE's pickup sources immediately.
jbang edit
will resolve sources automatically, and by setting JBANG_DOWNLOAD_SOURCES=true
as a environment variable all operations resolving dependencies will resolve sources too.
jbang jdk
being more consistent
jbang jdk
allows you to manage the java versions installed by jbang; thus jbang jdk java-env
would always prefer jbang managed jdk. Now jbang jdk java-env
will honor how jbang otherwise pick java. Meaning if you have a java in your path it will print the java-env info for java from the path.
This is a small change but could break your assumptions if you assumed jbang jdk java-env
would always give you a jbang installed java.
Using other package manager's java (Experimental)
JBang defaults to use your local configured java or download and use versions of java from Adoptium project if no fitting JDK present.
Users using sdkman and other package managers, like scoop on Windows, requested that JBang could use those package managers java rather than jbang's own.
In this release there is a --jdk-providers
flag that allows you to enable use of sdkman and scoop.
i.e. to have jbang
honor sdkman installs before jbang but still use path if present do following:
jbang jdk --jdk-providers=path,sdkman,jbang list --show-details
Installed JDKs (<=default):
11 (11.0.17, path, path, /Users/manderse/.sdkman/candidates/java/current)
11 (11.0.17, sdkman, 11.0.17-zulu-sdkman, /Users/manderse/.sdkman/candidates/java/11.0.17-zulu)
11 (11.0.17, sdkman, current-sdkman, /Users/manderse/.sdkman/candidates/java/current)
11 (11.0.17, jbang, 11-jbang, /Users/manderse/.jbang/cache/jdks/11)
17 (17.0.5, jbang, 17-jbang, /Users/manderse/.jbang/cache/jdks/17)
19 (19.0.1, jbang, 19-jbang, /Users/manderse/.jbang/cache/jdks/19)
20 (20, jbang, 20-jbang, /Users/manderse/.jbang/cache/jdks/20)
Similar can be done with run, build and other jdk commands to get jbang to pick other package managers java.
Changelog
Contributors
We'd like to thank the following people for their contributions:
Tako Schotanus, Max Rydahl Andersen, Francesco Marchioni, Mikael Koskinen, Michael Meyer
🚀 Features
- 20b39af Enabled the usage of existing JDK installations (#1500)
- 28957ce adding --ds/--download-sources and auto download for edit (#1539)
- 019d732 support basic-auth for loading scripts (#1516)
🐛 Fixes
- ddb15da upgraded to latest spotless
- 6a991da make integrations work again (#1525)
- ff43188 first install on Windows not working
🛠 Build
- 062e1c8 remove spotlessxml implicit dependency warnings