forked from nordic-institute/X-Road
/
build.gradle
247 lines (196 loc) · 5.95 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'org.owasp:dependency-check-gradle:3.1.2'
}
}
plugins {
id "org.sonarqube" version "2.6.2"
}
apply plugin: 'idea'
apply plugin: 'jacoco'
def getRubySourceCheckCommand(def projectPath) {
return ["$rootDir/check_ruby_source.sh", "$projectPath"]
}
repositories {
jcenter()
}
sonarqube {
properties {
property "sonar.host.url", "https://sonarqube.niis.org"
property "sonar.projectKey", "xroad"
property "sonar.projectName", "X-Road"
property "sonar.projectDescription", "Data Exchange Layer"
property "sonar.projectVersion", "6.20.0"
}
}
allprojects {
apply plugin: 'org.owasp.dependencycheck'
dependencyCheck {
outputDirectory = "${project.buildDir}/reports/owasp-dependency-check"
format = "ALL"
suppressionFile = "${project.rootDir}/dependencycheck-suppressions.xml"
analyzers {
experimentalEnabled = true
archiveEnabled = true
jarEnabled = true
centralEnabled = true
nexusEnabled = false
nuspecEnabled = false
assemblyEnabled = false
pyDistributionEnabled = false
pyPackageEnabled = false
rubygemsEnabled = true
cmakeEnabled = false
autoconfEnabled = false
composerEnabled = false
nodeEnabled = false
}
}
sonarqube {
properties {
property "sonar.dependencyCheck.reportPath", "build/reports/owasp-dependency-check/dependency-check-report.xml"
}
}
task allDependencies(type: DependencyReportTask) {}
}
subprojects {
ext {
akkaVersion = "2.4.20"
metricsVersion = "3.2.2"
jettyVersion = "9.4.6.v20170531"
jaxbVersion = "2.2.11"
}
dependencyCheck {
autoUpdate = false
}
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
group = 'ee.ria.xroad'
version = '1.0'
jacoco {
toolVersion = "0.7.7.201606060606"
}
repositories {
mavenCentral()
mavenLocal()
// XXX In case mavenCentral is unreachable, use this mirror instead
// maven {
// url "http://mirrors.ibiblio.org/pub/mirrors/maven2"
// }
// iaikPkcs11Wrapper is located there
//maven {
// url "http://ground.zero.ee/maven2"
//}
// repository containing an up-to-date xerces fork
maven {
url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/"
}
}
configurations {
provided
testArtifacts.extendsFrom testRuntime
}
dependencies {
testCompile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
provided 'org.projectlombok:lombok:1.16.6'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task testJar(type: Jar) {
classifier 'test'
from sourceSets.test.output
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
tasks.withType(JavaExec) {
if (project.hasProperty("args")) {
args = project.getProperty("args").tokenize()
}
}
task buildall(dependsOn: [build, ':proxy-ui:warble', ':center-ui:warble', ':center-service:warble']) {
description = "Builds all that can be built (even the slow tasks)"
}
artifacts {
archives sourcesJar
testArtifacts testJar
}
sourceSets.main.compileClasspath += configurations.provided
sourceSets.test.compileClasspath += configurations.provided
eclipse {
classpath {
plusConfigurations += [configurations.provided]
}
}
idea {
module {
scopes.PROVIDED.plus += [configurations.provided]
}
}
checkstyle {
toolVersion = "8.2"
configDir=file("${project.rootDir}/config/checkstyle")
configFile=file("${configDir}/checkstyle.xml")
ignoreFailures = false
showViolations = false
}
jacocoTestReport {
reports {
xml.enabled true
}
}
apply plugin: "license"
license {
header rootProject.file('LICENSE.txt')
include '**/*.java'
include '**/*.rb'
skipExistingHeaders = true
}
jar {
from rootProject.file('LICENSE.txt')
}
}
configure(subprojects.findAll { it.name.contains('-ui') or it.name.contains('center-service') or it.name.contains('center-common')}) {
apply plugin: "license"
def sources = (fileTree('app') + fileTree('etc') + fileTree('config') + fileTree('test'))
task licenseFormatUi(type:nl.javadude.gradle.plugins.license.License) {
source = sources
}
task licenseFormatUiCheck(type:nl.javadude.gradle.plugins.license.License) {
source = sources
check = true;
}
licenseFormat.dependsOn licenseFormatUi
licenseTest.dependsOn licenseFormatUiCheck
}
configure(subprojects.findAll({ it.name.contains('center-common') or it.name.contains('common-ui') or it.name.contains('proxy-ui')})) {
def licenseSourceAdds = fileTree('lib')
task licenseFormatLib(type: nl.javadude.gradle.plugins.license.License) {
source += licenseSourceAdds
}
task licenseFormatLibCheck(type: nl.javadude.gradle.plugins.license.License) {
source += licenseSourceAdds
check = true
}
licenseFormat.dependsOn licenseFormatLib
licenseTest.dependsOn licenseFormatLibCheck
}
task clean(type: Delete) {
delete "${rootDir}/packages/build"
}
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}