Browse Source

Allow commands to be reused by clearing their arguments

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267984 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 25 years ago
parent
commit
02bf23c463
3 changed files with 22 additions and 0 deletions
  1. +8
    -0
      src/main/org/apache/tools/ant/taskdefs/Java.java
  2. +7
    -0
      src/main/org/apache/tools/ant/types/Commandline.java
  3. +7
    -0
      src/main/org/apache/tools/ant/types/CommandlineJava.java

+ 8
- 0
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -243,6 +243,8 @@ public class Java extends Task {
Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
Project.MSG_WARN),
null);
exe.setAntRun(project);

if (dir == null) dir = project.getBaseDir();
@@ -269,4 +271,10 @@ public class Java extends Task {
run(cmdj);
}

/**
* Clear out the arguments to this java task.
*/
public void clearArgs() {
cmdl.clearJavaArgs();
}
}

+ 7
- 0
src/main/org/apache/tools/ant/types/Commandline.java View File

@@ -335,4 +335,11 @@ public class Commandline implements Cloneable {
arguments.removeAllElements();
}

/**
* Clear out the arguments but leave the executable in place for another operation.
*/
public void clearArgs() {
arguments.removeAllElements();
}
}

+ 7
- 0
src/main/org/apache/tools/ant/types/CommandlineJava.java View File

@@ -160,4 +160,11 @@ public class CommandlineJava implements Cloneable {
c.vmVersion = vmVersion;
return c;
}

/**
* Clear out the java arguments.
*/
public void clearJavaArgs() {
javaCommand.clearArgs();
}
}

Loading…
Cancel
Save