Browse Source

Improved Jikes support. Added build.compiler.pedantic option for Jikes

+P flag and use JIKESPATH if set.
Submitted by:	Peter Donald <donaldp@mad.scientist.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267853 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
5e898465ac
2 changed files with 30 additions and 0 deletions
  1. +9
    -0
      src/bin/ant
  2. +21
    -0
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 9
- 0
src/bin/ant View File

@@ -58,5 +58,14 @@ else
echo " to the installation directory of java."
fi

# supply JIKESPATH to Ant as jikes.class.path
if [ "$JIKESPATH" != "" ] ; then
if [ "$ANT_OPTS" != "" ] ; then
ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
else
ANT_OPTS=-Djikes.class.path=$JIKESPATH
fi
fi

$JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.Main $@


+ 21
- 0
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -632,6 +632,12 @@ public class Javac extends MatchingTask {
// will add it to classpath.
classpath.append(src);

// if the user has set JIKESPATH we should add the contents as well
String jikesPath = System.getProperty("jikes.class.path");
if (jikesPath != null) {
classpath.append(new Path(project, jikesPath));
}
Vector argList = new Vector();

if (deprecation == true)
@@ -690,6 +696,21 @@ public class Javac extends MatchingTask {
warnings = false;
}

/**
* Jikes can issue pedantic warnings.
*/
boolean pedantic = false;
String pedanticProperty = project.getProperty("build.compiler.pedantic");
if (pedanticProperty != null &&
(pedanticProperty.equalsIgnoreCase("on") ||
pedanticProperty.equalsIgnoreCase("true"))
) {
pedantic = true;
}
if (pedantic)
argList.addElement("+P");
if (emacsMode)
argList.addElement("+E");



Loading…
Cancel
Save