This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
/
build.gradle
135 lines (122 loc) Β· 3.91 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
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
buildscript {
ext {
es_version = "7.10.2"
}
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${es_version}"
}
}
plugins {
id 'nebula.ospackage' version "8.3.0"
id 'java-library'
id 'checkstyle'
id "io.freefair.lombok" version "5.0.0-rc4"
id 'jacoco'
}
// Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{}
repositories {
mavenCentral() // For Elastic Libs that you can use to get started coding until open ES libs are available
}
ext {
opendistroVersion = '1.13.2'
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}
allprojects {
version = "${opendistroVersion}.0"
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
}
// TODO: fix compiler warnings
compileJava.options.warnings = false
compileJava {
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
doFirst {
// TODO: do not fail build on warnings, need to fix all compiler warnings
options.compilerArgs.remove('-Werror')
// TODO: need to fix all java doc format
options.compilerArgs.remove('-Xdoclint:all')
}
}
// TODO: Similarly, need to fix compiling errors in test source code
compileTestJava.options.warnings = false
compileTestJava {
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
doFirst {
options.compilerArgs.remove('-Werror')
options.compilerArgs.remove('-Xdoclint:all')
}
}
jacoco {
toolVersion = "0.8.5"
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/antlr/parser/**'])
}))
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}
}
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/antlr/parser/**'])
}))
}
}
check.dependsOn jacocoTestCoverageVerification
// TODO: fix code style in main and test source code
subprojects {
apply plugin: 'checkstyle'
checkstyle {
configFile rootProject.file("config/checkstyle/google_checks.xml")
toolVersion "8.20"
configProperties = [
"org.checkstyle.google.suppressionfilter.config": rootProject.file("config/checkstyle/suppressions.xml")]
ignoreFailures = false
}
}
checkstyle {
configFile file("config/checkstyle/checkstyle.xml")
}
checkstyleMain.ignoreFailures = false
checkstyleTest.ignoreFailures = true
configurations.all {
exclude group: "commons-logging", module: "commons-logging"
// enforce 1.1.3, https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379
resolutionStrategy.force 'commons-codec:commons-codec:1.13'
resolutionStrategy.force 'com.google.guava:guava:29.0-jre'
}