Permalink
Browse files

adapted gradle for local jars

  • Loading branch information...
Albert Zuendorf
Albert Zuendorf committed Mar 14, 2018
1 parent ad6f6b4 commit 1c16918330c7af5c68207fda7b5d113dc9499f0a
Showing with 26 additions and 4 deletions.
  1. +13 −3 build.gradle
  2. +13 −1 gradle/tasks.gradle
@@ -78,16 +78,26 @@ dependencies {
testImplementation 'org.testfx:testfx-junit:4.0+'
if ( ! project.hasProperty('useLocalDependencies'))
{
if((gitVersion.isMaster() || isTravisSnapshot())== false) {
if (new File("../NetworkParser/build/libs/networkparser.local.jar").exists() )
{
println "using local networkparser.local.jar"
compile files("../NetworkParser/build/libs/networkparser.local.jar")
}
else if((gitVersion.isMaster() || isTravisSnapshot())== false)
{
println "using master networkparser.jar "
compile group: "de.uniks", name: "NetworkParser", version: "latest.integration", classifier:"sources18", changing: true
} else {
}
else
{
println "using snapshot jar"
compile 'de.uniks:NetworkParser:[4,):sources18'
}
}
else
{
println "using local networkparser"
compile fileTree(dir: "../NetworkParser", include: ['NetworkParser.jar'])
compile fileTree(dir: "../NetworkParser/build/libs", include: ['networkparser.local.jar'])
}
}

@@ -7,7 +7,7 @@ ext.sharedManifest = manifest {
'Built-By': "${System.properties['user.name']}",
'Location': "${System.properties['user.language']}",
'Version': gitVersion.revision,
'Author': 'Stefan Lindel',
'Author': 'Albert Zuendorf',
'Implementation-Version': gitVersion.major+"."+gitVersion.minor+"."+gitVersion.revision,
'GIT-Revision': gitVersion.revision,
'Java-Version': "${System.properties['java.version']}",
@@ -25,6 +25,18 @@ task sourceJar(type: Jar) {
manifest = project.manifest {from sharedManifest}
}

task localJar(type: Jar) {
def file = new File("build/libs")
group "Jar"
file.mkdirs()
archiveName='sdmlib.local.jar'
from {files(sourceSets.main.output, sourceSets.main.allSource,
configurations.compile.filter({it.name.indexOf("NetworkParser")>=0}).collect({println "BLA: "+it;it.isDirectory() ? it : zipTree(it)}))
}
classifier = 'sources'
manifest = project.manifest {from sharedManifest}
}

task javadocJar(type: Jar) {
from javadoc.outputs.files;
classifier = 'javadoc'

0 comments on commit 1c16918

Please sign in to comment.