181 lines
4.3 KiB
Groovy
181 lines
4.3 KiB
Groovy
import java.util.concurrent.atomic.AtomicBoolean
|
|
import java.util.concurrent.locks.ReentrantLock
|
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:4.1.1'
|
|
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.2'
|
|
classpath 'org.handte.gradle:gradle-android-eclipse:1.0.0'
|
|
classpath "org.openbakery:xcode-plugin:0.19.1"
|
|
}
|
|
repositories {
|
|
maven {
|
|
url = 'https://project.nes.uni-due.de/nexus/repository/maven-public';
|
|
credentials { username = 'public'; password = 'public' }
|
|
authentication { basic(BasicAuthentication) }
|
|
}
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'maven-publish'
|
|
|
|
// set version for our project
|
|
group = 'com.mowesta'
|
|
version = '1.0.15-SNAPSHOT'
|
|
|
|
// set versions for our libraries
|
|
ext {
|
|
// api dependencies
|
|
versionJavaee = '8.0.0'
|
|
versionJaxb = '2.3.1'
|
|
versionAnnotation = '1.3.2'
|
|
versionSwagger = '1.5.22'
|
|
versionGeojson = '1.8.1'
|
|
// wildfly dependencies, keep in sync
|
|
versionJackson = '2.10.5'
|
|
versionResteasy = '3.13.2.Final'
|
|
versionWildfly = '21.0.0.Final'
|
|
versionPicketbox = '5.0.3.Final'
|
|
versionHibernate = '5.3.18.Final'
|
|
versionHibernateSearch = '5.10.7.Final'
|
|
// built-in infinispan dependency
|
|
versionInfinispan = '9.4.20.Final'
|
|
// testing dependencies
|
|
versionJunit = '4.12'
|
|
versionArquillianContainer = '2.2.0.Final'
|
|
versionArquillianJunit = '1.5.0.Final'
|
|
// thorntail dependencies
|
|
versionH2database = '1.4.196'
|
|
versionThorntail = '2.6.0.Final'
|
|
// other frameworks
|
|
mapstructVersion = '1.3.1.Final'
|
|
// shared android dependencies
|
|
versionAndroidXTest = '1.3.0'
|
|
versionAndroidXAppcompat = '1.2.0'
|
|
versionAndroidXRoom = '2.2.6'
|
|
versionAndroidXPreference = '1.1.1'
|
|
versionRobolectric = '4.5'
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
subprojects {
|
|
apply plugin: 'eclipse'
|
|
|
|
if (name.equals('android-app')) {
|
|
// custom apk configuration
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
artifact file('build/outputs/apk/release/android-app-release.apk')
|
|
}
|
|
}
|
|
}
|
|
} else if (name.equals('android-sdk')) {
|
|
// custom aar configuration
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
artifact file('build/outputs/aar/android-sdk-release.aar')
|
|
version = project.version
|
|
}
|
|
}
|
|
}
|
|
} else if (name.startsWith('ios-')) {
|
|
// custom ios configuration
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
artifact file('build.gradle')
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
// standard java configration
|
|
apply plugin: 'java'
|
|
sourceCompatibility = '1.8'
|
|
|
|
task sourcesJar(type: Jar) {
|
|
classifier = 'sources'
|
|
from(sourceSets.main.allJava)
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components.java)
|
|
artifact(sourcesJar)
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url = 'https://project.nes.uni-due.de/nexus/repository/maven-public';
|
|
credentials { username = 'public'; password = 'public' }
|
|
authentication { basic(BasicAuthentication) }
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
url = version.endsWith('SNAPSHOT') ?
|
|
"https://project.nes.uni-due.de/nexus/repository/maven-snapshots" :
|
|
"https://project.nes.uni-due.de/nexus/repository/maven-releases"
|
|
credentials { username = 'jenkins'; password = System.properties['jenkins.nexus.password'] }
|
|
authentication { basic(BasicAuthentication) }
|
|
}
|
|
}
|
|
}
|
|
|
|
// rename subprojects in eclipse to avoid collisions with other projects
|
|
eclipse.project.name = 'mowesta-' + project.name
|
|
|
|
}
|
|
|
|
tasks.register("generatePomFileForMavenPublication") { }
|
|
|
|
tasks.register("build") { }
|
|
|
|
|
|
// aquire locks to ensure that service-ejb and service-war are not running tests in parallel
|
|
def lock = new ReentrantLock()
|
|
def available = lock.newCondition()
|
|
def busy = new AtomicBoolean()
|
|
def serializedTasks = []
|
|
def sequentialProjects = [ 'service-ejb', 'service-war' ]
|
|
|
|
gradle.taskGraph.beforeTask {
|
|
if (it.name == 'test' && it.project.name in sequentialProjects) {
|
|
serializedTasks << it
|
|
it.doFirst {
|
|
lock.lock()
|
|
while (busy.get()) {
|
|
available.await()
|
|
}
|
|
busy.set(true)
|
|
lock.unlock()
|
|
}
|
|
}
|
|
}
|
|
|
|
gradle.taskGraph.afterTask {
|
|
if (it in serializedTasks) {
|
|
lock.lock()
|
|
busy.set(false)
|
|
available.signal()
|
|
lock.unlock()
|
|
}
|
|
} |