forked from microsoft/azure-devops-intellij
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
265 lines (219 loc) · 7.9 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
/**
* This is the main gradle build file for the Azure DevOps IntelliJ Plugin.
*/
buildscript {
ext {
rdGenVersion = '0.193.37'
}
repositories {
maven {
url "https://cache-redirector.jetbrains.com/www.myget.org/F/rd-snapshots/maven"
}
}
dependencies { classpath "com.jetbrains.rd:rd-gen:$rdGenVersion" }
}
plugins {
id 'org.jetbrains.intellij' version '0.4.1' apply false
id "org.jetbrains.kotlin.jvm" version "1.3.50" apply false
id "de.undercouch.download" version "4.0.0"
}
/**
*This is task for update Gradle wrapper version.
*/
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
apply from: 'dependencies.gradle'
def mainProjects = [project(":L2Tests"), project(":plugin"), project(':plugin:test-utils')]
/**
* settings common to ALL projects (even the root level project)
*/
allprojects {
repositories {
flatDir {
dirs externalDependenciesDirectory
}
mavenCentral()
maven {
url "https://cache-redirector.jetbrains.com/www.myget.org/F/rd-snapshots/maven"
}
}
}
/**
* settings shared by the main projects (part 1)
*/
configure(mainProjects) {
configurations {
codeAnalysisLibs
// Some our dependencies should be included *before* dependencies from IDEA (e.g. junit, jackson-databind). IDEA
// has some versions of these dependencies that sometimes break tests (see comments for particular dependencies
// included into this configuration for details).
priorityTestCompile
}
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'findbugs'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
main {
compileClasspath += configurations.codeAnalysisLibs
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
test {
def setUpDependencies = { originalCollection ->
configurations.priorityTestCompile + originalCollection + configurations.codeAnalysisLibs
}
compileClasspath = setUpDependencies(compileClasspath)
runtimeClasspath = setUpDependencies(runtimeClasspath)
java {
srcDir 'test'
}
}
}
test {
forkEvery = 10
}
}
/**
* specific settings for each project
*/
project(":plugin") {
apply plugin: 'org.jetbrains.intellij'
dependencies {
compile project(":client:connector")
testRuntime project(":plugin:test-utils")
}
version buildNumber
intellij {
version = ideaVersion
plugins = ['git4idea']
pluginName = 'com.microsoft.vso.idea'
updateSinceUntilBuild = false
// buildPlugin and runIde should depend on the reactive backend
def reactiveBackend = file("../client/backend/build/install")
task prepareBackendSandbox(type: Copy, dependsOn: ":client:backend:installDist") {
from reactiveBackend
into file("${prepareSandbox.destinationDir}/${prepareSandbox.pluginName}")
}
prepareSandbox.finalizedBy(prepareBackendSandbox)
}
jar {
baseName 'com.microsoft.alm.plugin.idea'
}
task showVersion() {
println("version = " + buildNumber)
println("ideaVersion = " + ideaVersion)
}
task zip(dependsOn: ['buildPlugin','test']) {}
}
project(':plugin:test-utils') {
apply plugin: 'org.jetbrains.intellij'
dependencies {
compile project(':plugin')
}
intellij {
version = ideaVersion
}
}
project(":L2Tests") {
apply plugin: 'org.jetbrains.intellij'
intellij {
version = ideaVersion
plugins = ['git4idea']
}
dependencies {
// The plugin relies on an outdated version of jackson-databind being available in the classpath (it is a
// required transitive dependency of com.microsoft.alm:com.microsoft.alm.client with no newer version
// available). It is available in the product because of how IDEA classloaders work, but it gets overridden by
// IDEA's instance of jackson-databind in tests. We have to load right version of the library by moving it on
// top of the classpath.
priorityTestCompile 'com.fasterxml.jackson.core:jackson-databind:2.4.1'
compile project(':plugin')
testCompile project(':plugin:test-utils')
}
jar {
baseName 'com.microsoft.alm.L2'
}
test {
forkEvery = 1
}
test.onlyIf { "true".equalsIgnoreCase(System.getenv("MSVSTS_INTELLIJ_RUN_L2_TESTS")) }
}
/**
* settings shared by the main projects (part 2)
*/
configure(mainProjects) {
dependencies {
// Dependencies of ':com.microsoft.alm.client:0.4.3-SNAPSHOT'
compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
compile 'commons-codec:commons-codec:1.10'
compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.4.1'
// Microsoft ALM libraries that are managed by the dependencies.gradle script
compile ':com.microsoft.alm.client:0.4.3-SNAPSHOT'
compile ':com.microsoft.alm.client.build2:0.4.3-SNAPSHOT'
compile ':com.microsoft.alm.client.core:0.4.3-SNAPSHOT'
compile ':com.microsoft.alm.client.distributedtask:0.4.3-SNAPSHOT'
compile ':com.microsoft.alm.client.sourcecontrol:0.4.3-SNAPSHOT'
compile ':com.microsoft.alm.client.workitemtracking:0.4.3-SNAPSHOT'
codeAnalysisLibs 'com.google.code.findbugs:annotations:3.0.0'
compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.28'
compile group: 'org.glassfish.jersey.connectors', name: 'jersey-apache-connector', version: '2.28'
compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: '2.28'
compile (group: 'org.apache.httpcomponents', name: 'httpclient-win', version: '4.4.1') {
exclude group: 'net.java.dev.jna', module: 'jna'
exclude group: 'net.java.dev.jna', module: 'jna-platform'
}
compile (group: 'com.microsoft.alm', name: 'auth-core', version: '0.6.4') {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
// IDEA has two other junit versions embedded into it: 3.8.1 (junit.jar) and 4.12 (junit-4.12.jar). We need our
// version to take priority.
priorityTestCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.1'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.1'
testCompile group: 'org.powermock', name: 'powermock-classloading-xstream', version: '1.7.1'
testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
tasks.withType(FindBugs) {
ignoreFailures = true
reports {
html { enabled = true }
xml.enabled = !html.enabled
}
}
/**
* Open source prep
*/
checkstyle {
toolVersion = "6.1"
ignoreFailures = false
configFile = file "${rootDir}/config/checkstyle/custom-rules.xml"
configProperties = [
'checkstyle.java.header': "${rootDir}/config/checkstyle/java.header"
]
}
pmd {
toolVersion = "5.0.3"
ignoreFailures = true
ruleSetFiles = files "${rootDir}/config/pmd/custom-pmd-rules.xml"
}
/**
* Static code analysis tools
*/
findbugs {
toolVersion = "3.0.0"
}
}