apply from: '../jhdf5/javaproject.gradle' group='sis' dependencies { compile project(':jhdf5'), 'cisd:cisd-base:+', 'rinn:restrictions:+' testCompile 'testng:testng:+' } sourceSets { test { java { srcDirs = ['sourceTest'] } resources { srcDirs = ['sourceTest'] } } } test { useTestNG() options.suites('sourceTest/tests.xml') jvmArgs '-Xmx2048m', '-XX:MaxPermSize=256m', '-Duser.timezone=Europe/Zurich' testLogging.showStandardStreams = true ignoreFailures = true } test.dependsOn checkRestrictions tasks.withType(Test) { systemProperty "java.library.path", "../jhdf5/libs/native/jhdf5/amd64-Linux:../jhdf5/libs/native/jhdf5/amd64-Linux:../jhdf5/libs/native/jhdf5/x86_64-Mac OS X:../jhdf5/libs/native/jhdf5/x86_64-Mac OS X" } jar { manifest { attributes 'Main-Class': 'ch.ethz.sis.hcscld.BuildAndEnvironmentInfo' attributes 'Class-Path': configurations.runtime.collect { it.getName() }.join(' ') } from('targets/dist') { include 'BUILD*INFO' } } task javadocZip(type: Zip, dependsOn: javadoc) { archiveName "${project.group}-hcscld-javadoc.zip" from javadoc.destinationDir } task exampleSourcesJar(type: Jar) { classifier = 'exampleSources' from sourceSets.examples.allSource } task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, exampleSourcesJar, javadocZip, project(':jhdf5').distributionZip]) { baseName = "${project.group}-hcscld" from ('dist') { into "${project.group}-hcscld" } from (javadocZip.archivePath) { into "${project.group}-hcscld/doc" } from (jar.archivePath) { into "${project.group}-hcscld/lib" rename '(.*)', "${project.group}-hcscld.jar" } from (configurations.runtime) { exclude '*restriction*' exclude '*bcel*' into "${project.group}-hcscld/lib" } from (sourcesJar.archivePath) { into "${project.group}-hcscld/src" rename '(.*)', "${project.group}-hcscld-src.zip" } from (exampleSourcesJar.archivePath) { into "${project.group}-hcscld/doc" rename '(.*)', "${project.group}-hcscld-examples-src.zip" } from (project(':jhdf5').nativeJarLinuxIntel.archivePath) { into "${project.group}-hcscld/lib" } from (project(':jhdf5').nativeJarMacIntel.archivePath) { into "${project.group}-hcscld/lib" } from (project(':jhdf5').nativeJarWindowsIntel.archivePath) { into "${project.group}-hcscld/lib" } } build.dependsOn distributionZip publishing { publications { artifacts(IvyPublication) { module "${project.group}-hcscld" revision project.revisionForPublication from components.java artifact(project(':jhdf5').jar) { name = "${project.group}-jhdf5-core" conf = "runtime" } artifact(project(':jhdf5').nativeJarLinuxIntel) { name = "hdf5-linux-intel" conf = "runtime" } artifact(project(':jhdf5').nativeJarMacIntel) { name = "hdf5-macosx-intel" conf = "runtime" } artifact(project(':jhdf5').nativeJarWindowsIntel) { name = "hdf5-windows-intel" conf = "runtime" } artifact(sourcesJar) { type = "source" } descriptor { withXml { asNode().dependencies.dependency.find { it.@org == 'rinn' }.replaceNode {} asNode().dependencies.dependency.find { it.@name == 'jhdf5' }.replaceNode {} } } } } }