Commits
Tarun Sukhani authored 1e6d9308e3b
feat: playTest, playPrecompile, playDist task variants (PF-90)
Phase 4 of PF-90. Three sibling tasks built on the playRun foundation
plus one new task type for ZIP packaging.
- Refactored playRun's JavaExec setup into a registerPlayJvmTask helper
that takes (playIdOverride, extraSysprops, includeHttpPort,
extraDependsOn). Eliminates duplication across the three JVM tasks.
- playTest: like playRun but forces playId=test. Conditional classpath
entry adds frameworkPath/modules/testrunner/lib/*.jar so Play's
classloader discovers play.plugins inside play-testrunner.jar and
TestRunnerPlugin registers /@tests routes via onRoutesLoaded().
Mirrors how the Python CLI's app.modules() conditionally appends
the framework's testrunner module when isTestFrameworkId(play.id).
- playPrecompileClean: Delete task that wipes tmp/ and precompiled/
before each precompile. Separate task (rather than doFirst) to
avoid Task.project access at execution time.
- playPrecompile: like playRun but playId=test, adds -Dprecompile=yes,
no http.port arg, dependsOn playPrecompileClean. JVM boots, Play
precompiles all sources/templates into precompiled/, exits.
- playDist: new PlayDistTask. Shells out to git ls-files
--cached --others --exclude-standard for the file enumeration,
reads .distignore for additional excludes, builds a zip at
dist/<projectName>.zip with files prefixed by the project name.
Mirrors framework/pym/play/commands/dist.py exactly.
outputs.upToDateWhen { false } so the task always re-runs.
Note: this fork has no `play war` and no WarBuilder in framework/src/.
Deployment uses precompile + dist (zip), per the recent
"docs: document source-free deployment via play precompile" commit.
PF-90's "playWar" was a leftover reference from upstream Play 1
conventions and was corrected to playDist.
Verified end-to-end against /tmp/play4-verify (cleaned up):
- playDist produces zip with exactly the 7 git-tracked files,
prefixed by play4-verify/, .gitignore-honored.
- playPrecompile boots, logs "Precompiling ...", "Done.", exits
cleanly with precompiled/{java,templates}/ on disk.
- playTest boots in test mode, TestRunnerPlugin loads, banner
"~ Go to http://localhost:9000/@tests to run the tests"
appears, controllers.TestRunner.index is invoked when /@tests
is hit. Full UI render needs a static-asset route in the
app's routes file (Phase 7 fixture concern).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>