-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
156 lines (135 loc) · 3.99 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.6"
}
}
plugins {
id "org.sonarqube" version "2.1-rc2"
id "com.github.hierynomus.license" version "0.13.1"
id "org.unbroken-dome.test-sets" version "1.2.0"
id "com.gradle.plugin-publish" version "0.9.6"
}
apply plugin: "org.sonarqube"
apply plugin: "com.gradle.plugin-publish"
// --- Dependencies ---
// Set all dependencies as root project dependencies too, otherwise they are not added to the pom file.
apply from: "dependencies.gradle"
// --- (Sub-)Project config ---
allprojects {
group = "de.qaware.cloud.deployer"
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
subprojects {
apply plugin: "java"
apply plugin: "maven"
apply plugin: "idea"
apply plugin: "jacoco"
apply plugin: "com.github.hierynomus.license"
apply plugin: "org.unbroken-dome.test-sets"
// dependencies
apply from: "$rootDir/dependencies.gradle"
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "org.slf4j:slf4j-simple:1.7.21"
testCompile "com.github.tomakehurst:wiremock:2.3.1"
testCompile "org.powermock:powermock-module-junit4-rule:1.6.6"
testCompile "org.powermock:powermock-classloading-xstream:1.6.6"
testCompile "org.powermock:powermock-api-mockito:1.6.6"
}
license {
skipExistingHeaders = true
header rootProject.file("LICENSE_HEADER")
includes(["**/*.java"])
mapping {
java = "SLASHSTAR_STYLE"
}
}
jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testJar
}
testSets {
integrationTest { dirName = "integration-test" }
}
sonarqube {
properties {
property "sonar.jacoco.itReportPath", "${buildDir}/jacoco/integrationTest.exec"
property "sonar.jacoco.reportPath", "${buildDir}/jacoco/test.exec"
}
}
}
// --- Tasks ---
task wrapper(type: Wrapper) {
gradleVersion = "3.1"
}
// Override some tasks to achieve jar creation in root project
def subProjects = [
":deployer-commons",
":deployer-dcos",
":deployer-kubernetes",
":deployer-marathon",
":deployer-plugin"
]
jar {
dependsOn = subProjects.collect { it + ":build" }
from files(subProjects.collect { project(it).sourceSets.main.output })
}
javadoc {
source subProjects.collect { project(it).sourceSets.main.allJava }
classpath = files(subProjects.collect { project(it).sourceSets.main.compileClasspath })
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from files(subProjects.collect { project(it).sourceSets.main.allSource })
}
publishPlugins.dependsOn sourcesJar
// --- Plugin config ---
sonarqube {
properties {
property "sonar.java.coveragePlugin", "jacoco"
}
}
pluginBundle {
website = project.websiteUrl
vcsUrl = project.scmUrl
plugins {
deployerPlugin {
id = project.projectId
displayName = project.displayName
description = project.description
tags = ["cloud", "deployment", "marathon", "kubernetes"]
version = project.version
}
}
}