forked from microsoft/HydraLab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
106 lines (97 loc) · 3.32 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
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) {
// Official document for lint options: https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html#xlintwarnings
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Xlint:fallthrough" << "-Xlint:static" << "-Xlint:try" << "-Xlint:varargs" << "-Xlint:finally"
}
}
}
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)
reports {
html.enabled true
xml.enabled true
}
}
task packageMacInstaller(type: Zip) {
from 'agent/agent_installer/MacOS/iOS'
archiveName 'Hydra_Agent_Installer_Mac.zip'
destinationDir file('build/installer')
}
task packageWindowsInstaller(type: Zip) {
from 'agent/agent_installer/Windows'
archiveName 'Hydra_Agent_Installer_Windows.zip'
destinationDir file('build/installer')
}
import com.microsoft.hydralab.compile.UMLImageGenerator
task generateUMLImage(group: 'documentation') {
doFirst {
def scanningDirList = ['agent/doc/UML', 'gradle_plugin/doc/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)
}
}
}
}