apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'application'

mainClassName = "at.gv.egiz.pdfas.cli.Main"

repositories {
	mavenLocal()
    mavenCentral()
}

task releases(type: Copy) {
	from distZip.outputs
	from distTar.outputs
	into rootDir.toString() + "/releases/" + version
}

configurations { 
	pdfBox2Compile
}

sourceSets{
	pdfBox2{
		compileClasspath = configurations.pdfBox2Compile
		runtimeClasspath = configurations.pdfBox2Compile + main.runtimeClasspath
	}
}
			   
dependencies {
	implementation project (':pdf-as-lib')
	implementation project (':signature-standards:sigs-pkcs7detached')
	implementation project (':signature-standards:sigs-pades')
	implementation project (':pdf-as-moa')
    implementation project (':pdf-as-pdfbox-2')
    implementation group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
	implementation group: 'commons-cli', name: 'commons-cli', version: '1.2'
	implementation group: 'javax.activation', name: 'activation', version: '1.1.1'
	implementation 'ch.qos.logback:logback-classic:1.1.2'
    testImplementation group: 'junit', name: 'junit', version: '4.+'
}


startScripts{
	classpath+=sourceSets.pdfBox2.compileClasspath
}

compileJava{
    classpath=sourceSets.main.compileClasspath
	classpath+=sourceSets.pdfBox2.compileClasspath
}

distZip {
	duplicatesStrategy = DuplicatesStrategy.EXCLUDE

    into("${archiveBaseName}-${archiveVersion}/lib") {
        from startScripts.classpath
    }
}

distTar {
	duplicatesStrategy = DuplicatesStrategy.EXCLUDE
	
    into("${archiveBaseName}-${archiveVersion}/lib") {
        from startScripts.classpath
    }

}

releases.dependsOn jar
releases.dependsOn sourcesJar
releases.dependsOn distZip
releases.dependsOn distTar

distZip.dependsOn startScripts


test {
    systemProperties 'property': 'value'
}