summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/gradle.properties7
-rw-r--r--java/gradle/library.gradle33
2 files changed, 35 insertions, 5 deletions
diff --git a/java/gradle.properties b/java/gradle.properties
index 509318595e1..b5e805e062d 100644
--- a/java/gradle.properties
+++ b/java/gradle.properties
@@ -27,6 +27,13 @@ dbHome =
//
prefix =
+//
+// Set to true if you want to add Class-Path entries to Ice JAR files
+// when installing the JARs. That is mostly usefull when building JAR
+// files to be used in system packages.
+//
+jarsClassPath = false
+
//
// The Jgoodies third party package versions to use with IceGridGUI builds.
diff --git a/java/gradle/library.gradle b/java/gradle/library.gradle
index 95fabf9d096..ee97f60a628 100644
--- a/java/gradle/library.gradle
+++ b/java/gradle/library.gradle
@@ -125,9 +125,32 @@ clean {
delete(pomName)
}
-task install(type: Copy, dependsOn: jarSources, overwrite: true) {
- from "${pomName}"
- from "${libDir}/${jar.archiveName}"
- from "${libDir}/${project.name}-${project.version}-sources.jar"
- into "${DESTDIR}${jarDir}"
+//
+// Check if we need to update the JARs class-path
+//
+if(jarsClassPath.toBoolean()){
+ task copyJars(type: Copy, dependsOn: jarSources, overwrite: true) {
+ from "${pomName}"
+ from "${libDir}/${jar.archiveName}"
+ from "${libDir}/${project.name}-${project.version}-sources.jar"
+ into "${DESTDIR}${jarDir}"
+ }
+
+ task updateInstallManifest(dependsOn: copyJars) << {
+ ant.jar(update: true, destfile: "${DESTDIR}${jarDir}/${jar.archiveName}") {
+ delegate.manifest {
+ attribute(name: "Built-By", value: "ZeroC, Inc.")
+ attribute(name: "Class-Path", value: configurations.runtime.resolve().collect { it.toURI() }.join(' ').replaceAll("${libDir}", "${jarDir}"))
+ }
+ }
+ }
+
+ install.dependsOn(updateInstallManifest)
+} else {
+ task install(type: Copy, dependsOn: jarSources, overwrite: true) {
+ from "${pomName}"
+ from "${libDir}/${jar.archiveName}"
+ from "${libDir}/${project.name}-${project.version}-sources.jar"
+ into "${DESTDIR}${jarDir}"
+ }
}