Enable project isolation

Fixes https://github.com/android/nowinandroid/issues/1842
pull/2002/head
Aurimas Liutikas 1 month ago
parent fc7eaf5384
commit d3598a397d

@ -47,9 +47,6 @@ jobs:
- name: Check build-logic
run: ./gradlew :build-logic:convention:check
- name: Check spotless
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
- name: Check Dependency Guard
id: dependencyguard_verify
continue-on-error: true

@ -17,10 +17,16 @@
import com.google.samples.apps.nowinandroid.configureGraphTasks
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.configuration.BuildFeatures
import javax.inject.Inject
abstract class RootPlugin : Plugin<Project> {
@get:Inject abstract val buildFeatures: BuildFeatures
class RootPlugin : Plugin<Project> {
override fun apply(target: Project) {
require(target.path == ":")
target.subprojects { configureGraphTasks() }
if (!buildFeatures.isolatedProjects.active.orElse(false).get()) {
target.subprojects { configureGraphTasks() }
}
}
}

@ -17,7 +17,7 @@
# - CodeCache normally defaults to a very small size. Increasing it from platform defaults of 32-48m
# because of how many classes can be loaded into memory and then cached as native compiled code
# for a small speed boost.
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx4g -Xms4g
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
# For more information about how Kotlin Daemon memory options were chosen:
# - Kotlin JVM args only inherit Xmx, ReservedCodeCache, and MaxMetaspace. Since we are specifying
@ -44,6 +44,8 @@ org.gradle.configuration-cache.parallel=true
# to generate the Configuration Cache regardless of incompatible tasks.
# See https://github.com/android/nowinandroid/issues/1022 before using it.
org.gradle.configuration-cache.problems=warn
org.gradle.unsafe.isolated-projects=true
ksp.project.isolation.enabled=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK

Loading…
Cancel
Save