com.cleveradssolutions.gradleplugin.CASResourceTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugin Show documentation
Show all versions of gradle-plugin Show documentation
CAS Gradle Plugin provides an easy way to integrate and configure CAS.AI Mediation in your android project.
package com.cleveradssolutions.gradleplugin
import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import org.gradle.api.provider.Property
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.OutputFile
@CacheableTask
abstract class CASResourceTask : DefaultTask() {
// 'is' prefix not allowed
@get:Input
abstract val usedAppExtension: Property
@get:Input
abstract val casId: Property
@get:OutputFile
abstract val casLinkFile: RegularFileProperty
@TaskAction
fun action() {
val moduleType = if (usedAppExtension.get()) "Application"
else "Library"
project.logger.lifecycle(
"${BuildConfig.TAG} apply version ${BuildConfig.VERSION} to {} ({}) with CAS Id: {}",
project.name, moduleType, casId
)
CASSettings.tryRefreshCASSettings(project, casId.get(), casLinkFile.asFile.get())
}
}