This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
186 lines (166 loc) · 7.41 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
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 = '[email protected]'
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
}
}