apply from: '../gradle/javaproject.gradle' group='sis' dependencies { compile 'apache:commons-io:+', 'apache:commons-lang:+', 'testng:testng:+', 'rinn:restrictions:+' } tasks.withType(Test) { systemProperty "java.library.path", "libs/native/unix/amd64-Linux:libs/native/nativedata/amd64-Linux:libs/native/unix/x86_64-Mac OS X:libs/native/nativedata/x86_64-Mac OS X" } sourceSets { test { resources { srcDir "libs" include "**" } } } jar { manifest { attributes 'Main-Class': 'ch.systemsx.cisd.base.BuildAndEnvironmentInfo' } from('targets/dist') { include 'BUILD*INFO' } from fileTree("libs/") } task standaloneTestJar(type: Jar, dependsOn: [classes, testClasses]) { archiveName "${project.group}-base-test.jar" from files(sourceSets.main.output.classesDir) from files(sourceSets.main.output.resourcesDir) from files(sourceSets.test.output.classesDir) from files("libs") from {configurations.testRuntime.collect {zipTree(it)}} manifest { attributes 'Main-Class': 'ch.systemsx.cisd.base.AllTests' } } task javadocZip(type: Zip, dependsOn: javadoc) { archiveName "${project.group}-base-javadoc.zip" from javadoc.destinationDir } task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, javadocZip, standaloneTestJar]) { baseName = "${project.group}-base" from ('dist') { into "${project.group}-base" } from ('doc') { into "${project.group}-base/doc" } from (jar.archivePath) { into "${project.group}-base/lib" rename '(.*)', "${project.group}-base.jar" } from (sourcesJar.archivePath) { into "${project.group}-base/src" rename '(.*)', "${project.group}-base-src.jar" } from (standaloneTestJar.archivePath) { into "${project.group}-base/lib" } from (javadocZip.archivePath) { into "${project.group}-base/doc" } } build.dependsOn distributionZip publishing { publications { ivy(IvyPublication) { module "${project.group}-base" revision project.revisionForPublication from components.java artifact(sourcesJar) { type = 'source' } descriptor { withXml { for (org in ['testng', 'rinn']) { asNode().dependencies.dependency.find { it.@org == org }.replaceNode {} } } } } } }