adamsaghy opened a new pull request, #6501:
URL: https://github.com/apache/fineract/pull/6501
## Description
Enables the Gradle configuration cache
(`org.gradle.configuration-cache=true`) for local builds. It had been disabled
with a "temporarily disabled until we fix compatibility" note. CI keeps it off,
because fresh runners using `--no-daemon` gain nothing from it.
Local development loops (compiling, module tests, the client modules, the
quality checks, `bootRun`/`devRun`) now store the configuration cache and reuse
it, including from a fresh daemon. A warm rebuild of
`:fineract-provider:compileJava` goes from about 19s to about 1s.
### Build-script fixes for the configuration cache
- `static-weaving.gradle`: the managed-class lookup is now a lazy provider,
and the helpers moved into a plain class. The old code called `Task.project`
and script methods from `doLast`.
- `fineract-provider`, `fineract-client`, `fineract-client-feign`:
`copy`/`delete`/`fileTree` in task actions now go through the injected
`FileSystemOperations`.
- `fineract-doc` `doc`, and `checkBreakingChanges.onlyIf`: values are
captured at configuration time.
- `aggregateLicenseReport`: the `rename` closure no longer captures a
`Project`.
### Plugins that cannot support it are marked
`notCompatibleWithConfigurationCache`
- jk1 license report, jib, asciidoctor, the
`fineractRelease*`/`fineractDocPublish` tasks, and the database admin tasks
(`createDB`, `createPGDB`, …).
- Builds that include these tasks fall back to running without the cache
instead of failing. A full `./gradlew build` still includes jk1 and
asciidoctor, through the binary distribution.
### Plugin replacements and upgrades
- **git-versioning replaced with `GitVersionValueSource` (buildSrc).** The
old plugin spawns git processes while the build configures. The new class ports
its logic for our configuration: release/maintenance branch and tag rules, the
ancestor walk and tag ordering, CI branch detection, `-Dgit.*` and
`VERSIONING_*` overrides, and linked worktrees. The plugin's unused `version`
task is gone.
- **Spotless 6.25.0 → 8.10.2.** 6.x fails with "JVM-local cache is stale"
when the cache is reused from a new daemon. The formatters are pinned to 4.29,
the versions 6.25 used by default on JDK 25, so no code is reformatted.
`indentWithSpaces` is replaced by `leadingTabsToSpaces`, which behaves
identically.
- **`com.github.hierynomus.license` (unmaintained since 2021) replaced with
Spotless license headers.**
- Headers are still generated from `APACHE_LICENSETEXT.md`, for Java, XML,
properties, Velocity and JSP. That's the same set of files hierynomus enforced,
plus 287 files that already had correct headers.
- `spotlessApply` adds a missing header and never rewrites anything below
one. A malformed header fails `spotlessCheck`.
- Also removed: the plugin's no-op `licenseFormatMain` wiring, and the
`spring-core:6.2.18` buildscript pin that existed only for it.
- 8 Java files had a stray blank line before the header, or a malformed
one. Each is fixed with a one-line deletion.
- **jk1 dependency-license-report 2.9 → 3.1.4** (2.x is end-of-life).
- The bundled license texts are identical.
- The per-module index pages show manifest-declared licenses more cleanly;
no dependency's license changes.
- `generateLicenseReport` now depends on the jars it reads, which fixes an
intermittent `ZipException: zip END header not found` in parallel builds.
### CI
- `.github/scripts/gradle-memory-budget.sh` writes
`org.gradle.configuration-cache=false`.
- The two workflows that don't use it pass `--no-configuration-cache`.
### Notes for reviewers
- To opt out locally, pass `--no-configuration-cache`.
- `licenseFormat`/`licenseMain` no longer exist. Use
`spotlessApply`/`spotlessCheck` instead.
- `git.properties` (actuator git info) is unaffected. It comes from
gradle-git-properties.
### Verification
- **Versions:** `GitVersionValueSource` matched the old plugin's output in
34 git scenarios, run side by side in a scratch clone. They cover develop,
release/maintenance branches, tags, commits with several tags,
GitHub/GitLab/Jenkins environments, overrides, worktrees, and shallow, empty
and missing repositories.
- **Outputs:** generated outputs are identical to develop: `persistence.xml`
(15 modules), the swagger input YAML, the generated clients, and the bundled
license texts.
- **Spotless:** repo-wide `spotlessCheck` passes with no changes. Throwaway
files confirmed that missing and malformed headers are detected and fixed, and
that nothing after a header is ever changed.
- **CI task groups, with and without the cache:** quality checks,
package/war/shadowJar, unit tests, license report/CycloneDX, doc, jib
(`jibBuildTar`), cucumber, `checkBreakingChanges`, and `devRun`/`bootRun` (dry
run).
- **Not tested:** sonar, pushing a jib image, tasks that need a database
(integration tests, e2e cucumber, `createPGDB`), and the release steps.
## Checklist
- [ ] Write the commit message as per [our
guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
- [ ] Acknowledge that we will not review PRs that are not passing the build
_("green")_ - it is your responsibility to get a proposed PR to pass the build,
not primarily the project's maintainers.
- [ ] Create/update [unit or integration
tests](https://fineract.apache.org/docs/current/#_testing) for verifying the
changes made.
- [ ] Follow our [coding
conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
- [ ] Add required Swagger annotation and update API documentation at
fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with
details of any API changes
- [ ] [This PR must not be a "code
dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit).
Large changes can be made in a branch, with assistance. Ask for help on the
[developer mailing list](https://fineract.apache.org/#contribute).
- [ ] If merging this PR resolves a JIRA issue, I will mark that issue as
resolved and set "Fix Version/s" appropriately.
- [ ] I followed the [AI
Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy).
Assisted-By: claude-opus-5.5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]