forked from Netflix/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (123 loc) · 3.34 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
plugins {
id 'nebula.netflixoss' version '11.1.1'
id 'java'
id 'pmd'
id 'com.github.spotbugs' version "4.4.4"
id 'jacoco'
}
group = 'com.netflix.photon'
javadoc {
options.encoding = 'UTF-8'
}
configurations {
jaxb
}
def generated_dir = "generated"
def xsd_dir = "src/main/resources/org"
task generateSources(type:JavaExec) {
inputs.dir "$xsd_dir"
outputs.dir "$generated_dir"
classpath configurations.jaxb
mainClass = 'com.sun.tools.xjc.XJCFacade'
args "-d", "$generated_dir", "$xsd_dir"
}
compileJava {
options.encoding = 'UTF-8'
dependsOn generateSources
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
repositories {
mavenCentral()
/**
* Following represents the location of SNAPSHOTS of RegXMLLib. It should be enabled only when
* necessary to verify changes to the library that are not yet committed to Maven Central.
*/
/*maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}*/
}
spotbugsMain {
enabled = true
excludeFilter = file("codequality/findbugs-excludeFilter-GeneratedCode.xml")
reports {
xml.enabled = false
html.enabled = true
}
}
spotbugsTest {
enabled = false
}
pmd {
ignoreFailures = false
ruleSets = [] // This overwrites the rules that are being added
ruleSetFiles = files("${project.rootDir}/codequality/pmd/ruleset.xml")
}
sourceSets {
main {
java {
srcDir 'generated'
}
}
}
javadoc {
/**
* Following suppresses creation of javadoc for auto-generated code
*/
exclude "**/org/smpte_ra/schemas/**"
exclude "**/org/w3/_2000/_09/xmldsig_/**"
}
dependencies {
jaxb "org.glassfish.jaxb:jaxb-xjc:2.2.11"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
compileOnly "org.slf4j:slf4j-api:latest.release"
/**
* Following includes the RegXMLLib dependency from Maven Central.
*/
implementation "com.sandflow:regxmllib:1.1.5"
/**
* Following should be enabled and the above should be disabled
* when necessary to verify changes to the RegXMLLib library that are
* not yet committed to Maven Central.
*/
/*compile "com.sandflow:regxmllib:${revRegXMLSNAPSHOT}"*/
testImplementation "org.mockito:mockito-core:3.3+"
testImplementation "org.testng:testng:7.5+"
implementation "org.slf4j:slf4j-simple:1.7.2"
implementation "org.slf4j:slf4j-api:1.7.2"
// JAX-B dependencies for JDK 9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
}
test {
useTestNG()
testLogging {
events 'started', 'skipped', 'passed', 'failed'
}
}
/**
* This task should include all the dependencies as a part of the build process
*/
task getDependencies(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'build/libs/'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
//Following line will enable including compile time dependencies as a part of the
//compile and build process.
//assemble.dependsOn getDependencies
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}