All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cleveradssolutions.gradleplugin.CASResourceTask.kt Maven / Gradle / Ivy

Go to download

CAS Gradle Plugin provides an easy way to integrate and configure CAS.AI Mediation in your android project.

There is a newer version: 3.9.4
Show newest version
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:Input
    abstract val projectName: Property

    @get:OutputFile
    abstract val casLinkFile: RegularFileProperty

    @TaskAction
    fun action() {
        val moduleType = if (usedAppExtension.get()) "Application"
        else "Library"
        logger.lifecycle(
            "${BuildConfig.TAG} apply version ${BuildConfig.VERSION} to {} ({}) with CAS Id: {}",
            projectName, moduleType, casId
        )
        CASSettings.tryRefreshCASSettings(logger, casId.get(), casLinkFile.asFile.get())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy