forked from Netflix/conductor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
133 lines (106 loc) · 3.24 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
128
129
130
131
132
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:4.0.1'
classpath 'org.apache.ant:ant:1.9.7'
}
}
plugins {
id 'nebula.netflixoss' version '5.1.1'
id 'com.github.kt3k.coveralls' version '2.8.2'
}
// Establish version and status
ext.githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name
apply plugin: 'project-report'
apply from: "$rootDir/versionsOfDependencies.gradle"
allprojects {
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
repositories {
jcenter()
// oss-candidate for -rc.* verions:
maven {
url "https://dl.bintray.com/netflixoss/oss-candidate"
}
}
}
def javaProjects = subprojects.findAll {
it.name != "ui"
}
configure(javaProjects) {
apply plugin: 'nebula.netflixoss'
apply plugin: 'java'
apply plugin: 'project-report'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
testCompile "junit:junit:${revJUnit}"
testCompile("org.mockito:mockito-core:${revMockito}") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
}
group = "com.netflix.${githubProjectName}"
tasks.withType(Test) {
maxParallelForks = 100
}
license {
excludes(['**/*.txt', '**/*.conf', '**/*.properties', '**/*.json', '**/swagger-ui/*'])
}
task licenseFormatTests (type:nl.javadude.gradle.plugins.license.License) {
source = fileTree(dir: "src/test").include("**/*")
}
licenseFormat.dependsOn licenseFormatTests
tasks.withType(Test) {
task ->
// set heap size for the test JVM(s)
minHeapSize = "256m"
maxHeapSize = "2g"
jacocoTestReport.executionData += files("$buildDir/jacoco/${task.name}.exec")
}
jacocoTestReport {
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
}
/**********************************
* Coverage Tasks
**********************************/
task codeCoverageReport(type: JacocoReport, group: "Coverage reports") {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
dependsOn subprojects*.test
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled = true
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.destination new File("${buildDir}/reports/jacoco/html")
csv.enabled = false
}
afterEvaluate {
// Exclude generated files from top-level coverage report
classDirectories = files(
classDirectories.files.collect {
fileTree(
dir: it
)
}
)
}
}
coveralls {
sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${project.buildDir}/reports/jacoco/report.xml"
}
tasks.coveralls {
group = "Coverage reports"
description = "Uploads the aggregated coverage report to Coveralls"
dependsOn codeCoverageReport
}