Permalink
Fetching contributors…
Cannot retrieve contributors at this time
167 lines (143 sloc) 4.18 KB
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
// MAJOR VERSION - Manually set
//----------------------
ext{
majorNumber = 2
}
//----------------------
apply from: 'gradle/ide.gradle'
apply from: 'gradle/version.gradle'
apply from: 'gradle/tasks.gradle'
apply from: 'gradle/mavencentral.gradle'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = "org.sdmlib"
// apply plugins/external files only on jenkins build
// jenkins needs -Pjenkins switch
if (project.hasProperty('jenkins')) {
//apply plugin: 'checkstyle'
apply from: 'gradle/artifactory.gradle'
apply from: 'gradle/mavencentral.gradle'
}
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
sourceSets.main.java.srcDirs += ['src/main/replication']
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.4')
classpath 'org.ajoberstar:gradle-git:0.2.3'
}
}
artifacts {
archives sourceJar, javadocJar, fatJar, pmJar, pmJarVersion
}
test {
if (project.hasProperty('maxParallelForks'))
maxParallelForks = project.maxParallelForks as int
if (project.hasProperty('forkEvery'))
forkEvery = project.forkEvery as int
}
repositories {
jcenter()
//mavenLocal()
mavenCentral()
// NetworkParser
if((gitVersion.isMaster() || isTravisSnapshot())== false) {
maven { url "http://oss.sonatype.org/content/repositories/snapshots" }
}
//if(gitVersion.isMaster() || isTravisSnapshot()) {
// maven { url "https://se.cs.uni-kassel.de/artifactory/libs-release-local" }
//}else{
// maven { url "https://se.cs.uni-kassel.de/artifactory/libs-snapshot-local" }
//}
}
dependencies {
implementation group: "junit", name: "junit", version: "4.+"
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:+"
// https://mvnrepository.com/artifact/jfree/jfreechart
implementation group: 'jfree', name: 'jfreechart', version: '+'
testImplementation 'org.testfx:testfx-junit:4.0+'
testImplementation "io.moquette:moquette-broker:0.10"
testImplementation 'org.slf4j:slf4j-simple:1.7.10'
implementation "com.structurizr:structurizr-client:1.0.0-RC5"
implementation "com.structurizr:structurizr-dot:1.0.0-RC5"
implementation "guru.nidi:graphviz-java:+"
if ( ! project.hasProperty('useLocalDependencies'))
{
if (new File("../NetworkParser/build/libs/networkparser.local.jar").exists() )
{
println "using local networkparser.local.jar"
implementation files("../NetworkParser/build/libs/networkparser.local.jar")
}
else if((gitVersion.isMaster())) // || isTravisSnapshot())== false)
{
println "using master networkparser.jar "
implementation group: "de.uniks", name: "NetworkParser", version: "latest.integration", classifier:"sources18", changing: true
}
else
{
println "using snapshot jar"
implementation 'de.uniks:NetworkParser:4.7.+:sources18'
}
}
else
{
println "using local networkparser"
implementation fileTree(dir: "../NetworkParser/build/libs", include: ['networkparser.local.jar'])
}
}
jacoco {
toolVersion = "0.7.9"
}
jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
executionData = files("$buildDir/jacoco/test.exec")
reports {
xml {
enabled true
//Following value is a file
destination "${buildDir}/reports/jacoco/jacoco.xml"
}
csv.enabled false
html {
enabled true
//Following value is a folder
destination "${buildDir}/reports/jacoco"
}
}
}
test {
testLogging {
events "failed"
exceptionFormat "short"
showStackTraces true
showStandardStreams true
showCauses true
}
}
// Java Compiler Args
tasks.withType(JavaCompile) {
//Suppress underscore warnings
options.compilerArgs << '-Xlint:none'
}
def isTravisSnapshot() {
boolean result=false;
Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {
if("travisci".equalsIgnoreCase(envName)) {
result = "snaphot".equalsIgnoreCase(env.get(envName));
}
}
return result;
}
defaultTasks 'clean', 'test', 'jar'