Guidelines for coding agents in this repository.
The Java Updater is a Rust-based CLI tool designed to automate the process of downloading, unpacking, and replacing Java installations. It supports multiple vendors and provides a flexible configuration system.
- Main Technologies: Rust (2024 edition),
clap(CLI),reqwest(HTTP),serde(YAML/JSON),tracing(logging). - Architecture:
- Multi-threaded execution using a thread pool for parallel installation processing.
- Modular vendor support (Azul, Eclipse) implemented via feature flags.
- Variable expansion in configuration paths (e.g.,
${JU_CONFIG_ARCH},${env.PATH}). - Hook system for notifications on failure, success, or update.
This project uses just (https://github.com/casey/just) as a command runner.
- Build:
just build(debug) orjust build-release(release). - Run:
just run -- [ARGS]orjust run-full -- [ARGS](with all features). - Test:
just test(all features, all targets). - Lint:
just clippyorjust clippy-pedantic. - Format:
just fmt. - Clean:
just clean. - Install:
just install(installs to cargo bin directory).
By default, the tool looks for java-updater.yml in the current directory. You can specify a custom config path using the --config argument.
- Shell:
justrecipes are configured to use PowerShell (pwsh). - Error Handling: Uses
anyhowfor high-level error propagation andthiserrorfor library-level errors. - Logging: Uses
tracing. Adjust log level viaRUST_LOGenvironment variable or-v,-vv, etc. CLI flags. - Formatting: Adheres to
rustfmt(see.rustfmt.toml). Usejust fmtbefore committing. - Testing:
- Unit tests are located inline within
src/modules. - Integration tests are located in the
tests/directory.
- Unit tests are located inline within
- Platform Support:
- Windows: Uses
zipfor extraction and taskbar progress support. - Unix: Uses
tarandflate2for extraction.
- Windows: Uses
- Performance: Release builds are highly optimized for size and speed (see
profile.releaseinCargo.toml).