Browse Source

support source/target on gcj. PR 46617. Based on patch by Paweł Zuzelski

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@738761 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
130b9317ef
6 changed files with 33 additions and 9 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +4
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +5
    -3
      docs/manual/CoreTasks/javac.html
  5. +9
    -6
      src/main/org/apache/tools/ant/taskdefs/Javac.java
  6. +10
    -0
      src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java

+ 1
- 0
CONTRIBUTORS View File

@@ -226,6 +226,7 @@ Paul Christmann
Paul Galbraith
Paul King
Paulo Gaspar
Pawel Zuzelski
Peter B. West
Peter Donald
Peter Doornbosch


+ 4
- 0
WHATSNEW View File

@@ -655,6 +655,10 @@ Other changes:
these were eliminated in the interest of behaving in the manner
of a "path."

* <javac>'s source and target attributes are no longer ignored when
using gcj.
Bugzilla Issue 46617.

Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================



+ 4
- 0
contributors.xml View File

@@ -923,6 +923,10 @@
<first>Paulo</first>
<last>Gaspar</last>
</name>
<name>
<first>Paweł</first>
<last>Zuzelski</last>
</name>
<name>
<first>Peter</first>
<middle>B.</middle>


+ 5
- 3
docs/manual/CoreTasks/javac.html View File

@@ -358,9 +358,11 @@ invoking the compiler.</p>
<td valign="top">Value of the <code>-source</code> command-line
switch; will be ignored by all implementations prior to
<code>javac1.4</code> (or <code>modern</code> when Ant is not
running in a 1.3 VM) and <code>jikes</code>.<br> If you use this
attribute together with <code>jikes</code>, you must make sure
that your version of jikes supports the <code>-source</code>
running in a 1.3 VM), <code>gcj</code> and <code>jikes</code>.<br>
If you use this attribute together with <code>gcj</code>
or <code>jikes</code>, you must make sure that your version
supports the <code>-source</code> (or <code>-fsource</code> for
gcj)
switch. By default, no <code>-source</code> argument will be used
at all.<br>
<b>Note that the default value depends on the JVM that is running


+ 9
- 6
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -186,13 +186,16 @@ public class Javac extends MatchingTask {
}

/**
* Value of the -source command-line switch; will be ignored
* by all implementations except modern and jikes.
* Value of the -source command-line switch; will be ignored by
* all implementations except modern, jikes and gcj (gcj uses
* -fsource).
*
* If you use this attribute together with jikes, you must make
* sure that your version of jikes supports the -source switch.
* Legal values are 1.3, 1.4, 1.5, and 5 - by default, no
* -source argument will be used at all.
* <p>If you use this attribute together with jikes or gcj, you
* must make sure that your version of jikes supports the -source
* switch.</p>
*
* <p>Legal values are 1.3, 1.4, 1.5, and 5 - by default, no
* -source argument will be used at all.</p>
*
* @param v Value to assign to source.
*/


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

@@ -114,6 +114,16 @@ public class Gcj extends DefaultCompilerAdapter {
cmd.createArgument().setValue("-C");
}

if (attributes.getSource() != null) {
String source = attributes.getSource();
cmd.createArgument().setValue("-fsource=" + source);
}

if (attributes.getTarget() != null) {
String target = attributes.getTarget();
cmd.createArgument().setValue("-ftarget=" + target);
}

addCurrentCompilerArgs(cmd);

return cmd;


Loading…
Cancel
Save