Skip to content

feat: add Gradle test filter support#263

Open
yonatankarp wants to merge 1 commit intortk-ai:masterfrom
yonatankarp:feat/gradle-support
Open

feat: add Gradle test filter support#263
yonatankarp wants to merge 1 commit intortk-ai:masterfrom
yonatankarp:feat/gradle-support

Conversation

@yonatankarp
Copy link

Summary

  • Adds rtk gradle test command that filters Gradle test output, stripping task progress lines and boilerplate advice while preserving failures, test summaries, and build status (~70% token reduction)
  • Auto-detects ./gradlew wrapper when present, falls back to gradle binary
  • Unfiltered Gradle tasks (build, assemble, etc.) pass through directly
  • Hook support rewrites both gradle and ./gradlew invocations to rtk gradle in Claude Code sessions

Future work

This is the first PR for JVM ecosystem support, split to keep review size manageable. Follow-up PRs will cover filters for additional Gradle tasks (build errors, lint) and support for other JVM build tools.

Test plan

  • 18 unit tests covering filter logic, edge cases, CLI routing, and token savings
  • Hook rewrite tests for gradle, ./gradlew, and submodule variants (:app:test)
  • Smoke test entry for rtk gradle test -h
  • cargo fmt --all --check && cargo clippy --all-targets && cargo test all green

🤖 Generated with Claude Code

Add a new `rtk gradle` command that filters Gradle test output for
token-optimized consumption by LLMs. The filter strips task progress
lines (> Task :compileJava UP-TO-DATE), boilerplate advice sections
(* Try: / * Get more help), and retains only failures, test summaries,
and build status — achieving ~70% token reduction on test output.

The command auto-detects `./gradlew` wrapper when present and falls
back to `gradle`. Unfiltered tasks (build, assemble, etc.) pass
through directly. Hook support rewrites both `gradle` and `./gradlew`
invocations to `rtk gradle` in Claude Code sessions.

This is the first PR for JVM ecosystem support, split for review size.
Follow-up PRs will add filters for additional Gradle tasks (build,
lint) and Maven support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yonatankarp yonatankarp changed the title feat(gradle): add Gradle/Gradlew test filter support feat: add Gradle test filter support Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant