-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
104 lines (82 loc) · 2.34 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
allprojects{
apply from: "${rootProject.projectDir}/libraries.gradle"
/* turn off doclint java 8 */
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
repositories {
mavenLocal()
mavenCentral()
}
/* Custimization part - e.g. when you got special repositories
* or an enterprise repo like artifactory or nexus */
File f = new File(rootProject.projectDir,'custom_allprojects.gradle');
if (f.exists()){
apply from: "${rootProject.projectDir}/custom_allprojects.gradle"
}
}
def doAutomateEclipseSetup = ['basheditor-other'];
subprojects {
apply plugin: 'java'
if (doAutomateEclipseSetup.contains(project.name)){
apply plugin: 'eclipse'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}
apply plugin: "maven"
group = "de.jcup.basheditor"
version = "0.8.0"
def buildNr = System.getenv('ci.buildNumber')
// use build number in version
if (buildNr != null && ! buildNr.isEmpty()){
version= version + "_"+buildNr
}
/* Setup UTF-8 for compile AND test compilation*/
[ compileJava, compileTestJava ]*.options*.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_1_8
dependencies{
testCompile library.junit
testCompile library.mockito_all
}
/* per default GRADLE stops the build if one single test fails ...*/
test {
ignoreFailures = false
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
def our_group='bash editor'
/* own task for complete project with sub projects...*/
task testReportAll(type: TestReport) {
description 'Starts all tests for all sub projects and cumulate the results into build folder of root project.'
group our_group
subprojects {
test {
/* stops single reports for each project */
reports.html.enabled = false
}
}
destinationDir = file("$buildDir/reports/allUnitTests")
/* report on the results of the subprojects' test task*/
reportOn subprojects*.test
}
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}