Skip to content

refactor(gradle): remove cross-project config to prepare for Isolated Projects#971

Merged
bmc08gt merged 1 commit into
code-payments:code/cashfrom
bmc08gt:build/prep-for-isolated-projects
Jun 24, 2026
Merged

refactor(gradle): remove cross-project config to prepare for Isolated Projects#971
bmc08gt merged 1 commit into
code-payments:code/cashfrom
bmc08gt:build/prep-for-isolated-projects

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Removes the three cross-project configuration patterns from the root build script that Gradle's Isolated Projects feature forbids (a project configuring other projects), without changing any build flags:

  • allprojects { } (kotlin-stdlib-jdk7 exclusion, serialization/metadata version forcing, kapt-task disabling) -> moved to an isolated gradle.lifecycle.beforeProject { } hook in settings.gradle.kts.
  • Kover dependencies { subprojects.forEach { kover(subproject) } } -> explicit kover(project(...)) edges (an IP-allowed dependency edge).
  • flipcashTestDebug wiring via subprojects { afterEvaluate { rootProject.tasks... } } -> dependsOn on static, lazily-resolved task paths (testDebugUnitTest for Android modules, test for JVM modules).

Because the root may no longer enumerate subprojects under IP, the module sets are derived once in settings.gradle.kts from the actually-included projects (filtered by path, with a small denylist for the few non-conforming modules) and handed to the root via extra properties. New modules are picked up automatically. Behavior (coverage aggregation + the aggregate test task) is preserved.

… Projects

Removes the three cross-project configuration patterns from the root build
script that Gradle's Isolated Projects feature forbids (a project configuring
other projects), without changing any build flags:

- `allprojects { }` (kotlin-stdlib-jdk7 exclusion, serialization/metadata
  version forcing, kapt-task disabling) -> moved to an isolated
  `gradle.lifecycle.beforeProject { }` hook in settings.gradle.kts.
- Kover `dependencies { subprojects.forEach { kover(subproject) } }` ->
  explicit `kover(project(...))` edges (an IP-allowed dependency edge).
- `flipcashTestDebug` wiring via `subprojects { afterEvaluate {
  rootProject.tasks... } }` -> `dependsOn` on static, lazily-resolved task
  paths (`testDebugUnitTest` for Android modules, `test` for JVM modules).

Because the root may no longer enumerate `subprojects` under IP, the module
sets are derived once in settings.gradle.kts from the actually-included
projects (filtered by path, with a small denylist for the few non-conforming
modules) and handed to the root via extra properties. New modules are picked
up automatically. Behavior (coverage aggregation + the aggregate test task)
is preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JRVfsXp4HDrDMy7Pbmw9fD
@bmc08gt bmc08gt self-assigned this Jun 24, 2026
@bmc08gt bmc08gt added type: build Build system, Gradle, dependencies area: build-system Gradle, convention plugins, build-logic labels Jun 24, 2026
@bmc08gt bmc08gt merged commit 43049ff into code-payments:code/cash Jun 24, 2026
0 of 3 checks passed
@bmc08gt bmc08gt deleted the build/prep-for-isolated-projects branch June 24, 2026 01:49
bmc08gt pushed a commit to bmc08gt/code-android-app that referenced this pull request Jun 24, 2026
Turn on org.gradle.configuration-cache and remove the now-superseded
org.gradle.configureondemand (configuration-on-demand is incompatible with
the configuration cache). Builds on the cross-project config removal from
code-payments#971, which cleared the root-script barriers to a cacheable configuration
phase.

Validated locally: full configuration of all modules succeeds with zero
configuration-cache problems, the entry is reused across runs, and a module
unit test executes and reuses the cache. Problems fail the build by default,
so CI enforces a clean configuration phase. This is also the prerequisite for
enabling Isolated Projects later.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JRVfsXp4HDrDMy7Pbmw9fD
bmc08gt pushed a commit to bmc08gt/code-android-app that referenced this pull request Jun 24, 2026
Turn on org.gradle.configuration-cache and remove the now-superseded
org.gradle.configureondemand (configuration-on-demand is incompatible with
the configuration cache). Builds on the cross-project config removal from
code-payments#971, which cleared the root-script barriers to a cacheable configuration
phase.

Validated locally: full configuration of all modules succeeds with zero
configuration-cache problems, the entry is reused across runs, and a module
unit test executes and reuses the cache. Problems fail the build by default,
so CI enforces a clean configuration phase. This is also the prerequisite for
enabling Isolated Projects later.
bmc08gt added a commit to bmc08gt/code-android-app that referenced this pull request Jun 24, 2026
Turn on org.gradle.configuration-cache and remove the now-superseded
org.gradle.configureondemand (configuration-on-demand is incompatible with
the configuration cache). Builds on the cross-project config removal from
code-payments#971, which cleared the root-script barriers to a cacheable configuration
phase.

Validated locally: full configuration of all modules succeeds with zero
configuration-cache problems, the entry is reused across runs, and a module
unit test executes and reuses the cache. Problems fail the build by default,
so CI enforces a clean configuration phase. This is also the prerequisite for
enabling Isolated Projects later.
bmc08gt added a commit that referenced this pull request Jun 24, 2026
…nd (#972)

* build(gradle): enable configuration cache, drop configuration-on-demand

Turn on org.gradle.configuration-cache and remove the now-superseded
org.gradle.configureondemand (configuration-on-demand is incompatible with
the configuration cache). Builds on the cross-project config removal from
#971, which cleared the root-script barriers to a cacheable configuration
phase.

Validated locally: full configuration of all modules succeeds with zero
configuration-cache problems, the entry is reused across runs, and a module
unit test executes and reuses the cache. Problems fail the build by default,
so CI enforces a clean configuration phase. This is also the prerequisite for
enabling Isolated Projects later.

* build(gradle): make root-dir access Isolated Projects-safe

Replace cross-project root access that Isolated Projects forbids with the
IP-safe equivalents, without changing behavior:

- compose convention plugin & app: rootProject.layout.projectDirectory ->
  isolated.rootProject.projectDirectory for the stability config file.
- ContributorsSignatory: take the root directory as a File instead of a
  Project, so callers no longer invoke Project.file on the root project.
  Path resolution is unchanged (relative against root, absolute as-is).

Verified under the configuration cache (already enabled): full configuration
succeeds with zero problems and the entry reuses cleanly. With these in place,
flipping org.gradle.unsafe.isolated-projects drops from 356 problems to a single
remaining AGP-internal access in com.android.application, which is upstream and
will clear with a future AGP that fully supports Isolated Projects. The IP flag
stays off until then.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic type: build Build system, Gradle, dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants