106 lines
2.6 KiB
Kotlin
106 lines
2.6 KiB
Kotlin
import org.gradle.api.JavaVersion
|
|
import com.android.build.gradle.LibraryExtension
|
|
import com.android.build.gradle.AppExtension
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
buildscript {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
configurations.all {
|
|
resolutionStrategy.eachDependency {
|
|
if (requested.group == "org.ow2.asm" && requested.name == "asm-util") {
|
|
useVersion("9.6")
|
|
because("jcenter is deprecated, using mavenCentral version")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
tasks.withType<JavaCompile> {
|
|
sourceCompatibility = "17"
|
|
targetCompatibility = "17"
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType<JavaCompile> {
|
|
sourceCompatibility = "17"
|
|
targetCompatibility = "17"
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
afterEvaluate {
|
|
tasks.withType<JavaCompile> {
|
|
sourceCompatibility = "17"
|
|
targetCompatibility = "17"
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
}
|
|
|
|
if (plugins.hasPlugin("com.android.library") || plugins.hasPlugin("com.android.application")) {
|
|
extensions.findByType<com.android.build.gradle.LibraryExtension>()?.apply {
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
extensions.findByType<com.android.build.gradle.AppExtension>()?.apply {
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
val newBuildDir: Directory =
|
|
rootProject.layout.buildDirectory
|
|
.dir("../../build")
|
|
.get()
|
|
rootProject.layout.buildDirectory.value(newBuildDir)
|
|
|
|
subprojects {
|
|
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
|
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
|
}
|
|
|
|
subprojects {
|
|
project.evaluationDependsOn(":app")
|
|
}
|
|
|
|
tasks.register<Delete>("clean") {
|
|
delete(rootProject.layout.buildDirectory)
|
|
}
|