Commits
Tarun Sukhani authored d51197c4c38
fix(precompile): keep test tooling out of precompiled/, ship module resources in bundles Three related fixes to what `play precompile`/`bundle`/`dist` emit. 1. ApplicationClasses: exclude test/-rooted classes from precompiled/java/. Precompile still compiles test/ sources (a broken test fails the build), but their bytecode is no longer written to precompiled/java/, which is packaged into the prod artifact and force-loaded at startup (-Dprecompiled=true). Keeps test code — and its JUnit dependency — out of production. 2. Play.loadModules: skip the testrunner mount during precompile. Precompile runs in test mode, which auto-mounted testrunner and baked its controllers into precompiled/java/ and its views into precompiled/templates/. The mount is skipped when precompiling; TestRunnerPlugin still loads from play-testrunner.jar (on the classpath), so its onLoad() adds test/ to javaPath and the compile gate is preserved. 3. Play1Plugin (playBundle): ship declared modules' non-jar resources. The bundle dropped everything under modules/ except lib jars, so a module's play.plugins descriptor and public/ assets never reached the self-contained bundle and its plugin never registered at prod startup (docviewer's /@docs 404'd). The bundle now carries module play.plugins/public/conf. playDist is unaffected — it re-extracts modules via Gradle at deploy time. Verified on a fresh sample app: bundle → prod run serves /@docs (302) and a module public asset (200); /@tests absent (404); precompiled/ has no test or testrunner classes/templates; broken test still fails precompile. Framework unit tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>