refactor(gradle): remove cross-project config to prepare for Isolated Projects#971
Merged
bmc08gt merged 1 commit intoJun 24, 2026
Conversation
… 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 isolatedgradle.lifecycle.beforeProject { }hook in settings.gradle.kts.dependencies { subprojects.forEach { kover(subproject) } }-> explicitkover(project(...))edges (an IP-allowed dependency edge).flipcashTestDebugwiring viasubprojects { afterEvaluate { rootProject.tasks... } }->dependsOnon static, lazily-resolved task paths (testDebugUnitTestfor Android modules,testfor JVM modules).Because the root may no longer enumerate
subprojectsunder 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.