-
Notifications
You must be signed in to change notification settings - Fork 117
/
build.gradle
267 lines (232 loc) · 8.07 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
classpath 'pl.allegro.tech.build:axion-release-plugin:1.10.1'
}
}
plugins {
id 'java'
id 'java-library'
id 'application'
id 'maven-publish'
id 'signing'
id 'idea'
id 'eclipse'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.10.2'
id 'pl.allegro.tech.build.axion-release' version '1.12.1'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'org.jetbrains.kotlin.jvm' version '1.7.0'
}
scmVersion {
tag {
prefix = 'sputnik'
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
project.version = findProperty("version") ?: scmVersion.version
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'pl.touk'
mainClassName = 'pl.touk.sputnik.Main'
run {
// You can launch Sputnik having only build.gradle file in your repo and executing:
// gradle run -Dexec.args="--conf example.properties --changeId 1234 --revisionId 4321"
def arguments = System.getProperty("exec.args")
if (arguments) {
// Need to split the space-delimited value in the exec.args
args arguments.split()
}
// change working directory and run sputnk from workspace
def newWorkingDir = System.getProperty("exec.workingDir")
if (newWorkingDir) {
workingDir = newWorkingDir
}
}
repositories {
mavenCentral()
maven { url "https://central.maven.org/maven2" }
}
//noinspection GroovyAssignabilityCheck
dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.8'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.3.0'
implementation 'com.intellij:annotations:12.0'
implementation 'org.slf4j:slf4j-api:1.7.26'
implementation 'org.slf4j:log4j-over-slf4j:1.7.26'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'commons-cli:commons-cli:1.4'
implementation 'com.jayway.jsonpath:json-path:2.4.0'
implementation 'commons-io:commons-io:2.4'
implementation 'org.eclipse.jgit:org.eclipse.jgit:5.5.1.201910021850-r'
implementation 'com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.9.3'
// Checkstyle dependencies
implementation('com.puppycrawl.tools:checkstyle:8.1') {
exclude group: 'com.google.guava'
}
// PMD dependencies
implementation('net.sourceforge.pmd:pmd-java:6.0.0') {
exclude group: 'jaxen'
exclude group: 'xerces'
exclude group: 'junit'
exclude group: 'org.apache.ant'
exclude group: 'org.ow2.asm'
}
implementation('jaxen:jaxen:1.2.0') { //1.2.0 in SpotBugs
exclude group: 'xerces'
exclude group: 'xalan'
exclude group: 'com.ibm.icu'
}
implementation('xerces:xercesImpl:2.9.1') {
exclude group: 'xml-apis'
}
// SpotBugs dependencies
implementation('com.github.spotbugs:spotbugs:4.2.0') {
exclude group: 'org.slf4j'
}
// Scalastyle http://www.scalastyle.org/
implementation 'org.scalastyle:scalastyle_2.10:0.4.0'
// CodeNarc http://codenarc.sourceforge.net/
implementation('org.codenarc:CodeNarc:1.4') {
exclude module: 'groovy'
exclude group: 'junit'
}
implementation 'org.codehaus.groovy:groovy:2.3.4'
// JSLint
implementation 'com.googlecode.jslint4java:jslint4java:2.0.5'
// JSHint
implementation 'pl.touk:jshint4j:2.9.5'
// github connector
implementation 'com.jcabi:jcabi-github:1.0'
implementation 'org.glassfish:javax.json:1.0.4'
implementation 'com.github.spullara.mustache.java:compiler:0.8.17'
// external processes
implementation 'org.zeroturnaround:zt-exec:1.8'
// ktlint https://github.com/shyiko/ktlint
implementation 'com.pinterest.ktlint:ktlint-core:0.45.2'
implementation 'com.pinterest.ktlint:ktlint-ruleset-standard:0.45.2'
// detekt
implementation 'io.gitlab.arturbosch.detekt:detekt-tooling:1.20.0'
runtimeOnly 'io.gitlab.arturbosch.detekt:detekt-core:1.20.0'
runtimeOnly 'io.gitlab.arturbosch.detekt:detekt-rules:1.20.0'
// transitive dependency that used non-SSL version of Maven Central
// and version 1.74 that was not found
implementation 'com.beust:jcommander:1.78'
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.4'
testCompileOnly 'org.projectlombok:lombok:1.18.4'
// Test dependencies
testImplementation "org.junit.jupiter:junit-jupiter-api:5.4.0"
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.4.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.4.0"
testImplementation 'org.junit.platform:junit-platform-launcher:1.1.0'
testImplementation 'org.assertj:assertj-core:3.18.1'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.mockito:mockito-junit-jupiter:2.28.2'
testImplementation('com.github.tomakehurst:wiremock:2.18.0') {
exclude group: 'junit'
}
}
test {
useJUnitPlatform()
}
// Jacoco + coveralls
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
java {
withJavadocJar()
withSourcesJar()
}
shadowJar {
zip64 true
}
jar {
manifest {
attributes("Specification-Title": "Sputnik",
"Specification-Version": scmVersion.version,
"Implementation-Title": "Sputnik",
"Implementation-Version": scmVersion.version)
}
}
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'sputnik'
from components.java
pom {
groupId = 'pl.touk'
name = 'Sputnik'
description = 'Static code review for your Gerrit and Stash patchsets. Runs Checkstyle, PMD and SpotBugs for you!'
url = 'https://github.com/TouK/sputnik/'
scm {
url = 'scm:[email protected]:TouK/sputnik.git'
connection = 'scm:[email protected]:TouK/sputnik.git'
developerConnection = 'scm:[email protected]:Touk/sputnik.git'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'tomasz_kalkosinski'
name = 'Tomasz Kalkosinski'
}
developer {
id = 'marcin_cylke'
name = 'Marcin Cylke'
}
developer {
id = 'piotr_jagielski'
name = 'Piotr Jagielski'
}
developer {
id = 'karol_lassak'
name = 'Karol Lassak'
}
developer {
id = 'dominik_przybysz'
name = 'Dominik Przybysz'
}
developer {
id = 'henning_hoefer'
name = 'Henning Hoefer'
}
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}
signing {
useInMemoryPgpKeys(System.getenv('SIGNING_PRIVATE_KEY'), System.getenv('SIGNING_PASSWORD'))
sign publishing.publications.mavenJava
}