build.gradle
plugins {
id 'com.gradle.build-scan' version '1.11'
}
group 'io.codepace'
version '1.0'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'distribution'
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}
mainClassName="io.codepace.cozy.Main"
//executableDir = "."
jar {
manifest{
attributes 'Main-Class': 'io.codepace.cozy.Main'
}
}
task fatJar(type: Jar){
manifest {
attributes 'Implementation-Title' : 'Cozy 0.2.0 Daemon',
'Implementation-Version' : version,
'Main-Class' : 'io.codepace.cozy.Main'
}
baseName = project.name;
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task buildAll{
dependsOn fatJar
dependsOn javadocJar
dependsOn sourcesJar
}
artifacts {
archives sourcesJar
archives javadocJar
}
targetCompatibility = 1.8
repositories {
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile group: 'net.sourceforge.argparse4j', name: 'argparse4j', version: '0.8.1'
}