forked from hierynomus/license-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (89 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
group = 'de.matlockx'
version = '1.0.0-SNAPSHOT'
allprojects {
apply plugin: 'idea'
repositories {
mavenCentral()
}
apply plugin: 'eclipse'
eclipse {
project {
natures = [
'com.springsource.sts.gradle.core.nature'
]
}
classpath{
//customizing the classes output directory:
defaultOutputDir = file('build-eclipse')
}
}
libraryVersions = [
junit: '4.8.1', mockito: '1.8.5', log4j: '1.2.16', log4jExtras: '1.1'
]
}
subprojects{
version = parent.version
group = parent.group
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// we reset the last modified date of all test result files
// for incremental builds which don't run the tests when no
// chage has been made. otherwise jenkins will throw an exception then caused by
// old test result files
task jenkinsTest{
inputs.files test.outputs.files
doLast{
def timestamp = System.currentTimeMillis()
test.testResultsDir.eachFile { it.lastModified = timestamp }
}
}
build.dependsOn(jenkinsTest)
}
subprojects.each { project.evaluationDependsOn(it.name) }
// aggretgate all javadoc files into one folder at top-level directory
task aggregateJavadoc(type: Javadoc) {
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, 'javadoc')
// Might need a classpath
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
subprojects.each { project.tasks.build.dependsOn(it.tasks.build) }
task drawTaskGraph <<{
File dotFile = new File("$buildDir/tasks.dot")
if(dotFile.exists())
dotFile.delete()
dotFile << "digraph $project.name {"
dotFile << "node [color=lightblue2, style=filled];"
String line = ""
Set<String> lines = []
subprojects.each { sub ->
line = "\"" +project.name + "\" -> \"" + sub.name+"\";\n"
lines.add(line)
}
allprojects.each { proj ->
proj.tasks.each{ Task t ->
if(t.getTaskDependencies() != null && t.getTaskDependencies().getDependencies(t) != null && t.getTaskDependencies().getDependencies(t).size() > 0){
line = "\"" +t.getProject().name + "\" -> \"" + t.getProject().name + ":" + t.name+"\";\n"
lines.add(line)
t.getTaskDependencies().getDependencies(t).each{ d ->
line = "\"" + t.getProject().name + ":" + t.name + "\"" + " -> \"" + d.getProject().name + ":" + d.name +"\";\n"
lines.add(line)
}
}
else{
line = "\"" +t.getProject().name + "\" -> \"" + t.getProject().name + ":" + t.name+"\";\n"
lines.add(line)
}
}
}
lines.each{ l ->
dotFile << l
}
dotFile << "}"
println dotFile
}