flair.gradle.tasks.variantFactories.UninstallTaskFactory.groovy Maven / Gradle / Ivy
package flair.gradle.tasks.variantFactories
import flair.gradle.tasks.TaskDefinition
import flair.gradle.tasks.Uninstall
import flair.gradle.variants.Variant
import org.gradle.api.Project
/**
* @author SamYStudiO ( [email protected] )
*/
public class UninstallTaskFactory implements IVariantTaskFactory
{
public Uninstall create( Project project , Variant variant )
{
String name = TaskDefinition.UNINSTALL.name + variant.getNameWithType( Variant.NamingTypes.CAPITALIZE )
Uninstall t = project.tasks.findByName( name ) as Uninstall
if( !t ) t = project.tasks.create( name , Uninstall )
t.group = TaskDefinition.UNINSTALL.group.name
t.variant = variant
return t
}
}