Skip to content

Commit 6eec19d

Browse files
committed
Enable project isolation
Fixes #1842
1 parent f49e673 commit 6eec19d

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/Build.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ jobs:
4747
- name: Check build-logic
4848
run: ./gradlew :build-logic:convention:check
4949

50-
- name: Check spotless
51-
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
52-
5350
- name: Check Dependency Guard
5451
id: dependencyguard_verify
5552
continue-on-error: true

build-logic/convention/src/main/kotlin/RootPlugin.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
import com.google.samples.apps.nowinandroid.configureGraphTasks
1818
import org.gradle.api.Plugin
1919
import org.gradle.api.Project
20+
import org.gradle.api.configuration.BuildFeatures
21+
import javax.inject.Inject
22+
23+
abstract class RootPlugin : Plugin<Project> {
24+
@get:Inject abstract val buildFeatures: BuildFeatures
2025

21-
class RootPlugin : Plugin<Project> {
2226
override fun apply(target: Project) {
2327
require(target.path == ":")
24-
target.subprojects { configureGraphTasks() }
28+
if (!buildFeatures.isolatedProjects.active.orElse(false).get()) {
29+
target.subprojects { configureGraphTasks() }
30+
}
2531
}
2632
}

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# - CodeCache normally defaults to a very small size. Increasing it from platform defaults of 32-48m
1818
# because of how many classes can be loaded into memory and then cached as native compiled code
1919
# for a small speed boost.
20-
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx4g -Xms4g
20+
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx4g -Xms4g -Dorg.gradle.internal.isolated-projects.parallel=false
2121

2222
# For more information about how Kotlin Daemon memory options were chosen:
2323
# - Kotlin JVM args only inherit Xmx, ReservedCodeCache, and MaxMetaspace. Since we are specifying
@@ -44,6 +44,8 @@ org.gradle.configuration-cache.parallel=true
4444
# to generate the Configuration Cache regardless of incompatible tasks.
4545
# See https://github.com/android/nowinandroid/issues/1022 before using it.
4646
org.gradle.configuration-cache.problems=warn
47+
org.gradle.unsafe.isolated-projects=true
48+
ksp.project.isolation.enabled=true
4749

4850
# AndroidX package structure to make it clearer which packages are bundled with the
4951
# Android operating system, and which are packaged with your app"s APK

gradle/wrapper/gradle-wrapper.jar

176 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
3+
distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)