forked from hortonworks/cloudbreak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
183 lines (155 loc) · 4.37 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
buildscript {
repositories {
mavenLocal()
maven { url = "$repoUrl" }
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.ajoberstar:grgit:2.1.0'
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.11'
classpath 'org.ajoberstar.reckon:reckon-gradle:0.8.0'
classpath 'com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2'
}
}
plugins {
id 'org.ajoberstar.grgit' version '2.1.0'
id "com.github.spotbugs" version "2.0.0"
}
if (project.hasProperty("reckon.scope")) {
apply plugin: "org.ajoberstar.reckon"
reckon {
scopeFromProp()
stageFromProp('dev', 'rc', 'final')
}
}
def cmPrivateRepoUser = System.getenv("CM_PRIVATE_REPO_USER") ?: "$defaultCmPrivateRepoUser"
def cmPrivateRepoPassword = System.getenv("CM_PRIVATE_REPO_PASSWORD") ?: "$defaultCmPrivateRepoPassword"
def env = project.hasProperty('env') ? project.getProperty('env') : 'local'
ext.config = new ConfigSlurper(env).parse(file("$rootDir/gradle/config/buildConfig.groovy").toURL())
allprojects {
repositories {
mavenLocal()
maven {url = "$cdpRepoUrl"}
maven { url = "$repoUrl" }
}
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.sequenceiq'
configurations {
testRuntime {
exclude group: "org.springframework.cloud"
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
apply plugin: 'jacoco'
sourceCompatibility = 11
targetCompatibility = 11
configurations {
deployerJars
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
all*.exclude group: 'com.google.guava', module: 'guava-jdk5'
}
dependencies {
deployerJars("org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE")
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: "$System.env.NEXUS_URL") {
authentication(userName: "$System.env.NEXUS_USER", password: "$System.env.NEXUS_PASSWORD")
}
}
}
}
spotbugs {
toolVersion = "3.1.11"
excludeFilter = file("$rootProject.projectDir/config/spotbugs/excludeFilter.xml")
effort = "min"
}
jacoco {
toolVersion = "0.8.4"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled true
html.enabled true
}
afterEvaluate {
classDirectories.from = files(classDirectories.files.collect {
fileTree(
dir: it,
exclude: [
'**/converter/mapper/**',
'**/sequenceiq/it/**',
'**/cloudbreak/api/endpoint/**',
'**/cloudbreak/domain/**'
]
)
})
}
}
test {
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled false
html.enabled true
}
}
checkstyle {
toolVersion = "8.11"
}
checkstyleMain {
ignoreFailures = false
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
configProperties = ['config_loc': "$rootDir/config/checkstyle"]
}
checkstyleTest {
ignoreFailures = false
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
test.testLogging.showStandardStreams = project.hasProperty('showStandardStreams')
dependencies {
checkstyle('com.puppycrawl.tools:checkstyle:8.11')
}
task allDeps(type: DependencyReportTask) {}
task status {
doLast {
println grgit.status()
}
}
repositories {
mavenLocal()
maven { url = "$repoUrl" }
mavenCentral()
maven { url "https://cloudbreak-maven.s3.amazonaws.com/releases" }
maven { url "https://repo.spring.io/release" }
maven { url "https://plugins.gradle.org/m2/" }
maven {
authentication {
basic(BasicAuthentication)
}
credentials(PasswordCredentials) {
username "$cmPrivateRepoUser"
password "$cmPrivateRepoPassword"
}
url "https://repository.cloudera.com/cloudera/list/cm-private/"
}
}
}