-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbuild.gradle
More file actions
86 lines (74 loc) · 2.23 KB
/
build.gradle
File metadata and controls
86 lines (74 loc) · 2.23 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
plugins {
id "se.bjurr.gradle.bundle-jar-shadow" version "1.6.0"
id "org.jsonschema2pojo" version "1.2.2" apply false
}
allprojects {
javaExtension {
javaVersion = 11
}
staticCodeAnalysisExtension {
maxViolations.set(0)
}
}
// A bit ugly: https://github.com/joelittlejohn/jsonschema2pojo/issues/1594
[
[
project: ":violations-lib-sarif",
from: "${rootDir}/violations-lib/src/main/resources/jsonschemas/sarif-schema.json",
to: "se.bjurr.violations.lib.model.generated.sarif"
],
[
project: ":violations-lib-coverty",
from: "${rootDir}/violations-lib/src/main/resources/jsonschemas/coverity-schema.json",
to: "se.bjurr.violations.lib.model.generated.coverity"
]
].each { codeGen ->
project(codeGen.project) {
apply plugin: 'jsonschema2pojo'
def targetDir = "${rootProject.project(codeGen.project).projectDir}/src/gen/java"
logger.lifecycle("Generating ${codeGen.from} to ${codeGen.to} in ${targetDir}")
jsonSchema2Pojo {
source = files(codeGen.from)
targetDirectory = file(targetDir)
targetPackage = codeGen.to
generateBuilders = true
annotationStyle = 'none'
includeGeneratedAnnotation = false
removeOldOutput = true
}
tasks.named("sourcesJar") {
dependsOn(tasks.named("generateJsonSchema2Pojo"))
}
sourceSets {
main {
java.srcDir(targetDir)
}
}
// Ensure jar is built (needed for project dependencies)
tasks.named("jar") {
enabled = true
}
}
}
project(":violations-lib") {
dependencies {
implementation project(":violations-lib-sarif")
implementation project(":violations-lib-coverty")
implementation "com.google.code.gson:gson:2.13.2"
implementation "org.owasp.encoder:encoder:1.3.1"
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.14.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation "org.assertj:assertj-core:3.27.6"
testImplementation "uk.co.jemos.podam:podam:8.0.2.RELEASE"
testImplementation "com.approvaltests:approvaltests:25.7.0"
testImplementation "com.networknt:json-schema-validator:1.5.9"
}
test {
useJUnitPlatform()
}
shadowExtension {
relocate.set("se:se,com,org")
}
}