io.github.lyxnx.gradle.android.internal.Android.kt Maven / Gradle / Ivy
package io.github.lyxnx.gradle.android.internal
import com.android.build.api.dsl.CommonExtension
import com.android.build.api.variant.AndroidComponentsExtension
import io.github.lyxnx.gradle.android.AndroidOptions
import io.github.lyxnx.gradle.kotlin.KotlinTestOptions
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.getByName
internal typealias AndroidCommonExtension = CommonExtension<*, *, *, *, *>
internal fun Project.android(configure: T.() -> Unit) {
extensions.configure("android", configure)
}
@JvmName("androidComponentsCommon")
internal fun Project.androidComponents(configure: AndroidComponentsExtension<*, *, *>.() -> Unit) {
androidComponents>(configure)
}
internal fun > Project.androidComponents(configure: T.() -> Unit) {
extensions.configure("androidComponents", configure)
}
internal val AndroidOptions.test: KotlinTestOptions
get() = (this as ExtensionAware).extensions.getByName(KotlinTestOptions.NAME)