Commits
Tarun Sukhani authored 38a18b32583
feat: playRun task, Play1Extension, source set declarations (PF-90)
Phase 3 of PF-90. Real consumers can now boot a Play 1 app via Gradle.
- Play1Extension exposes frameworkPath (DirectoryProperty), frameworkVersion,
playId, httpPort. Consumers configure via play1 { ... } DSL block.
- Java plugin applied so we get sourceSets, compileJava, etc. -- needed
for IDE indexing via IntelliJ's Gradle import.
- Source sets remapped to Play 1 layout: main.java=app, main.resources=conf,
test.java=test. Compile classpath augmented with the framework jar,
framework lib, app lib, and modules lib so gradle build / IDE compile
succeeds. (Play's own ApplicationClassloader still does the dev-mode
recompile of app/*.java at request time -- Gradle is not on the hot
path.)
- playRun JavaExec task: --enable-native-access=ALL-UNNAMED, javaagent
pinned to play-X.Y.Z.jar from frameworkPath, classpath assembled from
conf/, framework jar, playFramework configuration, app lib, modules lib,
framework lib. System properties: application.path, play.id, play.version,
file.encoding. HTTP port via --http.port arg. standardInput=System.in
so users can Ctrl+C cleanly.
- playRun depends on extractPlayModules only -- NOT on compileJava, since
Play handles its own compilation in dev mode.
Verified end-to-end: minimal Play app at /tmp boots cleanly under
gradle playRun, HTTP request returns expected response, source edit
triggers Play's hot reload (next request returns updated text without
JVM restart). Kotlin DSL compile clean, no Gradle 10 deprecations.
Notes deferred to later phases:
- Module source roots (modules/*/app, modules/*/src) not yet declared in
source sets -- needs lazy evaluation that may interact poorly with
IntelliJ's Gradle import. Will revisit when migrating real apps.
- JPDA debug agent: use Gradle's built-in --debug-jvm flag.
- JMX, java.security.policy, -server flag, explicit memory args: deferred
(defaults / JAVA_OPTS sufficient for now).
- Phase 6 will replace the frameworkPath-based jar location with proper
Maven publishing of the framework jar with a POM declaring transitives.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>