// ********************************************************************** // // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** task copyTmpJars(type: Copy, dependsOn: jar) { from new File("${projectDir}/build/libs/${tmpJarName}") into "${libDir}" rename("${tmpJarName}", "${jarName}") } task updateManifest(dependsOn: copyTmpJars) { doLast { ant.jar(update: true, destfile: "${libDir}/${jarName}") { delegate.manifest { attribute(name: "Main-Class", value: "com.zeroc.IceGridGUI.Main") attribute(name: "Built-By", value: "ZeroC, Inc.") attribute(name: "Class-Path", value: configurations.runtime.resolve().collect { it.toURI() }.join(' ')) } } } } updateManifest.outputs.files("${libDir}/${jarName}") // // Copy JARs to the install location // task copyJars(type: Copy, dependsOn: jar) { from new File("${projectDir}/build/libs/${tmpJarName}") into "${DESTDIR}${jarDir}" rename("${tmpJarName}", "${jarName}") } // // We need to update the manifest of the installed IceGridGUI jar and fix the // Class-Path to point to the installed JAR files. // task updateInstallManifest(dependsOn: copyJars) { doLast { ant.jar(update: true, destfile: "${DESTDIR}${jarDir}/${jarName}") { delegate.manifest { attribute(name: "Main-Class", value: "com.zeroc.IceGridGUI.Main") attribute(name: "Built-By", value: "ZeroC, Inc.") attribute(name: "Class-Path", value: configurations.runtime.resolve().collect { it.toURI() }.join(' ').replaceAll("${libDir.replaceAll('\\\\', '/')}", "${jarDir.replaceAll('\\\\', '/')}")) } } } } updateInstallManifest.outputs.files("${DESTDIR}${jarDir}/${jarName}") // // We need to sign the install JARs after updating the manifest. // task signInstallJar(dependsOn: updateInstallManifest) { doLast { if(keystore != null && keystore.length() > 0) { ant.signjar(jar: "${DESTDIR}${jarDir}/${jarName}", alias: "zeroc.com", keystore: "${keystore}", storepass:"${keystore_password}") } } } signInstallJar.outputs.files("${DESTDIR}${jarDir}/${jarName}") task install(dependsOn: signInstallJar)