forked from Netflix/photon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
117 lines (96 loc) · 2.51 KB
/
Copy pathbuild.gradle
File metadata and controls
117 lines (96 loc) · 2.51 KB
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
plugins {
id 'java'
id 'pmd'
id 'jacoco'
id 'nebula.release' version '20.1.0'
id 'nebula.netflixoss' version '11.6.0'
}
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()
}
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 {
implementation 'com.github.spotbugs:spotbugs-annotations:latest.release'
implementation "com.sandflow:regxmllib:1.2.+"
testImplementation "org.mockito:mockito-core:3.3+"
testImplementation "org.testng:testng:7.5+"
implementation "org.slf4j:slf4j-simple:latest.release"
implementation "org.slf4j:slf4j-api:latest.release"
runtimeOnly 'software.amazon.nio.s3:aws-java-nio-spi-for-s3:latest.release'
// JAX-B dependencies for JDK 9+
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.5"
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
// Add JAXB XJC tool for code generation
jaxb 'org.glassfish.jaxb:jaxb-xjc:4.0.5'
}
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/'
}
tasks.named('sourcesJar') {
dependsOn generateSources
}
tasks.named('licenseMain') {
dependsOn generateSources
}
jacocoTestReport {
reports {
xml.required = true
html.required = false
}
}