Files
Amber/build.gradle
T
greenart7c3 e4f44b43af Update build configuration to follow modern Gradle and Kotlin DSL syntax
- Update `settings.gradle` and `app/build.gradle` to use assignment operators for properties like `url`, `namespace`, `useSupportLibrary`, and `buildFeatures`.
- Migrate from `kotlinOptions` to `compilerOptions` in `build.gradle`.
- Update Kotlin compiler argument handling to use `freeCompilerArgs.addAll` instead of list concatenation.
2026-01-28 17:10:13 -03:00

49 lines
1.8 KiB
Groovy

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.kotlin.ksp) version(libs.versions.ksp) apply false
alias(libs.plugins.gradle.ktlint) version(libs.versions.ktlint) apply false
}
tasks.register('installGitHook', Copy) {
from new File(rootProject.rootDir, 'git-hooks/pre-commit')
from new File(rootProject.rootDir, 'git-hooks/pre-push')
into { new File(rootProject.rootDir, '.git/hooks') }
filePermissions {
unix(0b111_111_111)
}
}
project(":app") {
tasks.matching { it.name == "preBuild" }.configureEach {
dependsOn(rootProject.tasks.named("installGitHook"))
}
}
subprojects {
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
def buildDirPath = project.layout.buildDirectory.get().asFile.absolutePath
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
buildDirPath + "/compose_compiler"
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
buildDirPath + "/compose_compiler"
)
}
}
}
}