Commits
Tarun Sukhani authored 6a70975ebeb
refactor: drop httpPort/playId from Play1Extension; -P is the only override (PF-90)
User feedback: build.gradle.kts is for build-system config (deps,
plugin) — not a place for runtime knobs that already live in
conf/application.conf. The DSL httpPort.set() / playId.set() escape
hatches were redundant with -PhttpPort / -PplayId and added confusion.
Removed:
- Play1Extension.httpPort and .playId fields
- The afterEvaluate -P→DSL plumbing (now read directly inside each task)
- The 8-line prose comment in the scaffold's play1 block
Each task that needed these now reads project.providers.gradleProperty()
directly at registration time:
- registerPlayJvmTask (playRun, playEvolutions): playIdOverride wins,
else -PplayId, else "". --http.port arg only added when -PhttpPort set.
- PlayStartTask, PlayRestartTask, PlayModulesInfoTask: playId from
-PplayId.orElse("") into Property; httpPort Property absent unless -P.
- PlayAutotestTask, PlayStatusTask: read -PhttpPort with conf-fallback
(unchanged — they need a port value to construct outbound URLs).
The .orElse("") on the playId provider is load-bearing — without it,
.set(absentProvider) leaves the Property with no value, and reading
playId.get() inside PlayStartTask crashes with "Cannot query the value".
Property convention() doesn't help here because explicit set() always
wins over convention.
Verified: payments (conf http.port=9009) binds 9009 by default; with
-PhttpPort=8765 binds 8765 instead, conf is ignored. Fresh playNewApp
scaffold's play1 block is now 4 lines (frameworkPath, frameworkVersion,
modules) plus a comment about docviewer.