jbang

Unleash the power of Java - JBang Lets Students, Educators and Professional Developers create, edit and run self-contained source-only Java programs with unprecedented ease.

MIT License

Stars
1.3K
Committers
91

Bot releases are visible (Hide)

jbang - v0.79.0

Published by maxandersen about 3 years ago

Release that enables specifying java version and main method + java options when setting up aliases. Useful when you cannot change the jar or source code the alias refer to, i.e. jbang alias add --java 16 <urltojar>

You can now refer to {scriptref} in templates to know what file name user pointed to when running jbang init.

Also piping script to a jbang is now a bit smarter - it will try and find a main class so cat main.java | jbang - will just work; and otherwise it will assume the input is jshell style code. If you want to force jshell behavior you can activate that with --jsh, ie. cat main.java | jbang --jsh -

Changelog

🚀 Features

  • 2d0195b added java and main options to aliases (#979)
  • 3d476c9 build now has --catalog option too (#977)
  • 99b5281 Add java-options for aliases (#976)
  • 5be76e6 detect main method in stdin to trigger java instead of jsh (#972)
  • aba5f68 be able to refer to scriptref in init templates (#968)

🧰 Tasks

  • 3f6688e disable docker and sdkman packagers
  • 09e6acc fix and expression
  • ff5984c checkout to fix build check
  • db060e4 only updatewebsite if docs folder changed
  • 2c329d1 fix package publish ch
  • 8dd106e use jreleaser directly for publish

  • cd8a820 [minor]
  • 6ad9dae Update usage.adoc

Contributors

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

jbang - v0.78.0

Published by maxandersen about 3 years ago

Changelog

🐛 Fixes

  • a0d6613 Update correct bash file on Mac (#966)

🧰 Tasks

  • 9767fba jreleaser fixes and sdkman upload

📝 Documentation

  • d0d5556 fix add alias. Fixes #943

  • fab2f81 [minor]
  • 16a444b fix twitter announcement

Contributors

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

jbang - v0.77.0

Published by maxandersen over 3 years ago

Changelog

Special edition release jumping a few version numbers by accident :)

Big thing in this release is you can now refer to properties when using jbang init, i.e jbang init -Dkey=value mytemplate@acmeio and
jbang will now honour maven.local.repo system property if present.

And thanks to @aalmiray JBang is now released using jreleaser.org.

🚀 Features

  • 671a0f0 properties for init templates (#961)

🐛 Fixes

  • 8664a90 avoid jitpack gets added unnecessarily (#957)

🧰 Tasks

  • 127809a add additional jreleaser secrets
  • 31b2800 Add JReleaser configuration & templates (#899)

  • 5877729 [minor] relase
  • c470cfa Honor maven.repo.local system property to align with maven and gradle behavior. JBANG_REPO env variable will win if both present. (#958)
  • 2cb5973 add note about fish shell

Contributors

Max Rydahl Andersen, Andres Almiray

jbang - v0.72.0

Published by github-actions[bot] over 3 years ago

A good set of bugfixes was piling up thus time to release!

Also check out updated documentation at https://jbang.dev/documentation

Features

  • Document using JBang on Windows, improve diagnosability of symbolic linking issues (#898) (#478f0c82)

Bug Fixes

  • homebrew install was using the wrong jbang.jar (#c697ce1e, closes #885)
  • Correct use of @-files (#884) (#cee30873, closes #874)
  • Make startup scripts a little more foolproof (#883) (#118a69f2)
  • jbang needs double brackets for if check. Fixes 928 (#2395fe7c)
  • powershell bad and expression. (#935) (#d6339ba4, closes #932)
  • Docs don't explain several JBANG_ env vars #785 (#0d3e1306)
  • better trust url for maven central and default to parent url (#950) (#46b611bc, closes #944)
  • @pom dependencies handled when using jbang edit (#951) (#8b531614)
jbang - v0.71.1

Published by github-actions[bot] over 3 years ago

0.71.0 (2021/05/25)

Note: if you use brew for updating jbang you might need to run brew tap --repair due to default branch renamed from master to main.

Kotlin support

@evanchooly dropped by and contributed initial experimental Kotlin support. Yes, you can now use Kotlin in addition to plain Java with jbang; you can for example write a Quarkus microservice in Kotlin like this: `

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus:quarkus-bom:${quarkus.version:1.11.0.Final}@pom
//DEPS io.quarkus:quarkus-resteasy
import javax.ws.rs.*
import javax.ws.rs.core.MediaType

@Path("/greeting")
class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    fun hello() = "hello"
}

Note, the Kotlin support is experimental with the intent to let everyone and try it out and give feedback and we see where it should go.com.

Things that works now:

  • jbang init -t hello.kt hello creates a basic kotlin file.
  • jbang xyz.kt should "just work"
  • Quarkus integration verified to work for basic examples.

Things not yet implemented/tested (open issues if you need/want these):

  • jbang edit is not aware of kotlin
  • mix of .java and .kotlin not tested (if main file is .kt it should work)
  • Kotlin scripts (i.e. latest kotlin .main.kts nor kscripts .kts) are not supported

Alpine Linux container images

jbang will now download Java 16 builds for Alpine Linux to avoid just falling over.

info tools

jbang info tools have more information than before allowing tools like the experimental JBang Eclipse integration to work.

Finally some bug fixes and started move from master to main on repositories.

Bug Fixes

  • jdk home output won't print "echo" anymore (#841) (#617546d2)
  • Don't use eval in app scripts (#855) (#4add8362)
  • Trying to app install a GAV resulted in an NPE (#866) (#20ad4663, closes #778)
  • Update should now work on Windows (#878) (#44009595)

Features

  • Support Alpine Linux (#839) (#d5be441c)
  • info tools now returns a lot more information (#859) (#e03d6d96, closes #833)
  • Kotlin support (#876) (#211bcaed)
jbang - v0.70.0

Published by github-actions[bot] over 3 years ago

Release that fixes error in jbang.cmd on Windows, and improves quoting for arguments
and now jbang edit will include //FILES in the IDE project making it easier to
edit multi-file jbang apps.

Bug Fixes

  • Invalid comment in jbang.cmd (#8da7d2ca)
  • Make sure java opts get quoted properly in jar MANIFEST (#825) (#0a39ad15)

Features

  • //FILES included in ide project Fixes #749 (#817) (#befd3165, closes #749)
jbang - v0.69.2

Published by github-actions[bot] over 3 years ago

Whoopsie - we had a regression where --java and //JAVA not being consistently applied.
Now fixed - please update :)

Bug Fixes

  • build and runtime not following same java version. fixes 806 (#807) (#6e85aeeb)
  • jbang update not working if update already downloaded old update. (#810) (#b5301b22, closes #809
jbang - v0.69.1

Published by github-actions[bot] over 3 years ago

jbang export now has a sub-command to export your jbang script/app to
a maven repo.

This allows jbang scripts/apps to be used like any other maven dependencies by
i.e. classic maven and gradle projects.

For it to work you need to publish the repo using tools that understand maven repositories.

One such tool is https://jitpack.io which provides a build service that exposes github,
gitlag, etc. git repositories as maven repositories.

To get jitpack to understand jbang projects you need to put a jitpack.yml in the root of the project
with content like this:

before_install:
  -  curl -Ls https://sh.jbang.dev | bash -s - app setup
install:
  - ~/.jbang/bin/jbang export mavenrepo --force -O target -Dgroup=$GROUP -Dartifact=$ARTIFACT -Dversion=$VERSION hello.java
  - mkdir -p ~/.m2/repository
  - cp -rv target/* ~/.m2/repository/

This should enable some interesting usecases for jbang script and applications :)

Breaking change

Since jbang export now have subcommands, instead of flags you will need to use jbang export local instead of jbang export from past versions of jbang.

Bug Fixes

  • Fixed template init naming validation (#c7b0b593, closes #790)
  • be able to launch editors with space in name (#800) (#b2b06628)

Features

  • add interactive mode for non-jshell (#802) (#0a39c969)
  • add mavenrepo export option (#769) (#d9a4fcd5)
jbang - v0.68.0

Published by github-actions[bot] over 3 years ago

Main event for this release are templates are now thanks to @quintesse not limited to be bundled in jbang.

Until now we had jbang -t cli hello.java to create java file using the pre-bundled cli template.

Templates can now be added to jbang-catalogs both locally or in a remote location.

Allow projects that want to get a head-start and make it easy to try out their api can add templates to their jbang-catalog so users can do things like:

jbang init -t helloworld@maxandersen hello.java

This will use the helloworld template configured in jbang-catalog.json in https://github.com/maxandersen/jbang-catalog.

You can read the details on how you can make your own templates for your project in the jbang readme.

If you do let us know on @jbangdev twitter!

Bug Fixes

  • Not duplicating or misquoting java options anymore (#787) (#94238801, closes #786)

Features

  • Catalog templates (#748) (#80674dd9)
jbang - v0.67.3

Published by github-actions[bot] over 3 years ago

Bug Fixes

  • have jbang app install GAV not use physical paths in script (#777) (#038ab5d0)
jbang - v0.67.2

Published by github-actions[bot] over 3 years ago

Bug Fixes

  • brew install failing due to renamed variable in jbang scrips (#27c602ed, closes #772)
jbang - v0.67.1

Published by github-actions[bot] over 3 years ago

Just a quick fix as @jeffmaury pointed out that there was a regression that prevented you
to use http git urls as a dependency anymore. i.e. //DEPS https://github.com/jgwest/zenhub-api-java-client no
longer resolved properly. That is now fixed.

Bug Fixes

  • make git urls work with jitpack again (#767) (#7cfb9d44)
jbang - v0.67.0

Published by github-actions[bot] over 3 years ago

Main new feature is jbang now runs cleanly on IBM AIX, Linux/ppc64le and Linux/390x thanks
to @sxa's first contribution.

Otherwise bugfixes in area of proper quote handling, symbolic links and cleanup. See details below.

Bug Fixes

  • include snap in build.gradle (#515a61e5)
  • Using correct backingResoure for JarSources (#738) (#09a85e07, closes #734)
  • No longer showing ugly error after app setup (#736) (#1f2e30d2)
  • Not showing version update message twice anymore (#730) (#44b40bef)
  • jbang-native setup on Windows (#747) (#e68df65c, closes #746)
  • ignore dead symbolic links and fail on explicit missing //SOURCE (#744)f (#edbd3e15)
  • Add support for AIX (#755) (#20431ad7)
  • Now correctly handles out-of-date dependencies (#758) (#e125ae29)
  • Make jbang work on Linux/ppc64le and Linux/s390x (#756) (#429b48c9)
  • Hand-off from Bash to CMD now quotes arguments properly (#a8303d9a)
  • Hand-off from wrapper to installed jbang now quotes ok (#b5addf62)
  • better help description for cache clear. (#e322eedd, closes #762)
jbang - v0.66.1

Published by github-actions[bot] over 3 years ago

No tag description found for unspecified# 0.66.1 (2021/02/15)

Bug fix for case where //JAVA <version> was only honored on the first run. Now fixed.

Bug Fixes

  • Second runs where special flags are ignored (#e706b8af)
jbang - v0.66.0

Published by github-actions[bot] over 3 years ago

jcenter, version check and offline

In this release we say bye-bye to jcenter and welcome to version check and enforced --offline mode.

maven central now used by default

jfrog announced they are shutting down their maven repository known as jcenter. jcenter was the default maven repository for jbang which is now changed to be maven central.

Thus if you have a jbang app that relied on dependencies found only in jcenter you will need to add jcenter repository using //REPOS.

Example:

//REPOS jcenter

Note: if you still want maven central used when using jcenter then you need to list both:

//REPOS mavencentral,jcenter

Automatic version check

jbang will now asynchronously check at a regular interval if a newer version is available and provide instruction on how to update. If you do not want the version check you can set JBANG_NO_VERSION_CHECK environment variable.

--offline now fully honored and enforced

offline mode was only fully honored by the dependency resolver. Now it is enforced for fetching scripts, catalogs, version check etc. Meaning --offline
truly is offline and if jbang needs to go online it will
now fail where it before would let the request go through.

Catalog refreshed using --fresh

Using jbang --fresh env@jbangdev and the @jbangdev catalog already had been fetched it would not use the latest versions despite the --fresh flag. Now catalogs will be downloaded if there are changes when using --fresh.

Bug Fixes

  • move to use mavencentral instead of jcenter (#714) (#7c342a4a)
  • The --offline flag is now toplevel and works in more cases (#d88da9b2)
  • Don't check for new versions in the container version of jbang (#6f73189f)
  • include java vendor in agent string (#2c855f4d)
  • remove version check env from github action (#95a32cef)

Features

  • Jbang now checks if a new version of itself is available (#f9392d2b)
  • Now using new jbang download URL (#ec21e210)
  • Made the version checking asynchronous (#8010f54d)
  • Added --check and --update options to jbang version (#15fcfa9e)

Refactor

  • Made --fresh a toplevel option
  • Made sure we don't check for a version twice
jbang - v0.65.1

Published by github-actions[bot] over 3 years ago

Fix to handle multi file content-disposition found on bitbucket servers.

Bug Fixes

  • Now fixes Content-Disposition with multiple filename entries (#e2254cb5, closes #693)
jbang - v0.65.0

Published by github-actions[bot] over 3 years ago

Small bug fix where the generated jars include dependencies that should have been overridable with --deps and --cp.

Bug Fixes

  • jbang doesn't store additional deps in JAR Class-Path anymore (#708) (#d41e4aec, closes #707)
jbang - v0.64.0

Published by github-actions[bot] over 3 years ago

0.64.0 (2021/02/05)

A cleanup release with a few minor but important fixes.

jbang will now trigger a rebuild if dependencies (i.e. SNAPSHOTS) have changed their last modified timestamp.
Makes it easier to use jbang to run the same unchanged script against actual changed dependencies without having to clear the cache manually.

info and edit now take --deps and --cp into consideration.

And bug fixed that caused problems for servers (like a private bitbucket server) when downloading raw git urls.

Also Big internal cleanup release - code is now much cleaner; will make it easier to
add features and fix bugs :)

Bug Fixes

  • Simplistic fix for encoded Content-Disposition (#694) (#2a91a00e, closes #693)

Features

  • Script options are now handled recursively (#9895367f)
  • --deps and --cp now available on info and edit (#695) (#d6654e77)
  • improved dependency handling (#699) (#ac1fc10a)

Refactor

  • Lots of cleanup and restructuring of packages.
jbang - v0.63.0

Published by github-actions[bot] over 3 years ago

0.63.0 (2021/01/24)

Small improvements but they all count :)

Visual Studio code will now automatically download java sources and documentation when needed (i.e. on hover)
and the VSCodium will be installed with java dependency extension to give better java project navigation.

Quarkus templates upgraded to use bom pom feature recently introduced. Thus jbang init -t qcli cli.java will not
init file with a Quarkus platform and no need to explicit list versions for Quarkus extensions.

Bug Fixes

  • include vscode-java-test of vscodium install to get run/test features [minor] (#f9e9a5de)
  • quarkus templates to use bom poms (#02884c6a)

Features

  • Automatically download sources in VS Code (#678) (#43d784d8)
  • java dependency extension installed together with vscode (#4f8b7eb8, closes #675)
jbang - v0.62.0

Published by github-actions[bot] almost 4 years ago

0.62.0 (2021/01/17)

I'm extremely happy to say that with this release jbang now support bom poms allowing you to do things like:

//DEPS io.quarkus:quarkus-bom:1.11.0.Final@pom
//DEPS io.quarkus:quarkus-resteasy
//DEPS io.quarkus:quarkus-smallrye-openapi
//DEPS io.quarkus:quarkus-swagger-ui

or

//DEPS com.microsoft.azure:azure-bom:1.0.0.M1@pom
//DEPS com.microsoft.azure:azure

Notice how first line are importing boms with @pom classifier. When jbang see these it will load that bom pom ` section to use as fallback when when resolving version less artifacts.

This removes a lot of redundancy and replaces it with just one line for the BOM POM.

Finally also added run/test/ visual code extension to the default vscodium install using jbang edit --open myapp.java`

Bug Fixes

  • include vscode-java-test of vscodium install to get run/test features [minor] (#a025d73c)

Features

  • support for BOM POM's i.e. maven dependencyManagement (#673) (#d5506a41, closes #63)
Package Rankings
Top 6.73% on Proxy.golang.org