Add optional jbundle.toml configuration file
- Dominant language
- Rust
- Stars
- 181
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Support an optional `jbundle.toml` file in the project root to avoid repeating CLI flags on every build. CLI flags always take precedence over the config file.
## Motivation
Currently all build options (`--java-version`, `--target`, `--jvm-args`, `--shrink`) must be passed via CLI on every invocation. This becomes repetitive when:
- A project always targets a specific platform (e.g., Linux containers)
- JVM args are project-specific and don't change between builds
- Multiple team members need consistent build settings
- CI/CD pipelines want config versioned in the repository
## Proposed Format
```toml
# jbundle.toml
java_version = 21
target = "linux-x64"
shrink = true
jvm_args = ["-Xmx512m", "-XX:+UseZGC"]
```
All fields are optional. Missing fields fall back to existing defaults (auto-detect java version, current platform target, no jvm args, shrink disabled).
## Precedence
```
CLI flags > jbundle.toml > built-in defaults
```
## Scope
- Read `jbundle.toml` from the input directory (or CWD if input is a JAR)
- Parse with the `toml` crate
- Merge with CLI args (CLI wins)
- No multi-profile/multi-target support in v1 — keep it minimal
## Non-goals (for now)
- Multiple build profiles
- Multi-target builds in a single invocation
- Global config file (`~/.config/jbundle/config.toml`)
- Environment variable overrides
These can be added later if there's real demand.
Contributor guide
Research direction
Start by locating the CLI argument handling and the build entry point, then trace how the input directory or JAR path is resolved. Use the proposed fields, defaults, and CLI > jbundle.toml precedence as acceptance criteria; done means an optional root configuration is parsed, merged, and does not support profiles or multi-target builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100