diff --git a/build.gradle b/build.gradle index 8882de27b96c3c7373a67488d786b74143e07065..a607d9ecdadc34a921578d2fea814e8f23ebbb0c 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {