com.bugsnag.android.gradle.internal.VariantTaskCompanion.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bugsnag-android-gradle-plugin Show documentation
Show all versions of bugsnag-android-gradle-plugin Show documentation
Gradle plugin to automatically upload ProGuard mapping files to Bugsnag.
package com.bugsnag.android.gradle.internal
import com.android.build.api.variant.VariantOutput
import com.android.build.api.variant.impl.VariantOutputImpl
import com.android.build.gradle.api.BaseVariantOutput
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskProvider
internal interface VariantTaskCompanion {
fun taskNameFor(variantOutputName: String): String
fun taskNameFor(output: BaseVariantOutput): String = taskNameFor(output.name)
fun taskNameFor(output: VariantOutput): String =
taskNameFor((output as VariantOutputImpl).baseName)
}
internal inline fun VariantTaskCompanion.register(
project: Project,
output: BaseVariantOutput,
noinline configure: T.() -> Unit
) = project.tasks.register(taskNameFor(output), configure)
internal inline fun VariantTaskCompanion.register(
project: Project,
output: VariantOutput,
noinline configure: T.() -> Unit
) = project.tasks.register(taskNameFor(output), configure)
internal inline fun VariantTaskCompanion.forBuildOutput(
project: Project,
output: BaseVariantOutput
): TaskProvider {
return project.tasks
.withType(T::class.java)
.named(taskNameFor(output))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy