|
|
|
@ -18,7 +18,6 @@ package com.google.samples.apps.nowinandroid
|
|
|
|
|
|
|
|
|
|
import com.android.build.api.dsl.CommonExtension
|
|
|
|
|
import org.gradle.api.Project
|
|
|
|
|
import org.gradle.api.provider.Provider
|
|
|
|
|
import org.gradle.kotlin.dsl.assign
|
|
|
|
|
import org.gradle.kotlin.dsl.configure
|
|
|
|
|
import org.gradle.kotlin.dsl.dependencies
|
|
|
|
@ -52,21 +51,14 @@ internal fun Project.configureAndroidCompose(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extensions.configure<ComposeCompilerGradlePluginExtension> {
|
|
|
|
|
fun Provider<String>.onlyIfTrue() = flatMap { provider { it.takeIf(String::toBoolean) } }
|
|
|
|
|
fun Provider<*>.relativeToRootProject(dir: String) = flatMap {
|
|
|
|
|
rootProject.layout.buildDirectory.dir(projectDir.toRelativeString(rootDir))
|
|
|
|
|
}.map { it.dir(dir) }
|
|
|
|
|
|
|
|
|
|
project.providers.gradleProperty("enableComposeCompilerMetrics").onlyIfTrue()
|
|
|
|
|
.relativeToRootProject("compose-metrics")
|
|
|
|
|
.let(metricsDestination::set)
|
|
|
|
|
if (project.hasProperty("enableComposeCompilerReportsAndMetrics")) {
|
|
|
|
|
metricsDestination = relativeToRootProject("compose-metrics")
|
|
|
|
|
reportsDestination = relativeToRootProject("compose-reports")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
project.providers.gradleProperty("enableComposeCompilerReports").onlyIfTrue()
|
|
|
|
|
.relativeToRootProject("compose-reports")
|
|
|
|
|
.let(reportsDestination::set)
|
|
|
|
|
stabilityConfigurationFile =
|
|
|
|
|
rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
|
|
|
|
|
|
|
|
|
|
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
|
|
|
|
|
|
|
|
|
|
enableStrongSkippingMode = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|