/
build.gradle.kts
60 lines (56 loc) · 2.72 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.com.android.application) apply false
alias(libs.plugins.com.android.library) apply false
alias(libs.plugins.androidx.navigation.safeargs.kotlin) apply false
alias(libs.plugins.org.jetbrains.kotlin.android) apply false
alias(libs.plugins.org.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.org.jetbrains.kotlin.multiplatform) apply false
alias(libs.plugins.org.jetbrains.compose) apply false
alias(libs.plugins.mavenpublish) apply false
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
allprojects {
/**
* publish config
*/
if (hasProperty("signing.keyId") // configured in the ~/.gradle/gradle.properties file
&& hasProperty("signing.password") // configured in the ~/.gradle/gradle.properties file
&& hasProperty("signing.secretKeyRingFile") // configured in the ~/.gradle/gradle.properties file
&& hasProperty("mavenCentralUsername") // configured in the ~/.gradle/gradle.properties file
&& hasProperty("mavenCentralPassword") // configured in the ~/.gradle/gradle.properties file
&& hasProperty("versionName") // configured in the rootProject/gradle.properties file
&& hasProperty("GROUP") // configured in the rootProject/gradle.properties file
&& hasProperty("POM_ARTIFACT_ID") // configured in the project/gradle.properties file
) {
apply { plugin("com.vanniktech.maven.publish") }
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
version = property("versionName").toString()
}
}
}
/**
* Run the `./gradlew assembleRelease -PcomposeCompilerReports=true` command to generate a report,
* which is located in the `project/module/build/compose_compiler` directory.
*
* Interpretation of the report: https://developer.android.com/jetpack/compose/performance/stability/diagnose#kotlin
*/
subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
// Enable Compose Compiler Report
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_compiler"
)
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_compiler"
)
}
}
}
}