Skip to content

v0.89.1

Compare
Choose a tag to compare
@maxandersen maxandersen released this 11 Feb 23:50
· 432 commits to main since this release

Changelog

0.89 fixes long-standing issue in how jshell was setup with dependencies. Turns out that to have execution AND content-assist working you must specify the classpath twice. Quite bad UX when using 3rd party dependencies but now jbang have it fully working :)

Imagine you have a file named deps.jsh that uses the Faker library:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS https://github.com/blocoio/faker/tree/1.2.8

import io.bloco.faker.Faker;

Faker fake = new Faker("da-DK");

Then you can run it directly using ./deps.jsh or jbang deps.jsh but you can also use jbang --interactive deps.jsh to have some fun with Faker.

2022-02-12_00-42-26.mp4

Compare that to what you would need to write out using raw jshell:

jshell --execution=local -J--add-modules=ALL-SYSTEM --class-path=/Users/max/.m2/repository/com/github/blocoio/faker/1.2.8/faker-1.2.8.jar:/Users/max/.m2/repository/com/github/bmoliveira/snake-yaml/v1.18-android/snake-yaml-v1.18-android.jar:/Users/max/.m2/repository/joda-time/joda-time/2.9.1/joda-time-2.9.1.jar -J--class-path=/Users/max/.m2/repository/com/github/blocoio/faker/1.2.8/faker-1.2.8.jar:/Users/max/.m2/repository/com/github/bmoliveira/snake-yaml/v1.18-android/snake-yaml-v1.18-android.jar:/Users/max/.m2/repository/joda-time/joda-time/2.9.1/joda-time-2.9.1.jar --startup=DEFAULT --startup=/var/folders/yb/sytszfld4sg8vwr1h0w20jlw0000gn/T/jbang_arguments_12529495078878297375deps.jsh /Users/max/code/personal/jbangdev/jbang/itests/deps.jsh

Simplicity FTW :)

Also include fix (#1232) so jbang init actually will honor default properties for a template.

Thanks to @nandorholozsnyak and @quintesse!

Full Changelog: v0.88.0...v0.89.1