|
|
@ -20,10 +20,14 @@ import com.android.build.api.dsl.CommonExtension
|
|
|
|
import org.gradle.api.JavaVersion
|
|
|
|
import org.gradle.api.JavaVersion
|
|
|
|
import org.gradle.api.Project
|
|
|
|
import org.gradle.api.Project
|
|
|
|
import org.gradle.api.artifacts.VersionCatalogsExtension
|
|
|
|
import org.gradle.api.artifacts.VersionCatalogsExtension
|
|
|
|
|
|
|
|
import org.gradle.api.plugins.ExtensionAware
|
|
|
|
|
|
|
|
import org.gradle.kotlin.dsl.configure
|
|
|
|
import org.gradle.kotlin.dsl.dependencies
|
|
|
|
import org.gradle.kotlin.dsl.dependencies
|
|
|
|
import org.gradle.kotlin.dsl.getByType
|
|
|
|
import org.gradle.kotlin.dsl.getByType
|
|
|
|
import org.gradle.kotlin.dsl.provideDelegate
|
|
|
|
import org.gradle.kotlin.dsl.provideDelegate
|
|
|
|
import org.gradle.kotlin.dsl.withType
|
|
|
|
import org.gradle.kotlin.dsl.withType
|
|
|
|
|
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
|
|
|
|
|
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -72,3 +76,16 @@ internal fun Project.configureKotlinAndroid(
|
|
|
|
add("coreLibraryDesugaring", libs.findLibrary("android.desugarJdkLibs").get())
|
|
|
|
add("coreLibraryDesugaring", libs.findLibrary("android.desugarJdkLibs").get())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
|
|
|
|
|
|
|
|
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Configure Kotlin's jvm toolchain for Android projects
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
internal fun Project.configureKotlinAndroidToolchain() {
|
|
|
|
|
|
|
|
extensions.configure<KotlinAndroidProjectExtension> {
|
|
|
|
|
|
|
|
jvmToolchain(11)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|