-
Notifications
You must be signed in to change notification settings - Fork 101
/
build.gradle
127 lines (116 loc) · 4.45 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
apply from: "common.gradle"
apply plugin: "io.freefair.lombok"
apply plugin: "jacoco"
jacoco {
toolVersion = "0.8.8"
reportsDir = file('build/reports/jacoco')
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}
/*
gradle.projectsEvaluated {
tasks.withType(JacocoCoverageVerification) {
violationRules {
rule {
limit {
minimum = 0.5
}
}
}
}
}
*/
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.1.RELEASE")
classpath "io.freefair.gradle:lombok-plugin:4.1.4"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.14'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs += [
"-Xlint:unchecked",
"-Xlint:deprecation",
"-Xlint:fallthrough",
"-Xlint:static",
"-Xlint:try",
"-Xlint:varargs",
"-Xlint:finally",
"-Werror"
]
}
}
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn(subprojects.test)
def projects = ['center', 'common', 'agent', 'sdk', 'gradle_plugin', 'runner']
def jacocoProjects = subprojects.findAll { projects.contains(it.getName()) }
additionalSourceDirs.from = files(jacocoProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(jacocoProjects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(jacocoProjects.sourceSets.main.output)
executionData.from = files(jacocoProjects.jacocoTestReport.executionData)
// exclude files under resources folder to avoid coverage report error
additionalSourceDirs.from = additionalSourceDirs.files.findAll { !it.path.contains(File.separator + "resources" + File.separator + "main") }
sourceDirectories.from = sourceDirectories.files.findAll { !it.path.contains(File.separator + "resources" + File.separator + "main") }
classDirectories.from = classDirectories.files.findAll { !it.path.contains(File.separator + "resources" + File.separator + "main") }
executionData.from = executionData.files.findAll { !it.path.contains(File.separator + "resources" + File.separator + "main") }
// classDirectories.findAll().forEach { println "classDirectories: " + it.path }
// executionData.findAll().forEach { println "executionData: " + it.path }
// sourceDirectories.findAll().forEach { println "sourceDirectories: " + it.path }
// additionalSourceDirs.findAll().forEach { println "additionalSourceDirs: " + it.path }
reports {
html.enabled true
xml.enabled true
}
}
task packageMacInstaller(type: Zip, dependsOn: ':agent:bootJar') {
from 'agent/agent_installer/MacOS/iOS'
from 'agent/build/libs'
archiveName 'HydraLab_Agent_Installer_Mac.zip'
destinationDir file('build/installer')
}
task packageWindowsInstaller(type: Zip, dependsOn: ':agent:bootJar') {
from 'agent/agent_installer/Windows'
from 'agent/build/libs'
archiveName 'HydraLab_Agent_Installer_Windows.zip'
destinationDir file('build/installer')
}
import com.microsoft.hydralab.compile.UMLImageGenerator
task generateUMLImage(group: 'documentation') {
doFirst {
def scanningDirList = ['agent/doc/UML', 'common/doc/UML', 'gradle_plugin/doc/UML', 'docs/UML']
def outputDir = new File(projectDir, 'docs/images/UML')
def generator = new UMLImageGenerator()
scanningDirList.each {
fileTree(new File(projectDir, it)).filter { it.name.endsWith(".puml") }.files.each {
generator.generateUMLImageFromFile(it.absoluteFile, outputDir)
}
}
}
}