-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
87 lines (80 loc) · 2.77 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
import com.marcnuri.yakc.schema.api.ApiGeneratorTask
import com.marcnuri.yakc.schema.model.ModelGeneratorTask
plugins {
id 'java-library'
id 'jacoco'
id 'org.sonarqube' version '4.2.1.3168'
id 'org.kordamp.gradle.jandex' version '0.12.0'
}
apply from: 'shared.gradle'
def schemaDir = new File(projectDir, "schema")
def availableSchemaNames = Arrays.asList(
"kubernetes-1.15.12.json",
"kubernetes-1.16.0.json",
"kubernetes-1.18.6.json",
"kubernetes-1.19.6.json",
"kubernetes-1.20.5.json",
"kubernetes-1.21.0.json",
"kubernetes-1.22.13.json",
"kubernetes-1.23.10.json",
"kubernetes-1.24.4.json",
"kubernetes-1.25.6.json",
"kubernetes-1.26.6.json",
"kubernetes-1.27.3.json",
"kubernetes-1.28.2.json",
"kubernetes-1.29.4.json",
"kubernetes-1.30.0.json"
)
def availableSchemas = availableSchemaNames.stream()
.map { s -> new File(schemaDir, s) }
.toArray{ i -> new File[i]}
task generateModel(type: ModelGeneratorTask) {
group = 'generators'
packageName = 'com.marcnuri.yakc'
schemas = availableSchemas
templatesDir = new File(schemaDir, "templates")
outputDirectory = new File(projectDir, "kubernetes-model")
}
task generateApi(type: ApiGeneratorTask) {
group = 'generators'
packageName = 'com.marcnuri.yakc'
schemas = availableSchemas
templatesDir = new File(schemaDir, "templates")
outputDirectory = new File(projectDir, "kubernetes-api")
}
allprojects {
apply plugin: 'java-library'
apply plugin: 'jacoco'
afterEvaluate {
Project evaluatedProject ->
configurePublishing(evaluatedProject)
}
}
task jacocoRootReport(type: JacocoReport) {
group = 'verification'
dependsOn = subprojects.test
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
reports {
xml.enabled true
csv.enabled true
html.enabled true
}
}
sonar {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectKey", "manusa_yakc"
property "sonar.organization", "manusa-github"
property "sonar.cpd.exclusions", "kubernetes-api/**/*,kubernetes-model/**/*"
property "sonar.coverage.exclusions", "quickstarts/**/*"
property "sonar.links.homepage", "https://github.com/manusa/yakc"
property "sonar.links.ci", "https://github.com/manusa/yakc/actions"
property "sonar.links.scm", "https://github.com/manusa/yakc"
property "sonar.links.issue", "https://github.com/manusa/yakc/issues"
property "sonar.coverage.jacoco.xmlReportPaths",
file("$buildDir/reports/jacoco/jacocoRootReport/jacocoRootReport.xml").toString()
}
}