Permalink
Fetching contributors…
Cannot retrieve contributors at this time
186 lines (166 sloc) 7.41 KB
buildscript {
// We use this to specify the globally applied list of repos (see subprojects block later)
repositories {
mavenCentral()
}
}
plugins {
id "org.sonarqube" version "2.5"
}
def jacocoDestination = "$rootProject.buildDir/jacoco/test.exec"
sonarqube {
properties {
property "sonar.host.url", "https://sonar.it-stockinger.de"
property "sonar.login", System.getenv("SONAR_USER")
property "sonar.password", System.getenv("SONAR_PASSWORD")
property "sonar.jacoco.reportPaths", jacocoDestination
property "sonar.buildbreaker.skip", "false"
}
}
allprojects {
// Settings for all projects
repositories.addAll(rootProject.buildscript.repositories)
group "fi.testee"
version file("${rootProject.projectDir}/version.txt").text.trim()
apply plugin: 'jacoco'
}
def ignoreTestFailures = Boolean.valueOf(System.getenv("TESTEEFI_IGNORE_TEST_FAILURES") ?: "false")
subprojects {
buildscript.repositories.addAll(rootProject.buildscript.repositories)
apply plugin: 'maven'
apply plugin: 'signing'
afterEvaluate { Project project ->
if (project.pluginManager.hasPlugin("java")) {
jacocoTestReport.reports.xml.enabled = true
task checkLicenseHeader {
doLast {
def failedFiles = []
file("${project.projectDir}").eachFileRecurse(groovy.io.FileType.FILES) { f ->
if (!f.isFile() || !f.name.endsWith(".java")) {
return
}
if (!f.text.trim().replace("\r", "").startsWith("/*\n * Copyright")) {
failedFiles.add(f)
}
}
if (!failedFiles.isEmpty())
throw new GradleException("The following files don't have a Copyright notice:\n" + failedFiles.join("\n") + "\n");
}
}
build.dependsOn checkLicenseHeader
project.tasks.withType(Test) {
jacoco {
destinationFile = file(jacocoDestination)
}
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
test {
ignoreFailures = ignoreTestFailures
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: System.getenv("MAVEN_USER"), password: System.getenv("MAVEN_PASSWORD"))
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: System.getenv("MAVEN_USER"), password: System.getenv("MAVEN_PASSWORD"))
}
pom.project {
name "TestEE.fi - ${project.name} module"
artifactId "testeefi-${project.name}"
packaging 'jar'
description 'Functional testing for Java-EE.'
url 'http://testee.fi'
scm {
connection 'scm:git:https://github.com/dajudge/testee.fi.git'
developerConnection 'scm:git:https://github.com/dajudge/testee.fi.git'
url 'https://github.com/dajudge/testee.fi'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'alexs'
name = 'Alex Stockinger'
email = 'alex@it-stockinger.de'
organization = 'IT Stockinger'
organizationUrl = 'http://www.it-stockinger.de'
}
}
}
}
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { "true" == System.getenv("TESTEEFI_SIGN_ARTIFACTS") }
sign configurations.archives
}
}
}
}
ext {
// Dependencies
libSlf4j = 'org.slf4j:slf4j-api:1.7.21'
libLogback = 'ch.qos.logback:logback-classic:1.1.7'
libWeld = 'org.jboss.weld:weld-core-impl:2.4.3.Final'
libMockito = 'org.mockito:mockito-core:2.8.47'
libEasyMock = 'org.easymock:easymock:3.4'
libJavaEE = 'javax:javaee-api:7.0'
libCommonsLang3 = 'org.apache.commons:commons-lang3:3.2'
libCommonsIO = 'commons-io:commons-io:2.4'
libJUnit4 = 'junit:junit:4.12'
libJUnit5Engine = 'org.junit.jupiter:junit-jupiter-engine:5.0.0'
libJUnit5Api = 'org.junit.jupiter:junit-jupiter-api:5.0.0'
libJUnit5PlatformLauncher = 'org.junit.platform:junit-platform-launcher:1.0.0'
libJUnit5GradlePlugin = 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
libCucumberJava = 'info.cukes:cucumber-java:1.2.5'
libHamcrest = 'org.hamcrest:hamcrest-all:1.3'
libEclipseLink = 'org.eclipse.persistence:eclipselink:2.6.0'
libHibernate = 'org.hibernate:hibernate-core:5.2.10.Final'
libH2 = 'com.h2database:h2:1.4.196'
libGroovy = 'org.codehaus.groovy:groovy-all:2.4.12'
libPsql = 'org.postgresql:postgresql:42.1.3'
libFlyway = 'org.flywaydb:flyway-core:4.2.0'
libLiquibase = 'org.liquibase:liquibase-core:3.5.3'
libLiquibaseSlf4j = 'com.mattbertolini:liquibase-slf4j:1.2.1'
libScannotation = 'org.scannotation:scannotation:1.0.3'
libJavassist = 'org.javassist:javassist:3.21.0-GA'
libByteBuddy = 'net.bytebuddy:byte-buddy:1.7.1'
libJettyServlet = 'org.eclipse.jetty:jetty-servlet:9.4.6.v20170531'
libJettyWebsocketServer = 'org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.6.v20170531'
libJettyWebsocketClient = 'org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.6.v20170531'
libJerseyServlet = 'com.sun.jersey:jersey-servlet:1.19.4'
libOkhttp3 = 'com.squareup.okhttp3:okhttp:3.8.1'
libJavaxActivation = 'javax.activation:activation:1.1.1'
libJerseyContainerServletCore = 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.24.1'
libJerseyContainerServlet = 'org.glassfish.jersey.containers:jersey-container-servlet:2.24.1'
libJerseyMediaMoxy = 'org.glassfish.jersey.media:jersey-media-moxy:2.24.1'
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}
task clean {
doLast {
delete buildDir
}
}