Skip to content

Upgrading

Geert Bevin edited this page Jun 16, 2024 · 6 revisions

bld offers a very convenient way to upgrade an existing project to the latest version. If you use a package manager like Homebrew or SDKMAN!, a global bld tool will be installed on your system. This tool can be used to automatically upgrade your project.

Verify the installed bld version

Do to so, just type:

bld

NOTE: you can also use the self-contained bld jar instead, you can find more information in the installation section.

You'll see the welcome message with a list of commands that are supported, for instance:

Welcome to bld 1.9.1.

The bld CLI provides its features through a series of commands that
perform specific tasks. The help command provides more information about
the other commands.

Usage: help [command]

The following commands are supported.

  create        Creates a new project from multiple choice
  create-app    Creates a new Java application project
  create-base   Creates a new Java baseline project
  create-lib    Creates a new Java library project
  create-rife2  Creates a new RIFE2 web application project
  help          Provides help about any of the other commands
  upgrade       Upgrades the bld wrapper to the latest version
  version       Outputs the version of the build system

  -?, -h, --help    Shows this help message
  -D<name>=<value>  Set a JVM system property
  -s, --stacktrace  Print out the stacktrace for exceptions

You'll notice that the version is 1.9.1 and also that upgrade is one of the available commands.

NOTE: you could have used the bld version command to directly check the version, but I wanted to highlight the upgrade command at the same time

Verify the bld version of your project

With your project as your current directory, you can check the version directly:

./bld version
bld 1.8.0

You can see that the version is older than the installed version of bld.

Upgrade your project

Still with your project as your current directory, you can use the globally installed version of bld to perform the upgrade.

bld upgrade
The wrapper was successfully upgraded to 1.9.1.

NOTE: it can be confusing to spot the difference between bld and ./bld, the first one is installed in your global path, the second one is project specific. Upgrading is only available from the globally installed bld.

TIP: since bld doesn't need to be installed and can be ran directly from its jar file, you can upgrade any project without requiring any installation, for instance:

bash -c "$(curl -fsSL https://rife2.com/bld/upgrade.sh)"

Verify that the upgrade succeeded

You can now use the version command again with your project's bld:

./bld version
bld 1.9.1

By using git you can also verify exactly which files were changed:

git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   .idea/libraries/bld.xml
	modified:   .vscode/settings.json
	modified:   lib/bld/bld-wrapper.jar
	modified:   lib/bld/bld-wrapper.properties

no changes added to commit (use "git add" and/or "git commit -a")

Next learn more about Extensions