Browse Source

debug=false breaks Symantec compiler

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277727 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
b8c3a33e2c
3 changed files with 29 additions and 4 deletions
  1. +3
    -0
      WHATSNEW
  2. +16
    -2
      src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  3. +10
    -2
      src/main/org/apache/tools/ant/taskdefs/compilers/Sj.java

+ 3
- 0
WHATSNEW View File

@@ -337,6 +337,9 @@ Fixed bugs:
* NPE when when <presetdef> tries to configure a task that
cannot be instantiated. Bugzilla Report 33689.

* <javac debug="false"> created an invalid command line when running
the Symantec Java compiler.

Changes from Ant 1.6.1 to Ant 1.6.2
===================================



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

@@ -276,8 +276,8 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
} else {
cmd.createArgument().setValue("-g");
}
} else if (!assumeJava11()) {
cmd.createArgument().setValue("-g:none");
} else if (getNoDebugArgument() != null) {
cmd.createArgument().setValue(getNoDebugArgument());
}
if (optimize) {
cmd.createArgument().setValue("-O");
@@ -608,5 +608,19 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
}
return bp.concatSystemBootClasspath("ignore");
}

/**
* The argument the compiler wants to see if the debug attribute
* has been set to false.
*
* <p>A return value of <code>null</code> means no argument at all.</p>
*
* @return "-g:none" unless we expect to invoke a JDK 1.1 compiler.
*
* @since Ant 1.6.3
*/
protected String getNoDebugArgument() {
return assumeJava11() ? null : "-g:none";
}
}


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

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2004 The Apache Software Foundation
* Copyright 2001-2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,14 @@ public class Sj extends DefaultCompilerAdapter {
executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
}


/**
* Returns null since sj either has -g for debug=true or no
* argument at all.
*
* @since Ant 1.6.3
*/
protected String getNoDebugArgument() {
return null;
}
}


Loading…
Cancel
Save