forked from microsoft/azure-devops-intellij
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
220 lines (189 loc) · 6.41 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
/**
* This is the main gradle build file for the VSO IntelliJ Plugin.
*/
/**
* settings common to ALL projects (even the root level project)
*/
allprojects {
configurations {
ideaSdkLibs
git4ideaLibs
codeAnalysisLibs
}
version = '0.91.0'
repositories {
mavenCentral()
maven {
url "http://artifacts.cloudapp.net:8081/nexus/content/repositories/snapshots"
}
maven {
url "http://artifacts.cloudapp.net:8081/nexus/content/repositories/releases"
}
}
}
/**
* settings shared by each subproject (part 1)
*/
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'findbugs'
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
/**
* specific settings for each project
*/
project(":common") {
}
project(":plugin") {
dependencies {
compile project(':common')
}
}
project(":plugin.idea") {
dependencies {
compile project(':plugin')
testCompile project(':plugin').sourceSets.test.output
}
jar {
baseName 'com.microsoft.alm'
from('.') {
include 'META-INF/plugin.xml'
}
}
task delTestTelemetryPropFile << {
delete 'resources/telemetry/com.microsoft.alm.plugin-telemetry.properties'
}
/**
* Create the plugin zip
*/
task zip(type: Zip, dependsOn: ['test', 'check']) {
into('com.microsoft.alm/lib') {
from configurations.runtime
from configurations.runtime.allArtifacts.files
}
}
}
/**
* settings shared by each subproject (part 2)
*/
subprojects {
dependencies {
ideaSdkLibs fileTree(dir: "$ideaSdk", include: '*.jar')
git4ideaLibs fileTree(dir: "$git4idea", include: '*.jar')
codeAnalysisLibs 'com.google.code.findbugs:annotations:3.0.0'
compile group: 'com.microsoft.vss.sdk.httpclient', name: 'vss-http-client', version: '0.4.2-SNAPSHOT'
compile group: 'com.microsoft.tf', name: 'aad-pat-generator', version: '1.0.1'
compile group: 'com.microsoft.azure', name: 'applicationinsights-web', version: '1.0.0'
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.6'
compile group: 'org.glassfish.jersey.connectors', name: 'jersey-apache-connector', version: '2.6'
compile (group: 'org.apache.httpcomponents', name: 'httpclient-win', version: '4.4.1') {
/* Task 454223: exclude default JNA dependency (would be version 4.1.0 as of this writing) */
exclude group: 'net.java.dev.jna', module: 'jna'
exclude group: 'net.java.dev.jna', module: 'jna-platform'
}
/* Task 454223: anchor JNA dependency to version 3.4.0 to match Android Studio 1.4 and IntelliJ IDEA 14 */
compile group: 'net.java.dev.jna', name: 'jna', version: '3.4.0'
testCompile 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.6.3'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.3'
testCompile group: 'org.powermock', name: 'powermock-classloading-xstream', version: '1.6.3'
}
sourceSets {
main {
compileClasspath += configurations.ideaSdkLibs
compileClasspath += configurations.git4ideaLibs
compileClasspath += configurations.codeAnalysisLibs
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
test {
compileClasspath += configurations.ideaSdkLibs
compileClasspath += configurations.git4ideaLibs
compileClasspath += configurations.codeAnalysisLibs
runtimeClasspath += configurations.ideaSdkLibs
runtimeClasspath += configurations.git4ideaLibs
runtimeClasspath += configurations.codeAnalysisLibs
java {
srcDir 'test'
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
/**
* Dependencies management for Intellij project
*
* The Intellij project expects all dependencies are stored in the 'lib' folder
*/
task cleanLibFolder << {
delete 'lib'
}
/**
* TODO: need to separate the dependencies per subproject to avoid accidental coupling
*/
task copyDependencies(type: Copy, dependsOn: ['copyDependenciesSource', 'copyTestDependencies']) {
from configurations.compile
into 'lib/classes'
}
task copyTestDependencies(type: Copy) {
from configurations.testCompile - configurations.compile
into 'lib/testclasses'
}
task copyDependenciesSource(type: Copy, dependsOn: 'cleanLibFolder') {
def sources = configurations.compile.resolvedConfiguration.resolvedArtifacts.collect { artifact ->
project.dependencies.create([
group : artifact.moduleVersion.id.group,
name : artifact.moduleVersion.id.name,
version : artifact.moduleVersion.id.version,
classifier: 'sources'
])
}
from configurations.detachedConfiguration(sources as Dependency[])
.resolvedConfiguration.lenientConfiguration.getFiles(Specs.SATISFIES_ALL)
include '*-sources.jar'
into file( 'lib/src' )
}
tasks.withType(FindBugs) {
ignoreFailures = true
reports {
html { enabled = true }
xml.enabled = !html.enabled
}
}
/**
* Preparing for release build
*/
task prepRelease(dependsOn: [':plugin.idea:delTestTelemetryPropFile']) {
}
/**
* 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 = "2.0.3"
}
}