forked from crate/crate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (101 loc) · 3.05 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "com.github.kt3k.coveralls" version "2.0.1"
}
allprojects {
apply plugin: 'idea'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.7.1.201405082137"
}
group = 'io.crate'
repositories {
mavenCentral()
}
findbugs {
ignoreFailures = true
}
}
def jacocoProjects() {
subprojects.findAll {
it.name != 'es' && it.name != 'testing'
}
}
coveralls {
def tmpSources = []
jacocoProjects().each {
evaluationDependsOn(it.name)
if (it.plugins.withType(JavaPlugin) && it.tasks.withType(Test)) {
tmpSources << it.sourceSets.main.allSource.srcDirs
}
}
sourceDirs = files(tmpSources).files.absolutePath
}
task jacocoReport(type: JacocoReport) {
// tests must have been executed so that execution data for the sub projects is generated
// this task doesn't define a hard dependency on the tests to avoid running them twice in travis-ci
executionData fileTree(project.rootDir.absolutePath).include('**/build/jacoco/*.exec')
jacocoProjects().each {
evaluationDependsOn(it.name)
if (it.plugins.withType(JavaPlugin) && it.tasks.withType(Test)) {
sourceSets it.sourceSets.main
}
}
reports {
xml{
enabled true
destination "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
csv.enabled false
html{
enabled true
destination "${buildDir}/reports/jacoco/jacocoHtml"
}
}
}
subprojects {
idea {
module {
iml {
// ensure testing dependencies come before es dependencies
// when calling tests from intellij
withXml {
def node = it.asNode()
def testingNode = node.component.orderEntry.find {
it.@'module-name' == 'testing'
}
if (testingNode != null) {
def parent = testingNode.parent()
def newNode = new Node(parent, testingNode.name(), testingNode.attributes())
parent.remove(testingNode)
parent.children().add(4, newNode)
}
}
}
}
}
}
idea {
project {
languageLevel = 'JDK_1_7'
ipr {
withXml { provider ->
def node = provider.asNode()
def copyrightManager = node.component.find { it.'@name' == 'CopyrightManager' }
copyrightManager.@default = "CrateASL2"
def aslCopyright = copyrightManager.copyright.find { it.option.find { it.@name == "myName" }?.@value == "CrateASL2" }
if (aslCopyright == null) {
copyrightManager.append(new XmlParser().parse(file("copyright.xml")))
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}