[gradle-1.12] 141/211: Use the JDK 7 API for the chmod/stat operations until jnr-posix is fixed in sid

Kai-Chung Yan seamlik-guest at moszumanska.debian.org
Wed Jul 1 14:18:35 UTC 2015


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

seamlik-guest pushed a commit to branch master
in repository gradle-1.12.

commit e5e427bf46a3c3eee1ec07673221facd148fb44a
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Fri Jun 5 14:37:35 2015 +0200

    Use the JDK 7 API for the chmod/stat operations until jnr-posix is fixed in sid
---
 debian/changelog                             |  2 ++
 debian/patches/38_use_jdk7_nio_file_api.diff | 46 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 3 files changed, 49 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2da1368..50d0934 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ gradle (1.5-3) UNRELEASED; urgency=medium
 
   * Team upload.
   * Fixed a compatibility issue with testng 6.9
+  * Use the JDK 7 API for the chmod/stat operations until jnr-posix
+    is fixed in sid
 
  -- Emmanuel Bourg <ebourg at apache.org>  Thu, 04 Jun 2015 23:33:33 +0200
 
diff --git a/debian/patches/38_use_jdk7_nio_file_api.diff b/debian/patches/38_use_jdk7_nio_file_api.diff
new file mode 100644
index 0000000..5b3e6a4
--- /dev/null
+++ b/debian/patches/38_use_jdk7_nio_file_api.diff
@@ -0,0 +1,46 @@
+Description: Use the JDK 7 API for the chmod/stat operations until jnr-posix is fixed in sid
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/subprojects/native/src/main/java/org/gradle/internal/nativeplatform/filesystem/FileSystemServices.java
++++ b/subprojects/native/src/main/java/org/gradle/internal/nativeplatform/filesystem/FileSystemServices.java
+@@ -56,15 +56,17 @@
+         serviceRegistry.add(Symlink.class, createSymlink(libC));
+ 
+         // Use libc backed implementations on Linux and Mac, if libc available
++/*
+         if (libC != null && (operatingSystem.isLinux() || operatingSystem.isMacOsX())) {
+             FilePathEncoder filePathEncoder = createEncoder(libC);
+             serviceRegistry.add(Chmod.class, new LibcChmod(libC, filePathEncoder));
+             serviceRegistry.add(Stat.class, new LibCStat(libC, operatingSystem, PosixUtil.current(), filePathEncoder));
+             return;
+         }
++*/
+ 
+         // Use java 7 APIs, if available
+-        if (JavaVersion.current().isJava7()) {
++        if (true) {
+             String jdkFilePermissionclass = "org.gradle.internal.nativeplatform.filesystem.jdk7.PosixJdk7FilePermissionHandler";
+             try {
+                 Object handler = FileSystemServices.class.getClassLoader().loadClass(jdkFilePermissionclass).newInstance();
+@@ -72,6 +74,7 @@
+                 serviceRegistry.add(Chmod.class, (Chmod) handler);
+                 return;
+             } catch (ClassNotFoundException e) {
++e.printStackTrace();
+                 LOGGER.warn(String.format("Unable to load %s. Continuing with fallback.", jdkFilePermissionclass));
+             } catch (Exception e) {
+                 throw UncheckedException.throwAsUncheckedException(e);
+--- a/subprojects/native/native.gradle
++++ b/subprojects/native/native.gradle
+@@ -22,11 +22,6 @@
+     compile libraries.jcip
+ }
+ 
+-if (!javaVersion.java7) {
+-    sourceSets.main.java.exclude '**/jdk7/**'
+-    sourceSets.test.groovy.exclude '**/jdk7/**'
+-}
+-
+ useTestFixtures()
+ useClassycle()
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0d12c3c..f9d24ea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,3 +17,4 @@
 35_ivy_23.diff
 36_java8_compatibility.diff
 37_replace_internal_testng_api.diff
+38_use_jdk7_nio_file_api.diff

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



More information about the pkg-java-commits mailing list