forked from TouK/sputnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
242 lines (206 loc) · 7.14 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.3.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.3.2'
}
}
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'
apply plugin: 'com.github.johnrengelman.shadow'
scmVersion {
tag {
prefix = 'sputnik'
}
}
project.version = scmVersion.version
sourceCompatibility = 1.7
targetCompatibility = 1.7
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" }
}
//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.5'
compile 'org.slf4j:log4j-over-slf4j:1.7.7'
compile 'ch.qos.logback:logback-classic:1.0.13'
compile 'org.projectlombok:lombok:1.12.6'
compile 'commons-cli:commons-cli:1.2'
compile 'org.sonarsource.sonar-runner:sonar-runner-api:2.5.1'
compile 'com.jayway.jsonpath:json-path:0.9.1'
compile 'com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.8.8'
// Checkstyle dependencies
compile 'com.puppycrawl.tools:checkstyle:7.3'
// PMD dependencies
compile('net.sourceforge.pmd:pmd-java:5.4.1') {
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 FindBugs
exclude group: 'xerces'
exclude group: 'xalan'
exclude group: 'com.ibm.icu'
}
compile('xerces:xercesImpl:2.9.1') {
exclude group: 'xml-apis'
}
// FindBugs dependencies
compile 'com.google.code.findbugs:findbugs:3.0.0'
compile 'xml-apis:xml-apis:1.0.b2' // this version is needed by FindBugs on runtime
// Scalastyle http://www.scalastyle.org/
compile 'org.scalastyle:scalastyle_2.10:0.4.0'
// CodeNarc http://codenarc.sourceforge.net/
compile('org.codenarc:CodeNarc:0.24.1') {
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.gildur:jshint4j:1.0.1'
// github connector
compile 'com.jcabi:jcabi-github:0.24'
compile 'com.github.spullara.mustache.java:compiler:0.8.17'
// external processes
compile 'org.zeroturnaround:zt-exec:1.8'
// Test dependencies
testCompile 'junit:junit:4.11'
testCompile 'pl.pragmatists:JUnitParams:1.0.5'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.assertj:assertj-core:1.5.0'
testCompile 'com.googlecode.catch-exception:catch-exception:1.2.0'
testCompile('com.github.tomakehurst:wiremock:1.57') {
exclude group: 'log4j'
}
}
// 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 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// 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 {
archives jar
archives shadowJar
archives javadocJar
archives sourcesJar
}
jar {
manifest {
attributes("Specification-Title": "Sputnik",
"Specification-Version": scmVersion.rawVersion.version,
"Implementation-Title": "Sputnik",
"Implementation-Version": scmVersion.rawVersion.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 FindBugs 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'
}
}
}
}
}
}