github jbangdev/jbang v0.46.0

latest releases: v0.135.1, v0.135.0, v0.134.3...
5 years ago

0.46.0 (2020/09/20)

Multiple source files are here! or at least an initial version.

Multiple source files

You can now in the main script file add //SOURCES File1.java File2.java to have File1.java and File2.java added to the sources being compiled. Note: this is experimental for now, see known limitations further down.

Limits of Multiple source files

This initial support for multiple files has some limitations that depedent on feedback will be lifted.

  1. Main limitation is that all //DEPS and similar commands have to be in the main source file, the additonal source files does not affect the 'build'.
  2. jbang edit probably have limits; right now probably will only work with all files in the same directory.
  3. remote scripts (i.e. over https) does not support multiple source files yet.

Do please try it out and let us know if it works and do please open issues and/or leave comments on the limits above - it encourages on fixing them and helps understand how it is used!

Local alias catalog

The alias commands now will honor jbang-catalog.json files found in current and parent directories all the way to the root. This lets you have jbang aliases defined for your local project and also lets you edit jbang-catalog repositories using just jbang commands. i.e. here is how to setup your own jbang-catalog:

$ mkdir jbang-catalog
$ cd jbang-catalog
$ jbang init hello.java
$ jbang alias add -f jbang-catalog.json hey hello.java

Now jbang hey will run hello.java and you can use git init and push jbang-catalog to your favorite username or org on github, gitlab and gitbucket and jbang hey@yourname will now be possible to run your hello.java as long as they have jbang installed.

A Maven plugin!

@gastaldi contributed a Maven plugin allowing you to more easily use jbang from a maven build.

See more at https://github.com/jbangdev/jbang-maven-plugin.

jbang edit --open and breaking --live

jbang edit now supports using --open=<editor> no matter if you want to have live edit or not.

This unfortunately meant we had to break --live behavior. --live is now a boolean toggle and thus where you previously did jbang edit --live=<editor> you now do jbang edit --open=code --live.

Smarter Quarkus

The mechanism which allows using Quarkus now automatically generates main methods when needed and sets up needed java flags (such as logmanager) making the script files even smaller. Note: requires Quarkus 1.8.1+.

Commits

Bug Fixes

  • "javac not found" error (#298) (#81126a3d, closes #283)
  • Add missing backtick in catalog table (#315) (#13a84983)
  • templates: escape path to not trigger qute (#2cfe03cb, closes #317)

Features

  • Add ability for integration classes to return JVM args and main classes (#320) (#f1b02490)
  • Support for local/nearest catalogs (#722e9333, closes #180)
  • save persistent args in jar for reuse (#5bde293e)
  • Initial support for multiple sources (#323) (#fdf97ffe)
  • edit: add `--open=[editor] and make --live a boolean (#314) (#9e872630)

Breaking Changes

  • edit: due to 9e872630,
    --live=[editor] will no longer work. Use --open=[editor] --live instead.

Don't miss a new jbang release

NewReleases is sending notifications on new releases.