blob: 6e9e7fbe6779d56a9bda6020aa190fe0d395d7e7 [file] [log] [blame] [edit]
import org.ajoberstar.grgit.Grgit
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "com.android.tools.build" apply false
id 'net.ltgt.errorprone' apply false
id "com.google.devtools.ksp" apply false
id "org.ajoberstar.grgit" apply false
id "org.jetbrains.kotlin.jvm" apply false
id "com.vanniktech.maven.publish" apply false
id "org.jetbrains.dokka" apply false
id "androidx.baselineprofile" apply false
}
allprojects {
def compileJavaVersion = JavaVersion.VERSION_17
def targetJavaVersion = JavaVersion.VERSION_17
pluginManager.withPlugin("java") {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(compileJavaVersion.majorVersion))
}
}
tasks.withType(JavaCompile).configureEach {
options.release.set(targetJavaVersion.majorVersion)
}
}
pluginManager.withPlugin("org.jetbrains.kotlin.android") {
kotlin {
jvmToolchain(compileJavaVersion.majorVersion.toInteger())
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions.jvmTarget = targetJavaVersion.toString()
}
}
["com.android.library", "com.android.application"].forEach { androidPlugin ->
pluginManager.withPlugin(androidPlugin) {
android {
sourceCompatibility targetJavaVersion
targetCompatibility targetJavaVersion
}
}
}
}
ext {
git = Grgit.open(currentDir: project.rootDir)
gitSha = git.head().id
gitBranch = git.branch.current().name
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}