apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'java-library-distribution' jar { manifest { attributes 'Implementation-Title': 'PDF-AS-4 Library', 'JARMANIFEST': 'PDF-AS-LIB' } } buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath("commons-io:commons-io:2.4") } } sourceSets { main { java { srcDirs = [ 'src/main/java', 'src/generated/java' ] } } } configurations { ws pdfDoclet { extendsFrom compile } } project.ext { wsdlDir = file("src/main/resources/wsdl") generatedWsdlDir = file("src/generated/java") wsdlsToGenerate = [ ['-xjc', "$wsdlDir/MOA-SPSS-2.0.0.wsdl"], ] } task createConf(type: Zip, dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) { from 'src/configuration' archiveName 'config.zip' destinationDir new File(projectDir, 'src/main/resources/config') } compileJava.dependsOn(createConf) repositories { mavenLocal() mavenCentral() } dependencies { compile project (':pdf-as-common') compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '1.8.7' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2' compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.5' compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.5' compile group: 'commons-io', name: 'commons-io', version: '2.4' compile 'org.apache.commons:commons-collections4:4.0' compile group: 'ognl', name: 'ognl', version: '3.0.8' compile files('libs/iaik_eccelerate_cms.jar') compile files('libs/iaik_eccelerate.jar') compile files('libs/iaik_jce.jar') compile files('libs/iaik_jce_full.jar') compile files('libs/iaik_cms.jar') compile group: 'log4j', name: 'log4j', version: '1.2.17' compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion compile group: 'com.google.zxing', name: 'core', version: '3.1.0' compile group: 'com.google.zxing', name: 'javase', version: '3.1.0' testCompile group: 'junit', name: 'junit', version: '4.+' ws group: 'org.apache.cxf', name: 'cxf-tools', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-databinding-jaxb', version: cxfVersion ws group: 'org.apache.cxf', name: 'cxf-tools-wsdlto-frontend-jaxws', version: cxfVersion } task wsdl2Java() { if (!wsdlDir.listFiles()) { // do nothing } else { inputs.files wsdlDir.listFiles() outputs.files generatedWsdlDir doLast { wsdlsToGenerate.each { argsin -> argsin.add(argsin.size - 1, '-d') argsin.add(argsin.size - 1, generatedWsdlDir) javaexec { classpath configurations.ws main = 'org.apache.cxf.tools.wsdlto.WSDLToJava' args = argsin systemProperties = ['exitOnFinish':'TRUE'] } } } } } task releaseConfig(type: Copy) { from 'src/main/resources/config/config.zip' into rootDir.toString() + "/releases/" + version + "/cfg" rename 'config.zip', 'defaultConfig.zip' } task releases(type: Copy) { from jar.outputs into rootDir.toString() + "/releases/" + version } releases.dependsOn releaseConfig task apidocs(type: Javadoc) { classpath = configurations.compile source = sourceSets.main.allJava destinationDir = new File(rootDir.toString() + "/releases/" + version + "/docs/api") title = "PDF-AS " + project.pdfasversion + " Documentation" options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PUBLIC options.charSet = "ISO-8859-1" options.author = "Andreas Fitzek" options.docTitle = "PDF-AS " + project.pdfasversion + " Documentation" options.version = project.pdfasversion options.windowTitle = "PDF-AS " + project.pdfasversion + " Library" options.header = "PDF-AS " + project.pdfasversion + " Library " + project.pdfasversion + " [" + project.revision + "]" options.use = "true" options.links("http://docs.oracle.com/javase/1.5.0/docs/api/") include('at/gv/egiz/pdfas/lib/api/**') } task fulldocs(type: Javadoc) { classpath = configurations.compile source = sourceSets.main.allJava destinationDir = new File(rootDir.toString() + "/releases/" + version + "/docs/full") title = "PDF-AS " + project.pdfasversion + " Documentation" options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED options.charSet = "ISO-8859-1" options.author = "Andreas Fitzek" options.docTitle = "PDF-AS " + project.pdfasversion + " Documentation" options.version = project.pdfasversion options.windowTitle = "PDF-AS " + project.pdfasversion + " Library" options.header = "PDF-AS " + project.pdfasversion + " Library " + project.pdfasversion + " [" + project.revision + "]" options.use = "true" options.links("http://docs.oracle.com/javase/1.5.0/docs/api/") include('at/knowcenter/wag/egiz/**') include('at/gv/egiz/**') } releases.dependsOn apidocs releases.dependsOn fulldocs test { systemProperties 'property': 'value' } distributions { main { contents { from { '../docs' } from('../doc/') { include '*.pdf' } } } }