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.116.0 Latest Release

Published by maxandersen 7 months ago

This release adds jbanghub catalog in by default. Meaning jbang catalog list now provides easy access to list of catalogs. See more at https://github.com/jbanghub.

JBang automatic java downloading now works on riscv64 and 32-bit arm systems thanks to @sxa.

Changelog

πŸš€ Features

  • 501961e feat: added jbanghub to builtin catalog (#1770)
  • cc1b285 feat: add riscv64 support (#1772)

πŸ› Fixes

  • c26de98 fix: 32-bit arm architecture detection missing (#1773)
  • eceb5c1 fix: fixes for handling more 3xx codes and not asking for trust twice (#1771)

πŸ“ Documentation

  • c494420 docs: explain how to specify classifiers on dependencies (#1775)

  • c59eb1b [minor] jbanghub
  • 078ccf4 add jponge as a contributor for doc (#1779)

Contributors

We'd like to thank the following people for their contributions:
GitHub, Julien Ponge, Max Rydahl Andersen, Stewart X Addison, Tako Schotanus, allcontributors[bot]

jbang - v0.115.0

Published by maxandersen 7 months ago

About time we have the first release of 2024!

This one has a good set of fixes and a few cleanup fixes around Aliases, Catalogs and app installs.

First, a (small) breaking change:

Aliases now get arguments appended instead of overwritten.
i.e. before you made an alias like:

jbang alias add 
  --name=color_sqlline \
  --deps com.oracle.database.jdbc:ojdbc8:23.3.0.23.09,com.h2database:h2:2.0.204 \
  sqlline:sqlline:1.12.0 --color=true

and call it jbang color_sqlline --nullValue='***' the --color=true would not apply.
That is now the case.

We should have done that from the beginning. It is more natural. Thank you to @robin-a-meade for reminding us!

Second, app installs now can specify build arguments to make it possible to have different commands with different build input.
For example specify system properties to change a version for a dependency.

Finally, catalogs now support import, i.e. jbang catalog add --import jbanghub will import all the alias, catalogs, templates etc. in the jbanghub catalog making it directly available without having to add @jbanghub to the name.

To do this some of the list commands and how catalog names are treated have been unified so things looks the same and can be accessed consistently.

Changelog

πŸš€ Features

  • 8855f35 feat!: alias arguments are now appended (#t)
  • 7380851 feat: allow setting build/run options for app install (#1754)
  • b9f8412 feat: extended syntax for catalog references (#1756)

πŸ› Fixes

  • d5dfb8c fix: taking tabs into account as seprator for tag values (#1759)
  • bd0c49a fix: typo in edit message (#1722)
  • c1fff3d fix: Edit wasn't updating Gradle build files correctly (#1728)
  • 7a8bc7d fix: fixed filename extraction from URL (#1742)
  • abc3c23 fix: support references with slashes. (#1731)

🧰 Tasks

  • fe45753 chore(deps): pin dependencies (#1762)
  • 7d61581 chore: enable renovate per mgr and best practice
  • d92cb15 chore: enable renovate per mgr and best practice
  • aebb6d1 chore: update quarkus version in templates (#1757)
  • 87c02ad chore: made rendering of lists less noisy (#1748)
  • 38fa191 chore: updated java-properties library to 0.0.7 (#1752)
  • 1657c47 chore(deps): update tj-actions/verify-changed-files action to v8 [security] (#1747)
  • 314bcf2 chore: update deps (#1721)
  • d662199 chore(deps): update tj-actions/verify-changed-files action to v7.2 [security] (#1725)
  • f5d8300 chore: added descriptions to some edit command flags (#1727)

  • 826755c [minor] relase
  • 3a11634 Catalog command improvements (#1743)
  • 9f47346 add tarilabs as a contributor for code (#1744)
  • 08a80ee add timfel as a contributor for code (#1739)

Contributors

We'd like to thank the following people for their contributions:
GitHub, Matteo Mortari, Max Rydahl Andersen, Tako Schotanus, Tamas Cservenak, Tim Felgentreff, allcontributors[bot], renovate[bot]

jbang - v0.114.0

Published by maxandersen 11 months ago

20% Faster

Moved artifact resolution to use MIMA via @cstamas's great work. This makes jbang use the newer version of Maven's artifactresolver.

The first obvious benefit is that JBang now is able to utilize the performance improvements and use better http client implementations bringing about ~20% faster downloads.

When next version of Maven resolver becomes available that number should increase even more significantly when it starts utilising http2.

We've tested as much as we could - all existing tests passes but it is a change of dependency resolution thus if you have some project that changes behavior because of this behavior do please open an issue.

Changelog

πŸ”„οΈ Changes

  • 443bcce refactor: Put MIMA in action (#1604)

  • 3b81415 release to maven central automatically
  • e44c986 Add @kanha-gupta as a contributor
  • 6c0b6b7 Add @ritikverma2000 as a contributor
  • 437abe0 Add @ottlinger as a contributor
  • 1dd7b52 Add @essobedo as a contributor
  • ea4a3c8 Add @mikoskinen as a contributor
  • 5e7d936 Add @micmeyer as a contributor
  • 69999eb add fmarchioni as a contributor for doc (#1712)
  • 36ac5bd add AObuchow as a contributor for security (#1711)
  • 726e196 add cstamas as a contributor for code (#1710)

Contributors

We'd like to thank the following people for their contributions:
GitHub, Max Rydahl Andersen, Tako Schotanus, Tamas Cservenak, allcontributors[bot]

jbang - v0.113.0

Published by maxandersen 11 months ago

Changelog

Added a magic %{deps:..} expansion on command line that will resolve dependencies in that expression and replace it with a classpath.

Lets you do things like:
jbang sqlline@maxandersen -cp %{deps:org.hsqldb:hsqldb:RELEASE} other args

removing need to manually deal with absolute paths to .jar files.

πŸš€ Features

  • f79a0f2 feat: added support for %{deps:...} substitutions in arguments (#1707)

  • 4c1221a [minor]

Contributors

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

jbang - v0.112.4

Published by maxandersen 11 months ago

A few user contribute fixes (thanks @essobedo and @ritikverma2000) but otherwise a release to test and verify that dev.jbang:jbang-cli is now publish to maven central.

What's Changed

New Contributors

Full Changelog: https://github.com/jbangdev/jbang/compare/v0.111.0...v0.112.4

jbang - v0.111.0

Published by maxandersen about 1 year ago

Lots of bugfixes and Groovy support now defaults to use Groovy 4. You can use //GROOVY <version> to use older Groovy if you need to.

πŸ› Fixes

  • b52a829 support Groovy 4
  • d8b8bb4 fix: Now showing integration errors when verbose is on (#1630)
  • 04f61ed fix: check manifest exist before reading from it (#1687)
  • 66eef4f fix: alias settings not being properly applied (#1686)
  • 418b904 fix: upgrade to commons-text 1.10.0 (#1674)
  • 0541427 fix: remove -g from runtime options because groovyc does not accept -g

🧰 Tasks

  • ca942a6 chore: not necessary to remove "-g"
  • dd6e913 chore: update to Kotlin 1.8.22
  • c8b8acd chore: update default Groovy version to 4.0.14

  • 4fbbd8c [minor] release
  • 81bf45f doc: document //GROOVY option
  • 085af33 add alexkarezin as a contributor for doc (#1680)
  • 1d13b2c Link readme.adoc to project architecture diagrams (#1667)
  • e850a8e Update organizing.adoc (#1669)

Contributors

We'd like to thank the following people for their contributions:
Alex Karezin, Andrew O, GitHub, Libing Chen, Max Rydahl Andersen, P. Ottlinger, Tako Schotanus, allcontributors[bot]

jbang - v0.110.1

Published by maxandersen about 1 year ago

Changelog

πŸ› Fixes

  • 64e2bef fix: we now only add -g flag to Java source types (#1657)
  • c535473 fix: Fixes NPE when running in container (#1660)

  • 40624d1 [patch] release

Contributors

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

jbang - v0.110.0

Published by maxandersen about 1 year ago

Changelog

JBang will now use "central" rather than "mavencentral" as its id for fetching dependencies allowing for better sharing of downloads between Maven and JBang based builds. Also means you can do //REPOS central as a shorthand. Should not break users but is a behavior change thus released as minor rather than a patch.

Fixed a regression where maven artifacts with capital letters failed to download.

jbang - v0.109.0

Published by maxandersen over 1 year ago

Changelog

Fixes and a minor and major new feature.

Scripts and jars as dependencies

//DEPS aloca.jar or //DEPS myscript.java or even //DEPS https://my.site/some/script.java is now allowed.

Allowing you to use scripts (or jars) as dependencies is different from using //SOURCES in the sense that the //DEPS gets built in isolation and is a true dependency rather than built inside the project. Allows for more decoupled and interesting composability of your jbang scripts and applications. Mainly; allow you to build and publish a java library without an intermediate publishing step.

Use it responsibly :)

Debug customization

I (re)learned from @danberindei that IDE's can work as clients to allow the java app to connect to the debugger rather than the other way around. Quite useful.

Thus jbang now allows customizing how debug is configured.

You can still just do jbang --debug myapp.java but you can now also pass in a comma separated list to configure the JDPA connection string. i.e.jbang --debug=server=n myapp.java to have it be a client rather than a server. You can set any other JDPA flag this way.

Fixes

Docker publish had been failing the last few releases. Finally figured out the issue. Should now work. Crossing fingers.
Multi-user access were causing issues for caching in docker containers; that should be fixed too now.

πŸš€ Features

  • 1bfa853 feat: Added support for script dependencies (#1641)
  • d87feaa feat: --debug now allow multiple key/values. --debug=server=n,suspend=y (#1642)

πŸ› Fixes

  • 61bdc6a fix: #1624 docker publish fail
  • d81bed7 fix: swallow any exceptions when setting file modified timestamp (#1639)

🧰 Tasks

  • c379bd3 chore: add justfile for those with bad memory

  • 333c385 [minor] release

Contributors

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

jbang - v0.108.0

Published by maxandersen over 1 year ago

Changelog

Recently support for main methods without a surrounding class was merged into OpenJDK main line.
This release now supports that feature.

At time of writing the default Termurin JDK builds does not have the latest build thus
for now you will have to manually build the JDK and set that up in your path.

Also since it is a Java preview feature you will need to use --enable-preview or put //PREVIEW in the file.

That means the smallest self-contained Java 21 example looks as follows:

//PREVIEW
//JAVA 21+

void main() {
    System.out.println("Hello World");
}

And can now be run using jbang main.java if you have Java 21 latest nightly build installed.

If you prefer

πŸš€ Features

  • 9c2255b feat: JEP 445: Unnamed Classes and Instance Main Methods (#1633)

πŸ› Fixes

  • ac432ec fix: detect version from JAVA_RUNTIME_VERSION and don't use JAVA_VERS… (#1632)

  • 62d3d7b [minor] java 21 JEP445 support

Contributors

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

jbang - v0.107.0

Published by maxandersen over 1 year ago

Let's call this the "Java 21" release as it adds jbang --enable-preview option that allows you to do easily try out openjdk preview features like Java 21 String templates without having to deal with -souce 21 and individual flags for javac nor java.

The following will download Java 21 (early builds) if needed and evaluate the String template using the args variable:

jbang --java 21 --enable-preview -c 'print(STR."First arg is \{args[0]}!")' JBang

Note: At time of release Adoptium the default Java provider used by JBang does not have early Java 21 builds thus either install a Java 21 manually or set JBANG_JDK_VENDOR=openjdk in the environment to tell JBang to use openjdk builds.

Changelog

πŸš€ Features

  • 578c6d0 feat: add support for --enable-preview (#1623)

πŸ› Fixes

  • 5968e49 fix: export will now create missing output folders (#1618)
  • 01ab8e8 fix: don't try resolving implicit catalogs for URLs (#1619)
  • 854fc66 fix: no longer throws exception for certain config values (#1615)

  • c4a1ff4 [minor] release
  • 3d4e122 doc: note on why jshell needs more flags for enable preview

Contributors

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

jbang - v0.106.3

Published by maxandersen over 1 year ago

Changelog

Fix issue where ChatGPT errors on bad keys or usage limits.

🧰 Tasks

  • 2ce01e2 chore: fix formatting

  • 7c95618 [patch] fix formatting

Contributors

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

jbang - v0.106.1

Published by maxandersen over 1 year ago

Changelog

  • 8516294 [patch] re-release as github failed to upload all artifacts

Contributors

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

jbang - v0.106.0

Published by maxandersen over 1 year ago

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

jbang - v0.105.2

Published by maxandersen over 1 year ago

Changelog

πŸ› Fixes

  • e26d6cc fix Apple Silicon vscodium download

  • 2448d0b [patch]

Contributors

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

jbang - v0.105.1

Published by maxandersen over 1 year ago

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

jbang - v0.104.0

Published by maxandersen over 1 year ago

@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]

jbang - v0.103.2

Published by maxandersen over 1 year ago

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

  • 15b48f6 [patch]

Contributors

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

jbang - v0.103.1

Published by maxandersen over 1 year ago

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

jbang - v0.103.0

Published by maxandersen over 1 year ago

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

  • e64edd2 [minor]
  • 7b978e0 Fix double resolve (#1553)

Contributors

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

Package Rankings
Top 6.73% on Proxy.golang.org