Skip to content
Snippets Groups Projects
Commit 4b4b7798 authored by Johannes Mey's avatar Johannes Mey
Browse files

fix jar generation of derived projects

parent f00da960
Branches
No related tags found
No related merge requests found
......@@ -29,15 +29,38 @@ sourceSets {
}
}
def versionFile = 'src/main/resources/preprocessor.properties'
def versionProps = new Properties()
try {
file(versionFile).withInputStream { stream -> versionProps.load(stream) }
version = versionProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
task fatJar(type: Jar) {
group = "build"
archiveAppendix = "fatjar"
from sourceSets.main.output
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes "Main-Class": "${mainClassName}"
}
}
task modelJar(type: Jar) {
group = "build"
archiveBaseName = 'model'
archiveVersion = ''
archiveAppendix = "model"
from sourceSets.model.output
}
artifacts {
archives modelJar
archives fatJar
}
dependencies {
......@@ -64,25 +87,8 @@ dependencies {
testFixturesApi group: 'commons-io', name: 'commons-io', version: '2.8.0'
}
def versionFile = 'src/main/resources/preprocessor.properties'
def versionProps = new Properties()
try {
file(versionFile).withInputStream { stream -> versionProps.load(stream) }
version = versionProps['version']
} catch (e) {
// this happens, if either the properties file is not present, or cannot be read from
throw new GradleException("File ${versionFile} not found or unreadable. Aborting.", e)
}
jar {
manifest {
attributes "Main-Class": "${mainClassName}"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
archiveAppendix = "base"
}
test {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment