Skip to content

Releases: jbangdev/jbang

v0.105.2

24 Mar 18:37
Compare
Choose a tag to compare

Changelog

🐛 Fixes

  • e26d6cc fix Apple Silicon vscodium download

Contributors

We'd like to thank the following people for their contributions:
Max Rydahl Andersen

v0.105.1

20 Mar 11:18
Compare
Choose a tag to compare

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


Contributors

We'd like to thank the following people for their contributions:
Max Rydahl Andersen

v0.104.0

24 Feb 11:40
Compare
Choose a tag to compare

@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

🐛 Fixes


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

19 Feb 23:32
Compare
Choose a tag to compare

Small fixes - see below for details.

Changelog

🐛 Fixes

  • 3b7e835 M1/aarch64 detection for javafx name
  • cec649c not using cache for jbang update anymore

♻️ Changes

  • 4aa562a extracted build state from Project

Contributors

We'd like to thank the following people for their contributions:
Tako Schotanus, Max Rydahl Andersen

v0.103.1

14 Feb 12:52
Compare
Choose a tag to compare

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

11 Feb 08:19
Compare
Choose a tag to compare

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 then jbang 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 or jbang 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

18 Jan 00:00
Compare
Choose a tag to compare

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

🛠 Build

  • 062e1c8 remove spotlessxml implicit dependency warnings

v0.101.0

25 Nov 09:46
Compare
Choose a tag to compare

Changelog

JBang once had Twitter support but they shutdown non-javascript based access to statuses. Thus it seems appropriate with all
the Mastodon happening to enable JBang to run Mastodon status url's:

jbang https://fosstodon.org/@jbangdev/109367735752497165

Thanks to @fbricon for helping adding some color to age-old "Hello World!"

Oh ...and we also finally managed to upgrade build to Gradle 7 (Thanks @quintesse) and with a better verification in github (Thanks @manikmagar)

🚀 Features

🧰 Tasks


Contributors

We'd like to thank the following people for their contributions:
Manik Magar, Tako Schotanus, Max Rydahl Andersen, GitHub

v0.100.1

17 Nov 23:19
Compare
Choose a tag to compare

Kotlin support was broken as its compiler don't support -g for debug symbols. Now fixed - sorry for the troubles!

🐛 Fixes

  • 35d2038 only add -g for javac invocations.

Contributors

We'd like to thank the following people for their contributions:
evanchooly, Tako Schotanus, Max Rydahl Andersen

v0.100.0

08 Nov 15:27
Compare
Choose a tag to compare

JBang is now a 100!

Fix missing authentication for Maven repositories

And this release fixes a regression where auth settings from ~/.m2/.settings.xml got ignored. Now they don't. Meaning by having the following in your ~/.m2/settings.xml:

...
<servers>
    <server>
      <id>github</id>
      <username>${env.GITHUB_ACTOR}</username>
      <password>${env.GITHUB_TOKEN}</password>
    </server>
  </servers>
...

which is the default case in GitHub actions jbang will once again work when using repositories that require authentication - which is the case for GitHub packages.

Compile and runtime flags

JBang now has -C and -R for setting compile and runtime flags.

This release adds debugging by default (i.e. running javac with -g). If you don't want that you can run with -C=-g:none. Turned that on because it allows then easy debugging - and it is what is the default for Maven and Gradle.

Download specific JBang version

Also added support for setting JBANG_DOWNLOAD_VERSION environment variable to allow installing arbitrary jbang versions. i.e.

curl -Ls https://sh.jbang.dev | JBANG_DOWNLOAD_VERSION=0.48.0 bash -s - app setup

Will (if no other jbang available on your system) install JBang 0.48 - the earliest JBang that had support for installing this way.

Enjoy!

Changelog

🚀 Features

  • 1649814 honor JBANG_DOWNLOAD_VERSION in bootstrap setup (#1505)
  • 6e6312d added support for specifying native options (#1494)
  • 876a540 enable -g by default + allow -g=vars,lines,source,none (#1479)

🐛 Fixes

  • cd1f71f ensure cache jdks directory exists before creating link (#1503)
  • 5227a95 apply auth from global settings to repositories and use ~/.m2/settings.xml as global rather than user settings (#1506)
  • 192972e now actually passing native options to nativeimage

📝 Documentation

  • d453045 Explain how you can install an existing jdk (#1487)
  • dae3dff update links to the Conventional Commits spec (#1488)

Contributors

We'd like to thank the following people for their contributions:
Tako Schotanus, oliv37, Max Rydahl Andersen, GitHub, Jérémie Bresson, allcontributors[bot]