flair.gradle.cli.AbstractCli.groovy Maven / Gradle / Ivy
package flair.gradle.cli
import flair.gradle.variants.Platform
import org.gradle.api.Project
/**
* @author SamYStudiO ( [email protected] )
*/
public abstract class AbstractCli implements ICli
{
protected List arguments = new ArrayList( )
@Override
public List getArguments()
{
return arguments.clone( ) as List
}
@Override
public void addArgument( String arg )
{
String[] a = arg.split( "\\s" )
for( int i = 0; i < a.size( ); i++ )
{
arguments.add( a[ i ] )
}
}
@Override
public void addArguments( List args )
{
args.each { addArgument( it ) }
}
@Override
public void addArguments( String... args )
{
args.each { addArgument( it ) }
}
@Override
public void clearArguments()
{
arguments = new ArrayList( )
}
@Override
public String execute( Project project )
{
execute( project , null )
}
@Override
public abstract String execute( Project project , Platform platform )
}