cli.setWorkingDirectory( workingDirectory.getAbsolutePath() );
if ( workingDirectory != null && workingDirectory.exists() ) commandline.setWorkingDirectory( workingDirectory.getAbsolutePath() );
private void setWorkingDirectory( File basedir ) { // TODO raise bug against plexus. Null is OK for working directory // but once set to not-null cannot be set back to null! // this is a problem if the old workingdir has been deleted // probably safer to use a new commandline if ( basedir == null ) { cl.setWorkingDirectory( "." ); } cl.setWorkingDirectory( basedir ); }
private void setWorkingDirectory( File basedir ) { // TODO raise bug against plexus. Null is OK for working directory // but once set to not-null cannot be set back to null! // this is a problem if the old workingdir has been deleted // probably safer to use a new commandline if ( basedir == null ) { cl.setWorkingDirectory( "." ); } cl.setWorkingDirectory( basedir ); }
public static Commandline createCommandLine( GitScmProviderRepository repository ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( null, "ls-remote" ); cl.setWorkingDirectory( System.getProperty( "java.io.tmpdir" ) ); String remoteUrl = repository.getPushUrl(); cl.createArg().setValue( remoteUrl ); return cl; }
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() ); } }
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 void assertCommandLine( String expectedCommand, File expectedWorkingDirectory, Commandline actualCommand ) throws IOException { Commandline cl = new Commandline( expectedCommand ); if ( expectedWorkingDirectory != null ) { cl.setWorkingDirectory( expectedWorkingDirectory.getAbsolutePath() ); } String expectedCommandLineAsExecuted = StringUtils.join( cl.getShellCommandline(), " " ); String actualCommandLineAsExecuted = StringUtils.join( actualCommand.getShellCommandline(), " " ); assertEquals( expectedCommandLineAsExecuted, actualCommandLineAsExecuted ); }
private Commandline buildCommandLine() throws Exception { Commandline cli = new Commandline(); //Disable explicit quoting of arguments cli.getShell().setQuotedArgumentsEnabled(false); cli.setExecutable(java.getAbsolutePath()); cli.setWorkingDirectory(workingDirectory); addClasspath(this.argsList); argsLine(cli); return cli; }
public static Commandline createCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "update" ); command.createArg().setValue( "-f" ); return command; } }
public static Commandline createCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "update" ); command.createArg().setValue( "-f" ); return command; } }
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; }
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 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; } }
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; }
public static Commandline createCheckoutCurrentDirCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "co" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( "." ); return command; }
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; } }
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; }
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; } }
protected Commandline getCommandLine(MvnContext context) throws Exception { Commandline cl = new Commandline(); cl.setExecutable(getMvnExecutable(context.getExecutable())); cl.setWorkingDirectory(context.getBasedir()); if (context.isAddEnvironment()) { cl.addSystemEnvironment(); } addMavenOpts(context, cl); addArgs(cl, context.getArgs()); addProperties(context, cl, context.getProperties()); return cl; }