Refine search
Commandline cli = new Commandline(); cli.setExecutable( executable );
Commandline commandLine = new Commandline(); commandLine.setExecutable(executable.getAbsolutePath()); Collection<String> args = getArguments(); for (String arg : args) { Arg _arg = commandLine.createArg(); _arg.setValue(arg); } WriterStreamConsumer systemOut = new WriterStreamConsumer(console); WriterStreamConsumer systemErr = new WriterStreamConsumer(console); returnCode = CommandLineUtils.executeCommandLine(commandLine, systemOut, systemErr, 10); if (returnCode != 0) { // bad } else { // good }
private static void composeCommand( File workingDirectory, String command, Commandline cl ) { Settings settings = GitUtil.getSettings(); cl.setExecutable( settings.getGitCommand() ); cl.createArg().setValue( command ); if ( workingDirectory != null ) { cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); } }
Commandline cl = new Commandline(); cl.setExecutable( COMMAND_CLASS ); cl.createArg().setValue( TASK_CLASS ); CommandLineBuilder builder = new CommandLineBuilder( "macker" ); for ( Iterator/*<String>*/it = options.iterator(); it.hasNext(); ) { builder.addArg( (String) it.next() ); } builder.saveArgs(); String commandsFile = builder.getCommandLineFile(); cl.createArg().setValue( commandsFile ); StringStreamConsumer stdout = new StringStreamConsumer(); StringStreamConsumer stderr = new StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr );
protected void executable( File file ) throws CommandLineException, IOException { if ( Os.isFamily( "unix" ) ) { Commandline cli = new Commandline(); cli.setExecutable( "chmod" ); cli.createArgument().setValue( "+x" ); cli.createArgument().setValue( file.getAbsolutePath() ); cli.execute(); } }
protected Commandline createUpdateConfigSpecCommandLine( File workingDirectory, File configSpecLocation, String viewName ) { Commandline command = new Commandline(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "setcs" ); command.createArg().setValue( "-tag" ); command.createArg().setValue( viewName ); command.createArg().setValue( configSpecLocation.getAbsolutePath() ); return command; }
commandline = new Commandline(); if ( customShell != null ) commandline.setExecutable( executable );
Commandline cl = new Commandline(); cl.setExecutable( "dir" ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); cl.createArg().setValue( "/S" ); StreamConsumer consumer = new StreamConsumer() { public void consumeLine( String line ) { //do something with the line } }; StreamConsumer stderr = new StreamConsumer() { public void consumeLine( String line ) { //do something with the line } }; int exitCode; try { exitCode = CommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { //handle exception }
private static void composeCommand( File workingDirectory, String command, Commandline cl ) { Settings settings = GitUtil.getSettings(); cl.setExecutable( settings.getGitCommand() ); cl.createArg().setValue( command ); if ( workingDirectory != null ) { cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); } }
public Commandline createCommandLine( ScmFileSet fileSet ) throws ScmException { Commandline cl = new Commandline(); cl.setExecutable( "cvs" ); cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); cl.createArgument().setValue( "-f" ); // don't use ~/.cvsrc cl.createArgument().setValue( "-n" ); cl.createArgument().setValue( "-q" ); cl.createArgument().setValue( "update" ); cl.createArgument().setValue( "-d" ); return cl; } }
public static Commandline createCommandLine( File workingDirectory, String filename ) { Commandline command = new Commandline(); command.setWorkingDirectory( workingDirectory ); command.setExecutable( "tfpt" ); command.createArg().setValue( "annotate" ); command.createArg().setValue( "/noprompt" ); command.createArg().setValue( filename ); return command; } }
private Commandline createCommandLine() { final Commandline commandline = new Commandline(); commandline.setExecutable(phantomjs); return commandline; }
protected Commandline createUpdateConfigSpecCommandLine( File workingDirectory, File configSpecLocation, String viewName ) { Commandline command = new Commandline(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "setcs" ); command.createArg().setValue( "-tag" ); command.createArg().setValue( viewName ); command.createArg().setValue( configSpecLocation.getAbsolutePath() ); return command; }
private Commandline createCommandLine() { final Commandline commandline = new Commandline(); commandline.setExecutable(phantomjs); final ArrayList<String> arguments = new ArrayList<>(); arguments.add("--debug=" + String.valueOf(phantomjsDebug)); arguments.add("--web-security=" + String.valueOf(phantomjsWebSecurity)); arguments.add(testRunner); arguments.add(testPageUrl); arguments.add(testResultFilename); arguments.add(String.valueOf(phantomjsResourceTimeout)); commandline.addArguments(arguments.toArray(new String[arguments.size()])); return commandline; }
public static Commandline createCommandLine( File workingDirectory, String filename ) { Commandline command = new Commandline(); command.setWorkingDirectory( workingDirectory ); command.setExecutable( "tfpt" ); command.createArg().setValue( "annotate" ); command.createArg().setValue( "/noprompt" ); command.createArg().setValue( filename ); return command; } }
@Override public Commandline createCommandLine( String executable ) throws MavenExecutorException { Commandline commandline = new Commandline(); commandline.setExecutable( executable ); try { commandline.addSystemEnvironment(); } catch ( Exception e ) { throw new MavenExecutorException( e.getMessage(), e ); } return commandline; } }
private static Commandline createNewLabelCommandLine( ScmFileSet scmFileSet, String tag ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mklbtype" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( tag ); return command; } }
static Commandline buildCmd( File workingDir, String[] cmdAndArgs ) throws ScmException { Commandline cmd = new Commandline(); cmd.setExecutable( BazaarConstants.EXEC ); cmd.setWorkingDirectory( workingDir.getAbsolutePath() ); cmd.addArguments( cmdAndArgs ); if ( !workingDir.exists() ) { boolean success = workingDir.mkdirs(); if ( !success ) { String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir; throw new ScmException( msg ); } } return cmd; }
public static Commandline createCheckinCurrentDirCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "ci" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( "." ); return command; }
private static Commandline buildPythonCmd( File workingDir, String[] cmdAndArgs ) throws ScmException { Commandline cmd = new Commandline(); cmd.setExecutable( PYTHON_EXEC ); cmd.setWorkingDirectory( workingDir.getAbsolutePath() ); cmd.addArguments( cmdAndArgs ); if ( !workingDir.exists() ) { boolean success = workingDir.mkdirs(); if ( !success ) { String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir; throw new ScmException( msg ); } } return cmd; }