45 lines
1.3 KiB
Kotlin
45 lines
1.3 KiB
Kotlin
import com.android.build.api.dsl.LibraryExtension
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
import org.gradle.api.tasks.compile.JavaCompile
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
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")
|
|
plugins.withId("com.android.library") {
|
|
extensions.configure<LibraryExtension> {
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
}
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
sourceCompatibility = JavaVersion.VERSION_17.toString()
|
|
targetCompatibility = JavaVersion.VERSION_17.toString()
|
|
}
|
|
tasks.withType<KotlinCompile>().configureEach {
|
|
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
|
|
}
|
|
}
|
|
|
|
tasks.register<Delete>("clean") {
|
|
delete(rootProject.layout.buildDirectory)
|
|
}
|