[ant] 02/03: Update patch: extract methods

Chris West faux-guest at moszumanska.debian.org
Tue Dec 12 15:51:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

faux-guest pushed a commit to branch master
in repository ant.

commit 3dda076e5c81a43e914fa8917d915b9cecc6ddf0
Author: Chris West (Faux) <git at goeswhere.com>
Date:   Tue Dec 12 15:07:53 2017 +0000

    Update patch: extract methods
---
 debian/patches/0013-auto-adjust-target.patch | 31 ++++++++++++++++++----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/debian/patches/0013-auto-adjust-target.patch b/debian/patches/0013-auto-adjust-target.patch
index 223bbdd..f0f7e30 100644
--- a/debian/patches/0013-auto-adjust-target.patch
+++ b/debian/patches/0013-auto-adjust-target.patch
@@ -5,10 +5,10 @@ Subject: Adjust the source/target level automatically for Debian builds with
 
 Forwarded: no
 ---
- src/main/org/apache/tools/ant/taskdefs/Javac.java  | 13 +++++-
+ src/main/org/apache/tools/ant/taskdefs/Javac.java  | 13 ++++-
  .../org/apache/tools/ant/taskdefs/Javadoc.java     |  2 +-
- .../apache/tools/ant/taskdefs/LanguageLevel.java   | 53 ++++++++++++++++++++++
- 3 files changed, 65 insertions(+), 3 deletions(-)
+ .../apache/tools/ant/taskdefs/LanguageLevel.java   | 62 ++++++++++++++++++++++
+ 3 files changed, 74 insertions(+), 3 deletions(-)
  create mode 100644 src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java
 
 diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java
@@ -64,10 +64,10 @@ index b9cc3b8..814ec8d 100644
          if (linksource && doclet == null) {
 diff --git a/src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java b/src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java
 new file mode 100644
-index 0000000..e781fb2
+index 0000000..20a37d9
 --- /dev/null
 +++ b/src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java
-@@ -0,0 +1,53 @@
+@@ -0,0 +1,62 @@
 +package org.apache.tools.ant.taskdefs;
 +
 +import java.util.Arrays;
@@ -84,6 +84,19 @@ index 0000000..e781fb2
 +    /** 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"});
 +
++    /** Detect if a Debian build is in process */
++    static boolean isDebianBuild() {
++        return System.getenv("DEB_BUILD_ARCH") != null;
++    }
++
++    /** Detect if we're running on an older JVM */
++    static boolean isPreJava9() {
++        return JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)
++                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6)
++                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_7)
++                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_8);
++    }
++
 +    /**
 +     * Adjust the source/target level automatically for Debian builds with Java 9 or later.
 +     *
@@ -96,16 +109,12 @@ index 0000000..e781fb2
 +            return level;
 +        }
 +
-+        if (System.getenv("DEB_BUILD_ARCH") == null) {
++        if (!isDebianBuild()) {
 +            // only do this is it's a Debian package build
 +            return level;
 +        }
 +
-+        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)
-+                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6)
-+                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_7)
-+                || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_8)) {
-+
++        if (isPreJava9()) {
 +            // no need to do anything on pre-Java 9 JDKs
 +            return level;
 +        }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/ant.git



More information about the pkg-java-commits mailing list