com.dipien.byebyejetifier.common.AbstractTask.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bye-bye-jetifier Show documentation
Show all versions of bye-bye-jetifier Show documentation
Gradle Plugin to verify if you can keep Android Jetifier disabled
package com.dipien.byebyejetifier.common
import com.dipien.byebyejetifier.ByeByeJetifierGradlePlugin
import com.dipien.byebyejetifier.ByeByeJetifierExtension
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction
abstract class AbstractTask : DefaultTask() {
@get:Input
var verbose = false
@TaskAction
fun doExecute() {
LoggerHelper.logger = logger
LoggerHelper.verbose = verbose
onExecute()
}
@Internal
protected fun getExtension(): ByeByeJetifierExtension {
return project.extensions.getByName(ByeByeJetifierGradlePlugin.EXTENSION_NAME) as ByeByeJetifierExtension
}
protected abstract fun onExecute()
}