evaluationDependsOn(':common') apply from: '../gradle/javaproject.gradle' dependencies { compile project(':common'), 'imagej:ij:+', 'sun:jai:+', 'bioformats:bioformats:+', 'slf4j:slf4j:+', 'slf4j:slf4j-log4j12:+' testCompile project(path: ':common', configuration: 'tests') } def jarConfiguration(parameters){ return { destinationDir = project.distsDir baseName = parameters.get('baseName') def libraryName = parameters.get('libraryName') from('targets/dist') { include 'BUILD*INFO' } from(project.compileJava.outputs.getFiles().getAsFileTree().matching { include '**/imagereaders/*.class' include "**/imagereaders/${libraryName}/*.class" }) from("resource/manifest/${libraryName}") manifest { attributes("Version": project.versionNumber, "Build-Number": "${project.versionNumber} (r${project.revisionNumber},${project.cleanFlag})") } } } task jarImageIO(type: Jar) { configure jarConfiguration([ 'baseName' : 'cisd-image_readers', 'libraryName' : 'imageio' ]) } task jarJai(type: Jar) { configure jarConfiguration([ 'baseName' : 'cisd-image_readers-jai', 'libraryName' : 'jai' ]) } task jarBioformats(type: Jar) { configure jarConfiguration([ 'baseName' : 'cisd-image_readers-bioformats', 'libraryName' : 'bioformats' ]) } task jarImageJ(type: Jar) { configure jarConfiguration([ baseName : 'cisd-image_readers-imagej', libraryName : 'ij' ]) } jar { destinationDir = project.distsDir } jar.dependsOn([ jarImageIO, jarJai, jarBioformats, jarImageJ ]) sourcesJar { destinationDir = project.distsDir }