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

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 )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy