make Java 6's javac understand -source 1.1 as well

This commit is contained in:
Permaine Cheung 2008-01-09 14:00:09 +00:00
parent ff664675d4
commit bb868a10ef
2 changed files with 27 additions and 1 deletions

View File

@ -55,7 +55,7 @@
Name: ant
Version: 1.7.0
Release: %{jpprelease}.2%{?dist}
Release: %{jpprelease}.3%{?dist}
Epoch: 0
Summary: Ant build tool for java
Summary(it): Tool per la compilazione di programmi java
@ -73,6 +73,7 @@ Patch2: apache-ant-1.7.0-javah.patch
# Fix some places where copies of classes are included in the wrong jarfiles
Patch4: apache-ant-jars.patch
Patch5: apache-ant-bz163689.patch
Patch6: apache-ant-r529855.patch
Requires: jaxp_parser_impl
Requires: jpackage-utils >= 0:1.6
@ -616,6 +617,9 @@ Javadoc pour %{name}.
#%patch5 -p1 -b .orig
#%endif
# Patch to make Java 6's javac understand -source 1.2
%patch6 -p0
# clean jar files
find . -name "*.jar" -exec rm -f {} \;
@ -1365,6 +1369,10 @@ fi
# -----------------------------------------------------------------------------
%changelog
* Wed Jan 09 2008 Permaine Cheung <pcheung at redhat.com> - 0:1.7.0-1jpp.3
- make Java 6's javac understand -source 1.1 as well (patch from bodewig
on the ant mailing list)
* Tue Aug 14 2007 Permaine Cheung <pcheung at redhat.com> - 0:1.7.0-1jpp.2
- Enable building commons-net subpackage

18
apache-ant-r529855.patch Normal file
View File

@ -0,0 +1,18 @@
Index: src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
===================================================================
--- src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java (revision 529854)
+++ src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java (revision 529855)
@@ -321,10 +321,10 @@
if (attributes.getSource() != null && !assumeJava13()) {
cmd.createArgument().setValue("-source");
String source = attributes.getSource();
- if ((assumeJava14() || assumeJava15())
- && (source.equals("1.1") || source.equals("1.2"))) {
+ if (source.equals("1.1") || source.equals("1.2")) {
// support for -source 1.1 and -source 1.2 has been
- // added with JDK 1.4.2 - and isn't present in 1.5.0 either
+ // added with JDK 1.4.2 - and isn't present in 1.5.0
+ // or 1.6.0 either
cmd.createArgument().setValue("1.3");
} else {
cmd.createArgument().setValue(source);