forked from TouK/sputnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
276 lines (234 loc) · 8.26 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
268
269
270
271
272
273
274
275
276
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.3.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.10.1'
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
apply plugin: 'coveralls'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'pl.allegro.tech.build.axion-release'
scmVersion {
tag {
prefix = 'sputnik'
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
project.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 "http://central.maven.org/maven2" }
jcenter()
}
//noinspection GroovyAssignabilityCheck
dependencies {
compile 'org.apache.httpcomponents:httpclient:4.3.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.0'
compile 'com.intellij:annotations:12.0'
compile 'org.slf4j:slf4j-api:1.7.26'
compile 'org.slf4j:log4j-over-slf4j:1.7.26'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'commons-cli:commons-cli:1.2'
compile 'com.jayway.jsonpath:json-path:2.4.0'
compile 'commons-io:commons-io:2.4'
compile 'org.eclipse.jgit:org.eclipse.jgit:5.5.1.201910021850-r'
compile 'com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.8.8'
// Checkstyle dependencies
compile('com.puppycrawl.tools:checkstyle:8.1') {
exclude group: 'com.google.guava'
}
// PMD dependencies
compile('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'
}
compile('jaxen:jaxen:1.1.6') { //1.1.6 in SpotBugs
exclude group: 'xerces'
exclude group: 'xalan'
exclude group: 'com.ibm.icu'
}
compile('xerces:xercesImpl:2.9.1') {
exclude group: 'xml-apis'
}
// SpotBugs dependencies
compile('com.github.spotbugs:spotbugs:3.1.11') {
exclude group: 'org.slf4j'
}
// Scalastyle http://www.scalastyle.org/
compile 'org.scalastyle:scalastyle_2.10:0.4.0'
// CodeNarc http://codenarc.sourceforge.net/
compile('org.codenarc:CodeNarc:1.4') {
exclude module: 'groovy'
exclude group: 'junit'
}
compile 'org.codehaus.groovy:groovy:2.3.4'
// JSLint
compile 'com.googlecode.jslint4java:jslint4java:2.0.5'
// JSHint
compile 'pl.touk:jshint4j:2.9.5'
// github connector
compile('com.jcabi:jcabi-github:1.0')
compile 'org.glassfish:javax.json:1.0.4'
compile 'com.github.spullara.mustache.java:compiler:0.8.17'
// external processes
compile 'org.zeroturnaround:zt-exec:1.8'
compile 'org.jetbrains.kotlin:kotlin-stdlib:1.3.31'
// ktlint https://github.com/shyiko/ktlint
compile 'com.github.shyiko.ktlint:ktlint-core:0.31.0'
compile 'com.github.shyiko.ktlint:ktlint-ruleset-standard:0.31.0'
// detekt
compile 'io.gitlab.arturbosch.detekt:detekt-core:1.0.0-RC14'
compile 'io.gitlab.arturbosch.detekt:detekt-rules:1.0.0-RC14'
// dependency only for obtaining default configuration
compile 'io.gitlab.arturbosch.detekt:detekt-cli:1.0.0-RC14'
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.9.0'
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
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'javadoc'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
// quick way to copy all project dependencies (jar files) into one directory
// similar to dependency:copy-dependencies
task copyToLib(type: Copy) {
into "$buildDir/lib"
from configurations.runtime
}
artifacts {
//Comment this archives jar due to duplicated jar task with Gradle 5
//https://github.com/gradle/gradle/issues/8213
//https://discuss.gradle.org/t/apply-plugin-signing-broke-in-gradle-5-1-1-and-prints-out-non-existent-task/31418
//archives jar
archives javadocJar
archives sourcesJar
}
jar {
manifest {
attributes("Specification-Title": "Sputnik",
"Specification-Version": scmVersion.version,
"Implementation-Title": "Sputnik",
"Implementation-Version": scmVersion.version)
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://philanthropist.touk.pl/nexus/content/repositories/snapshots//") {
authentication(userName: snapshotUsername, password: snapshotPassword)
}
pom.project {
name 'Sputnik'
packaging 'jar'
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:git@github.com:TouK/sputnik.git'
connection 'scm:git@github.com:TouK/sputnik.git'
developerConnection 'scm:git@github.com: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'
}
}
}
}
}
}