CLAP: see multicall example: https://github.com/clap-rs/clap/blob/master/examples/multicall-busybox.rs
- download base is directed to user's download dir
- similar structure will be there as in legacy caches:
<TOOLNAME>/ <LATEST_FILE> latest-url.txt <ARCHIVE_BASENAME>-<URL_HASH>/ <ARCHIVE> (.zip/.tgz) <CRC files> (.md5, .sha1, .sha256, .asc ...) url.txt <symlink to installation dir>
?? Candidates:
~/.java/<TOOLNAME>
(also default for others)~/.m2
|~/.gradle
| ...~/opt
|/opt
Linking options:
- native symlink, using FS capabilities
- ux:
ln -s ...
- win:
mklink
(requires special setup)
- ux:
- launcher script
- ux:
sh
script ending withexec
handover - win:
.bat
|.cmd
- ux:
- ?? user can choose or configure
- ?? default: symlink on ux,
.bat
on win Links will be placed in a directory on PATH list, perhaps~/bin
.
- file:
config.properties
|<tool>.properties
- ?? maybe TOML format ??
- location: something standard, like ux:
~/.config/javabox/
, win: ...
Configurable options:
...global
- ??linking strategy??
- default clone directory
- per well-known repos
- configure custom well-known repos
- enable initial build
- new version check min. interval
... per tool
- java: default vendor
- java: default major version per vendor
- java: default version per each major
- default tool version if latest is not to be checked
- enforce version (overrides any defaults, meant for temporary use)
- skip/enforce hash checking
- specific version aliases
- new version check min. interval
Normally, javabox passes the commandline args to the target tool as-is. Some explicit modifications are however possible, by including options that are specially prefixed/postfixed.
- ?? The prefix is
@@
and postfix is `::'.
Use-cases:
- override JDK major version:
@@jdk=11::
- override JDK exact version:
@@jdk=11.0.b2::
- override JDK vendor:
@@jdk:graal::
- override tool version:
@@mvn=3.2.1::
User places these into the command-line. Javabox removes them prior passing to the tool.
Example:
mvn @@jdk=19:: @@mvn=3.2.1:: clean build
These scenarios will be presented in file BUILD.md
so that the user can see it on
web repo.
Part of that file may also serve as a wrapper configuration.
User wants to build a project
(WX) ... from web repo, and has completely empty box
- ?? user must install git/svn/hg/* himself ??
- runs command suggested from readme; kind of
curl something.url?github=x/y | sh"
- if not present, javabox is downloaded and installed
- javabox setup is executed: symlinks, default configs etc
- javabox executes initial sequence
javabox init --url=https://x.y.z/a/b/c --dir=/code/dir
- ??maybe install scm??
- ??maybe use embedded git/scm??
- project is cloned to code directory
- wrapper properties are examined
- JDK is located or downloaded+installed
- Maven is located or downloaded+installed
- initial build or preload is performed
- little timing and action report is presented on console
- if not present, javabox is downloaded and installed
(DX) ... that resides on disk, but he has no javabox yet
- runs
./mvnw clean build
- if not present, javabox is downloaded and installed
- javabox setup is executed: symlinks, default configs etc
- javabox passes command to maven
javabox mvn $*
- wrapper properties are examined
- ... etc.
- if not present, javabox is downloaded and installed
(DJ) ... that resides on disk, and already has javabox
- runs
mvn clean install
(WJ) ... from web repo and has javabox installed
- runs
javabox init --scm=git:https://x.y.z/a/b/c --under=bindings/java .
--scm
is the scm url, starts with the scm type prefix (git
,svn
, ... see how Maven defines this)--under
is optional, indicates that the project resides somewhere else than on the root- do we really need this?
- the last param is target dir (here dot), indicates the desire to install it here (must be empty) or indicated dir (must be empty or missing) rather than in auto-determined directory (the default)
- install and setup javabox first if missing
- one day this will be part of the distro
- adjust javabox settings
- init project from web or run via wrapper
javabox checks if setup was performed, and suggests it if not
- creates
BUILD.md
- adds wrapper launchers and configuration to repo
- adds it to git