Commits
Tarun Sukhani authored 2332bbed1aa
feat: framework-bundled modules via play1 { modules(...) } DSL (PF-90)
Phase 6 of PF-90, redesigned around Option B (decided with user
mid-phase):
This fork's release pipeline produces ONE giant play-X.Y.Z.zip via
ant package, not individual module zips. Original PF-90 plan
(individual module zips published to GitHub Releases for apps to
resolve via Ivy patternLayout) was solving a problem this fork
doesn't have -- 3 internal apps, only framework-bundled modules
(docviewer, secure, crud, testrunner). So Phase 6 takes the simpler
path: reference framework-bundled modules directly from
<frameworkPath>/modules/<name>/.
What landed:
- Play1Extension.modules: ListProperty<String> + a vararg
modules(vararg names) helper so consumers can write
play1 { modules("docviewer", "secure") }.
- ExtractPlayModulesTask gains a frameworkModules ConfigurableFileCollection
input alongside the existing moduleZips. The @TaskAction now copies
each framework-bundled module dir into modules/<name>/ in addition
to extracting any Ivy-resolved zips. Extracted helper extractTo()
to share the wipe-then-copy logic.
- /opt/play1/build.gradle.kts: playNewApp now deletes
conf/dependencies.yml from the scaffold (Python-era artifact;
the Gradle plugin owns module declarations now).
- framework/src/play/Play.java loadModules: when
DependenciesManager.retrieveModules() returns empty (i.e.,
no conf/dependencies.yml or it lists no modules), fall back to
the directory listing of modules/. Conservative -- only fires
when the existing logic returned nothing, so apps with a real
dependencies.yml are unaffected. Required for Gradle-managed apps
which don't ship a dependencies.yml.
Phase 2's playModule Ivy-resolution machinery stays as the
"advanced" path (third-party modules from external repos). Currently
unused by this fork's apps but harmless to keep.
Verified end-to-end: scaffolded fresh app, added
play1 { modules("docviewer", "secure") }, ran extractPlayModules
which copied both module dirs from /opt/play1/modules/ into
/tmp/playPhase6-verify/modules/. Then rebuilt the framework jar
(ant jar) so Play.java change took effect, and gradle playRun
booted with both modules loaded:
Module secure is available (.../modules/secure)
Module docviewer is available (.../modules/docviewer)
Application 'ph6' is now started !
Note: this is the first framework Java source change in PF-90.
Justified because: (1) the change is conservative (only triggers
in the empty-result path), (2) it reflects the new architecture
where the Gradle plugin owns module population without needing a
dependencies.yml stub.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>