sh.christian.aaraar.gradle.agp.Agp7AndroidVariant.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agp-compat-agp7 Show documentation
Show all versions of agp-compat-agp7 Show documentation
Compatibility layer for interacting with AGP 7.
The newest version!
package sh.christian.aaraar.gradle.agp
import com.android.build.api.artifact.SingleArtifact
import com.android.build.api.variant.LibraryVariant
import org.gradle.api.Task
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.TaskProvider
internal class Agp7AndroidVariant(
private val variant: LibraryVariant,
) : AndroidVariant {
override val variantName: String = variant.name
override val buildType: String? = variant.buildType
override val packaging: AndroidPackaging = Agp7AndroidPackaging(variant.packaging)
override fun registerAarTransform(
task: TaskProvider,
inputAar: (T) -> RegularFileProperty,
outputAar: (T) -> RegularFileProperty,
) {
variant.artifacts
.use(task)
.wiredWithFiles(inputAar, outputAar)
.toTransform(SingleArtifact.AAR)
}
}