Skip to content

Commit 6b203cb

Browse files
committed
refactor(jvm): merge java module into jvm
Upstream introduced src/cmds/jvm/ (gradlew). Consolidate the Maven filter (mvn_cmd, pom_groupid, stack_trace, surefire_reports) under the same jvm/ umbrella so the module layout matches upstream. - move src/cmds/java/* -> src/cmds/jvm/* - crate::cmds::java:: -> crate::cmds::jvm:: - rename insta snapshots __java__ -> __jvm__ and fix source: headers - drop `pub mod java;` (jvm/mod.rs automod already covers the dir) - docs: src/cmds README, jvm README title + gradlew note, module map
1 parent a0f5bde commit 6b203cb

21 files changed

Lines changed: 20 additions & 22 deletions

.claude/rules/search-strategy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ src/
4444
│ ├── js/ ← npm, pnpm, vitest, lint, tsc, next, prettier, playwright, prisma
4545
│ ├── python/ ← ruff, pytest, mypy, pip
4646
│ ├── go/ ← go, golangci-lint
47-
│ ├── java/ ← mvn/mvnw (test, compile, checkstyle, dependency:tree)
47+
│ ├── jvm/ ← mvn/mvnw/mvnd, gradlew (test, compile, checkstyle, dependency:tree)
4848
│ ├── dotnet/ ← dotnet, binlog, trx, format_report
4949
│ ├── cloud/ ← aws, container (docker/kubectl), curl, wget, psql
5050
│ ├── system/ ← ls, tree, read, grep, find, wc, env, json, log, deps, summary, format, local_llm

src/cmds/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Each subdirectory has its own README with file descriptions, parsing strategies,
3030
- **[`js/`](js/README.md)** — npm, pnpm, vitest, lint, tsc, next, prettier, playwright, prisma — Package manager auto-detection, lint routing, cross-deps with python
3131
- **[`python/`](python/README.md)** — ruff, pytest, mypy, pip — JSON check vs text format, state machine parsing, uv auto-detection
3232
- **[`go/`](go/README.md)** — go test/build/vet, golangci-lint — NDJSON streaming, Go sub-enum pattern
33-
- **[`java/`](java/README.md)** — mvn/mvnw — State-machine test parser, Surefire/Failsafe XML enrichment, checkstyle compaction, dependency:tree collapsing
33+
- **[`jvm/`](jvm/README.md)** — mvn/mvnw/mvnd, gradlew — State-machine test parser, Surefire/Failsafe XML enrichment, checkstyle compaction, dependency:tree collapsing
3434
- **[`dotnet/`](dotnet/README.md)** — dotnet, binlog, trx, format_report — DotnetCommands sub-enum, internal helper modules
3535
- **[`cloud/`](cloud/README.md)** — aws, docker/kubectl, curl, wget, psql — Docker/Kubectl sub-enums, JSON forced output
3636
- **[`system/`](system/README.md)** — ls, tree, read, grep, find, wc, env, json, log, deps, summary, format, smart — format_cmd routing, filter levels, language detection

src/cmds/java/mod.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java Ecosystem
1+
# JVM Ecosystem (Maven, Gradle)
22

33
> Part of [`src/cmds/`](../README.md) — see also [docs/contributing/TECHNICAL.md](../../../docs/contributing/TECHNICAL.md)
44
@@ -17,6 +17,7 @@
1717
- Routing via Clap sub-enum with `#[command(external_subcommand)] Other` for unknown goals; compile-like and checkstyle goals received as `Other` are auto-re-dispatched by `route_goal` to the right filter
1818
- **Multi-goal chains** (≥2 goals, e.g. `mvn clean test-compile checkstyle:check`, `mvn clean verify`, `mvn clean install`): a signal-aware filter splits output by Maven plugin boundary markers, runs each segment group through its matching single-goal filter, and always preserves the BUILD signal — all `[ERROR]` lines, `BUILD SUCCESS`/`BUILD FAILURE` + `Total time`, per-module test counts, checkstyle violation counts, and (on failure) the Reactor Summary failing module. `-q`/`--quiet` is automatically stripped in multi-goal mode so rtk receives full output and does the compression itself. When the chain includes `test`/`verify`/`install`, surefire/failsafe XML enrichment applies exactly as for single-goal `verify`.
1919
- **0 goals** (e.g. `mvn -version`, `mvn --help`): unfiltered passthrough
20+
- **gradlew_cmd.rs** handles Gradle Wrapper (`gradlew`) command output
2021

2122
## Output enrichment from Surefire/Failsafe XML reports
2223

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Preamble -> Testing -> Summary -> Done.
55
//! Strips thousands of noise lines to compact failure reports (99%+ savings).
66
7-
use crate::cmds::java::surefire_reports::{self, FailureKind, SurefireResult, TestFailure, TestSummary};
7+
use crate::cmds::jvm::surefire_reports::{self, FailureKind, SurefireResult, TestFailure, TestSummary};
88
use crate::core::runner;
99
use crate::core::tracking;
1010
use crate::core::utils::{exit_code_from_status, resolved_command, strip_ansi, truncate};
@@ -291,7 +291,7 @@ fn run_tests_like(
291291
eprintln!("rtk {binary}: could not determine cwd: {e}");
292292
std::path::PathBuf::from(".")
293293
});
294-
let app_pkgs = crate::cmds::java::pom_groupid::detect(&cwd);
294+
let app_pkgs = crate::cmds::jvm::pom_groupid::detect(&cwd);
295295

296296
let cwd_for_filter = cwd.clone();
297297

@@ -720,7 +720,7 @@ fn run_multi_goal(binary: MvnBinary, args: &[String], verbose: u8) -> Result<i32
720720
eprintln!("rtk {binary}: could not determine cwd: {e}");
721721
std::path::PathBuf::from(".")
722722
});
723-
let app_pkgs = crate::cmds::java::pom_groupid::detect(&cwd);
723+
let app_pkgs = crate::cmds::jvm::pom_groupid::detect(&cwd);
724724
let enrich = chain_runs_tests(&goals);
725725
let test_goal = if goals.iter().any(|g| g == "verify" || g == "integration-test") {
726726
"verify"

src/cmds/java/snapshots/rtk__cmds__java__mvn_cmd__tests__filter_mvn_multi_compile_failure.snap renamed to src/cmds/jvm/snapshots/rtk__cmds__jvm__mvn_cmd__tests__filter_mvn_multi_compile_failure.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: src/cmds/java/mvn_cmd.rs
2+
source: src/cmds/jvm/mvn_cmd.rs
33
expression: output
44
---
55
mvn clean test-compile checkstyle:check (multi-goal)

src/cmds/java/snapshots/rtk__cmds__java__mvn_cmd__tests__filter_mvn_multi_success.snap renamed to src/cmds/jvm/snapshots/rtk__cmds__jvm__mvn_cmd__tests__filter_mvn_multi_success.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: src/cmds/java/mvn_cmd.rs
2+
source: src/cmds/jvm/mvn_cmd.rs
33
expression: output
44
---
55
mvn clean test-compile checkstyle:check (multi-goal)

src/cmds/java/snapshots/rtk__cmds__java__mvn_cmd__tests__filter_mvn_multi_verify_failure_stdout.snap renamed to src/cmds/jvm/snapshots/rtk__cmds__jvm__mvn_cmd__tests__filter_mvn_multi_verify_failure_stdout.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: src/cmds/java/mvn_cmd.rs
2+
source: src/cmds/jvm/mvn_cmd.rs
33
expression: output
44
---
55
mvn clean verify (multi-goal)

src/cmds/java/snapshots/rtk__cmds__java__mvn_cmd__tests__snapshot_checkstyle_violations.snap renamed to src/cmds/jvm/snapshots/rtk__cmds__jvm__mvn_cmd__tests__snapshot_checkstyle_violations.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: src/cmds/java/mvn_cmd.rs
2+
source: src/cmds/jvm/mvn_cmd.rs
33
expression: output
44
---
55
There are 4 errors reported by Checkstyle 13.3.0 with checkstyle.xml ruleset.

0 commit comments

Comments
 (0)