[gradle] 03/03: New d/generate-classpath.gradle and generate_classpath.diff: Auto generate classpath attributes to jar manifest

Kai-Chung Yan seamlik-guest at moszumanska.debian.org
Sat Oct 3 10:39:05 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.

commit 8e5e95f10f0474cd2947172d4fffbc7636321d1f
Author: Kai-Chung Yan <seamlikok at gmail.com>
Date:   Sat Oct 3 18:38:44 2015 +0800

    New d/generate-classpath.gradle and generate_classpath.diff: Auto generate classpath attributes to jar manifest
---
 debian/changelog                                |  5 ++++-
 debian/generate-classpath.gradle                | 25 +++++++++++++++++++++++++
 debian/libgradle-core-java.lintian-overrides    |  6 +-----
 debian/libgradle-plugins-java.lintian-overrides |  3 ---
 debian/patches/generate_classpath.diff          | 16 ++++++++++++++++
 debian/patches/series                           |  1 +
 6 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d6effad..c9007c9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ gradle (2.7-1) UNRELEASED; urgency=low
     - Build-Depends on gradle (>= 2.5)
     - Add checkstyle to Recommends
     - Add dh-exec to Build-Depends
+    - Add java6-runtime to Depends as an option
   * d/rules: No need to copy gradle-core codes to buildSrc
   * Remove fix_DocGenerationException.diff: No longer needed
   * Update maven_jcommander.diff to jcommander.diff
@@ -18,8 +19,10 @@ gradle (2.7-1) UNRELEASED; urgency=low
   * Add an application menu entry for Gradle GUI
   * Add symlinks to all Gradle jars in /usr/share/gradle, making a pseudo
     making a pseudo Gradle installation
+  * New d/generate-classpath.gradle and generate_classpath.diff: Auto generate
+    classpath attributes to jar manifest
 
- -- Kai-Chung Yan <seamlikok at gmail.com>  Wed, 30 Sep 2015 04:37:18 +0800
+ -- Kai-Chung Yan <seamlikok at gmail.com>  Sat, 03 Oct 2015 18:37:27 +0800
 
 gradle (2.5-3) unstable; urgency=medium
 
diff --git a/debian/generate-classpath.gradle b/debian/generate-classpath.gradle
new file mode 100644
index 0000000..c10d8c6
--- /dev/null
+++ b/debian/generate-classpath.gradle
@@ -0,0 +1,25 @@
+subprojects {
+  jar {
+    doFirst {
+      if (archivesBaseName != 'gradle-launcher') {
+        def propertiesText = file("build/generated-resources/main/${archivesBaseName}-classpath.properties")
+        def classpathContent = ""
+        propertiesText.eachLine {
+          if (it.startsWith('projects')) {
+            it.substring(9).split(',').each {
+              classpathContent = "${classpathContent} ${it}.jar"
+            }
+          }
+          if (it.startsWith('runtime')) {
+            it.substring(8).split(',').each {
+              classpathContent = "${classpathContent} ${it}"
+            }
+          }
+        }
+        manifest {
+          attributes("Class-Path": classpathContent.toString())
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/debian/libgradle-core-java.lintian-overrides b/debian/libgradle-core-java.lintian-overrides
index b628887..f971cd6 100644
--- a/debian/libgradle-core-java.lintian-overrides
+++ b/debian/libgradle-core-java.lintian-overrides
@@ -1,7 +1,3 @@
 # Although gradle-docs-*.jar is codeless, Gradle treats it as a submodule and
 # fails to launch without it.
-codeless-jar usr/share/java/gradle-docs-2.7.jar
-
-# Gradle maintains classpath outside of manifest and loads libraries using its
-# own mechanism.
-missing-classpath
\ No newline at end of file
+codeless-jar usr/share/java/gradle-docs-2.7.jar
\ No newline at end of file
diff --git a/debian/libgradle-plugins-java.lintian-overrides b/debian/libgradle-plugins-java.lintian-overrides
deleted file mode 100644
index d94b591..0000000
--- a/debian/libgradle-plugins-java.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-# Gradle maintains classpath outside of manifest and loads libraries using its
-# own mechanism.
-missing-classpath
\ No newline at end of file
diff --git a/debian/patches/generate_classpath.diff b/debian/patches/generate_classpath.diff
new file mode 100644
index 0000000..ad7c69c
--- /dev/null
+++ b/debian/patches/generate_classpath.diff
@@ -0,0 +1,16 @@
+Description:
+ generate-classpath.gradle makes every Java libraries auto generate Class-Path
+ attributes in the manifest.
+ Gradle uses its own mechanism to manage Jar dependencies through another
+ file, but providing the Class-Path will help other Java libraries using Gradle
+ libraries. Do so also clears the Lintian warning about mising classpath.
+Author: Kai-Chung Yan <seamlikok at gmail.com>
+Lasy-Update: 2015-10-03
+--- a/build.gradle
++++ b/build.gradle
+@@ -201,3 +201,4 @@
+ }
+ 
+ apply from: 'gradle/pullRequestBuild.gradle'
++apply from: "debian/generate-classpath.gradle"
+\ No newline at end of file
diff --git a/debian/patches/series b/debian/patches/series
index d698f2d..a274943 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,4 @@ eclipse-aether.diff
 maven-aether-provider.diff
 maven_builder_support.diff
 use-bndlib-1.50.0.patch
+generate_classpath.diff

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



More information about the pkg-java-commits mailing list