Skip to content
Commits on Source (4)
ant (1.10.3-2) unstable; urgency=medium
* Team upload.
* Automatically set the value of the javac --release attribute to improve
the backward compatibility of the code compiled with Java 9 or later.
* Standards-Version updated to 4.1.4
* Use salsa.debian.org Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Wed, 13 Jun 2018 23:28:33 +0200
ant (1.10.3-1) unstable; urgency=medium
* New upstream release
......
......@@ -25,9 +25,9 @@ Build-Depends: antlr,
libxml-commons-resolver1.1-java (>= 1.2-7~),
libxz-java,
maven-repo-helper (>> 1.0)
Standards-Version: 4.1.3
Vcs-Git: https://anonscm.debian.org/git/pkg-java/ant.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/ant.git
Standards-Version: 4.1.4
Vcs-Git: https://salsa.debian.org/java-team/ant.git
Vcs-Browser: https://salsa.debian.org/java-team/ant
Homepage: http://ant.apache.org
Package: ant
......
......@@ -3,40 +3,58 @@ Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/main/org/apache/tools/ant/taskdefs/Javac.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java
@@ -213,7 +213,10 @@
@@ -213,7 +213,7 @@
*/
public String getSource() {
return source != null
- ? source : getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE);
+ ? source : LanguageLevel.adjust(
+ getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE),
+ MagicNames.BUILD_JAVAC_SOURCE,
+ this);
+ ? source : LanguageLevel.adjust(getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE), MagicNames.BUILD_JAVAC_SOURCE, this);
}
/**
@@ -792,7 +795,10 @@
@@ -792,7 +792,7 @@
public String getTarget() {
return targetAttribute != null
? targetAttribute
- : getProject().getProperty(MagicNames.BUILD_JAVAC_TARGET);
+ : LanguageLevel.adjust(
+ getProject().getProperty(MagicNames.BUILD_JAVAC_TARGET),
+ MagicNames.BUILD_JAVAC_TARGET,
+ this);
+ : LanguageLevel.adjust(getProject().getProperty(MagicNames.BUILD_JAVAC_TARGET), MagicNames.BUILD_JAVAC_TARGET, this);
}
/**
@@ -1121,6 +1127,9 @@
@@ -1120,7 +1120,7 @@
public void execute() throws BuildException {
checkParameters();
resetFileLists();
+ source = LanguageLevel.adjust(source, "javac -source", this);
+ targetAttribute = LanguageLevel.adjust(targetAttribute, "javac -target", this);
+
-
+ adjustLevels();
// scan source directories and dest directory to build up
// compile list
if (hasPath(src)) {
@@ -1722,4 +1722,24 @@
0x00, 0x00, 0x00, 0x02, 0x00, 0x04
};
+ /**
+ * Adjusts the value of the source/target/release attributes.
+ */
+ private void adjustLevels() {
+ source = LanguageLevel.adjust(source, "javac -source", this);
+ targetAttribute = LanguageLevel.adjust(targetAttribute, "javac -target", this);
+ release = LanguageLevel.adjust(release, "javac --release", this);
+ if (LanguageLevel.isDebianBuild()) {
+ if (release == null && targetAttribute != null) {
+ log("Release attribute not specified, defaulting to the value of the target attribute (" + targetAttribute + ")");
+ release = targetAttribute;
+ } else if (release == null && targetAttribute != null) {
+ log("Release attribute not specified, defaulting to the value of the source attribute (" + source + ")");
+ release = source;
+ }
+ if (release != null && release.startsWith("1.")) {
+ release = release.substring(2);
+ }
+ }
+ }
}
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
@@ -2174,7 +2174,7 @@
......@@ -62,7 +80,7 @@ Forwarded: no
+class LanguageLevel {
+
+ /** The minimum language level supported by the current javac */
+ private static final String MIN_LEVEL = "1.7";
+ private static final String MIN_LEVEL = "7";
+
+ /** The list of language levels no longer supported by the current javac */
+ private static final List<String> UNSUPPORTED_LEVELS = Arrays.asList(new String[]{"1.1", "1.2", "1.3", "1.4", "1.5", "5", "1.6", "6"});
......
......@@ -50,6 +50,3 @@ override_dh_compress:
override_dh_auto_clean:
rm -Rf bin build bootstrap lib/optional/*.jar
get-orig-source:
-uscan --download-current-version --force-download --rename --repack --compression xz