diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 6c43e8fa1..ff36a02d3 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -226,6 +226,7 @@ Paul Christmann
Paul Galbraith
Paul King
Paulo Gaspar
+Pawel Zuzelski
Peter B. West
Peter Donald
Peter Doornbosch
diff --git a/WHATSNEW b/WHATSNEW
index 3da2eaaba..8077debb4 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -655,6 +655,10 @@ Other changes:
these were eliminated in the interest of behaving in the manner
of a "path."
+ *
-source
command-line
switch; will be ignored by all implementations prior to
javac1.4
(or modern
when Ant is not
- running in a 1.3 VM) and jikes
.jikes
, you must make sure
- that your version of jikes supports the -source
+ running in a 1.3 VM), gcj
and jikes
.gcj
+ or jikes
, you must make sure that your version
+ supports the -source
(or -fsource
for
+ gcj)
switch. By default, no -source
argument will be used
at all.If you use this attribute together with jikes or gcj, 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.
* * @param v Value to assign to source. */ diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java index cae497fbd..889d66712 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java @@ -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;