Browse Source

Create temp file in user.dir (PR 4590).

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

+ 4
- 2
src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -401,7 +401,9 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
if (Commandline.toString(args).length() > 4096) {
PrintWriter out = null;
try {
tmpFile = fileUtils.createTempFile("jikes", "", null);
String userDirName = System.getProperty("user.dir");
File userDir = new File(userDirName);
tmpFile = fileUtils.createTempFile("jikes", "", userDir);
out = new PrintWriter(new FileWriter(tmpFile));
for (int i = firstFileName; i < args.length; i++) {
out.println(args[i]);
@@ -409,7 +411,7 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
out.flush();
commandArray = new String[firstFileName+1];
System.arraycopy(args, 0, commandArray, 0, firstFileName);
commandArray[firstFileName] = "@" + tmpFile.getAbsolutePath();
commandArray[firstFileName] = "@" + tmpFile;
} catch (IOException e) {
throw new BuildException("Error creating temporary file", e, location);
} finally {


Loading…
Cancel
Save