Browse Source

If 'output' is a simple or relative filename, make it relative

to ${basedir}, not ${user.dir}. (If it's a full-path, it'll go
to the full-path file.)  (PR 4548)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272144 13f79535-47bb-0310-9956-ffa450edef68
master
Diane Holt 23 years ago
parent
commit
01a69e59fe
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/main/org/apache/tools/ant/taskdefs/Ant.java

+ 7
- 2
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -104,7 +104,8 @@ public class Ant extends Task {
private String target = null;
/** the output */
private String output = null;
private String output = null;
private String outfile = null;
/** should we inherit properties from the parent ? */
private boolean inheritAll = true;
@@ -174,8 +175,12 @@ public class Ant extends Task {
}

if (output != null) {
if (dir != null) {
File file = FileUtils.newFileUtils().resolveFile(dir, output);
outfile = file.getAbsolutePath();
}
try {
PrintStream out = new PrintStream(new FileOutputStream(output));
PrintStream out = new PrintStream(new FileOutputStream(outfile));
DefaultLogger logger = new DefaultLogger();
logger.setMessageOutputLevel(Project.MSG_INFO);
logger.setOutputPrintStream(out);


Loading…
Cancel
Save