comparison build.gradle @ 52:472a9bcacb21 draft default tip

TightVNC 2.7.1.0
author you@cr.ie.u-ryukyu.ac.jp
date Wed, 07 Aug 2013 19:01:17 +0900
parents 4689cc86d6cb
children
comparison
equal deleted inserted replaced
0:4689cc86d6cb 52:472a9bcacb21
1 apply plugin:'java' 1 apply plugin:'java'
2 apply plugin: 'eclipse' 2 apply plugin: 'eclipse'
3 3
4 sourceCompatibility = 1.6 4 sourceCompatibility = 1.6
5 targetCompatibility = 1.6 5 targetCompatibility = 1.6
6 version = '2.5.0' 6 version = '2.7.2'
7 7
8 baseName = 'tightvnc-jviewer' 8 project.ext.baseName = 'tightvnc-jviewer'
9 def buildNo = processBuildNo(version)
9 10
10 defaultTasks 'clean', 'dist' 11 defaultTasks 'clean', 'dist'
11 12
12 configurations { 13 configurations {
13 viewerSwingCompile { extendsFrom compile } 14 viewerSwingCompile { extendsFrom compile }
14 viewerSwingRuntime { extendsFrom viewerSwingCompile, runtime } 15 viewerSwingRuntime { extendsFrom viewerSwingCompile, runtime }
15 } 16 }
16 17
17 sourceSets { 18 sourceSets {
18 viewerSwing { 19 viewerSwing {
19 java { 20 java {
27 java.srcDirs += viewerSwing.java.srcDirs 28 java.srcDirs += viewerSwing.java.srcDirs
28 resources.srcDirs += viewerSwing.resources.srcDirs 29 resources.srcDirs += viewerSwing.resources.srcDirs
29 } 30 }
30 } 31 }
31 32
33 repositories {
34 flatDir {
35 dirs 'src/libs/'
36 }
37 }
38
39 dependencies {
40 viewerSwingCompile group: 'com.jcraft', name: 'jsch', version: '0.1.+', ext: 'jar'
41 viewerSwingRuntime configurations.viewerSwingCompile
42 testCompile group: 'junit', name: 'junit', version: '4.+'
43 }
44
45 def manifestAttributes = ['Main-Class': 'com.glavsoft.viewer.Viewer',
46 'Implementation-Version': "${project.version} (${buildNo})",
47 'Implementation-Title': 'TightVNC Viewer',
48 'Implementation-Vendor': 'GlavSoft LLC.']
49
32 jar { 50 jar {
33 baseName = project.baseName 51 baseName = project.baseName
34 version = null 52 version = null
35 manifest { 53 manifest {
36 attributes 'Main-Class': 'com.glavsoft.viewer.Viewer' 54 attributes manifestAttributes
37 attributes 'Implementation-Version': "${project.version}" 55 }
38 } 56 def runtimeDeps = configurations.viewerSwingRuntime.collect {
39 } 57 it.isDirectory() ? it : zipTree(it)
40 58 }
41 repositories { 59 from(runtimeDeps) {
42 mavenCentral() 60 exclude 'META-INF/**'
43 } 61 }
44 62 }
45 dependencies { 63
46 testCompile group: 'junit', name: 'junit', version: '4.+' 64 task noSshJar (type: Jar, dependsOn: classes) {
47 archives fileTree(dir: 'src/web', include: '*.html') 65 baseName = 'nossh/' + project.baseName
66 version = null
67 manifest {
68 attributes manifestAttributes
69 }
70 from sourceSets.main.output
71 }
72
73 artifacts {
74 archives file('src/web/viewer-applet-example.html')
75 archives noSshJar
48 } 76 }
49 77
50 uploadArchives { 78 uploadArchives {
51 repositories { 79 repositories {
52 add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) { 80 add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) {
53 name = 'repo' 81 addArtifactPattern("$projectDir/dist/${project.baseName}-${project.version}/[artifact].[ext]")
54 addArtifactPattern "$projectDir/dist/${project.baseName}-${project.version}/${project.baseName}.[ext]" 82 }
55 descriptor = 'optional' 83 }
56 checkmodified = true
57 }
58 }
59 uploadDescriptor = false 84 uploadDescriptor = false
60 } 85 }
61 86
62 task dist(dependsOn: uploadArchives) << { 87 task dist(dependsOn: uploadArchives)
63 otherFilesUpload("$projectDir/dist/${project.baseName}-${project.version}") 88
64 } 89 def processBuildNo(currentVersion) {
65 def otherFilesUpload(repoDir) { 90 final String VERSION = 'version'
66 copy { 91 final String BUILD = 'build'
67 from 'src/web' 92
68 include '*-applet-*.html' 93 def lastVersion = currentVersion
69 expand (['archive_name' : project.baseName]) 94 def lastBuild = 0
70 into repoDir 95 def buildNoFile = new File('.build_no')
71 } 96 if ( ! buildNoFile.exists()) {
72 } 97 buildNoFile.createNewFile()
73 98 buildNoFile << "${VERSION}=${lastVersion}\n${BUILD}=${lastBuild}"
74 99 }
75 100 def versions = [:]
76 101 buildNoFile.eachLine {
77 102 def splitted = it.split('=')
78 103 if (splitted.size() == 2) {
79 104 def (key, value) = splitted
80 105 switch(key.trim()) {
81 106 case VERSION:
82 107 lastVersion = value.trim()
83 108 break
84 109 case BUILD:
85 110 try {
86 111 lastBuild = value != null ? value.trim() as Integer : 0
87 112 } catch (NumberFormatException) {}
88 113 versions[lastVersion] = lastBuild
89 114 break
90 115 }
91 116 }
92 117 }
93 118 lastVersion = versions[currentVersion]
94 119 if (null == lastVersion) {
95 120 versions[currentVersion] = 0
96 121 }
97 122 ++versions[currentVersion]
98 123 def outString = ''
99 124 versions.each { v, b ->
100 125 outString += "${VERSION}=${v}\n${BUILD}=${b}\n\n"
101 126 }
102 127 buildNoFile.write(outString)
103 128 versions[currentVersion]
104 129 }
105 130
106 131
107 132
108 133
109 134
110 135
111 136
112 137
113 138
114 139
115 140
116 141
117 142
118 143
119 144
120 145
121 146
122 147
123 148
124 149
125 150
126 151
127 152
128 153
129 154
130 155
131 156
132 157
133 158
134 159
135 160
136 161
137 162
138 163
139 164
140 165
141 166
142 167
143 168
144 169
145 170
146 171
147 172
148 173
149 174
150 175
151 176
152 177
153 178
154 179
155 180
156 181
157 182
158 183
159 184
160 185
161 186
162 187
163 188
164 189
165 190
166 191
167 192
168 193
169 194
170 195
171 196
172 197
173 198
174 199
175 200
176 201
177 202
178 203
179 204
180 205
181 206
182 207
183 208
184 209
185 210
186 211
187 212
188 213
189 214
190 215
191 216
192 217
193 218
194 219
195 220
196 221
197 222
198 223
199 224
200 225
201 226
202 227
203 228
204 229
205 230
206 231
207 232
208 233
209 234
210 235
211 236
212 237
213 238
214 239
215 240
216 241
217 242
218 243
219 244
220 245
221 246
222 247
223 248
224 249
225 250
226 251
227 252
228 253
229 254
230 255
231 256
232 257
233 258
234 259
235 260
236 261
237 262
238 263
239 264
240 265
241 266
242 267
243 268
244 269
245 270
246 271
247 272
248 273
249 274
250 275
251 276
252 277
253 278
254 279
255 280
256 281
257 282
258 283
259 284
260 285
261 286
262 287
263 288
264 289
265 290
266 291
267 292
268 293
269 294
270 295
271 296
272 297
273 298
274 299
275 300
276 301
277 302
278 303
279 304
280 305
281 306
282 307
283 308
284 309
285 310
286 311
287 312
288 313
289 314
290 315
291 316
292 317
293 318
294 319
295 320
296 321
297 322
298 323
299 324
300 325
301 326
302 327
303 328
304 329
305 330
306 331
307 332
308 333
309 334
310 335
311 336
312 337
313 338
314 339
315 340
316 341
317 342
318 343
319 344
320 345
321 346
322 347
323 348
324 349
325 350
326 351
327 352
328 353
329 354
330 355
331 356
332 357
333 358
334 359
335 360
336 361
337 362
338 363
339 364
340 365
341 366
342 367
343 368
344 369
345 370
346 371
347 372
348 373
349 374
350 375
351 376
352 377
353 378
354 379
355 380
356 381
357 382
358 383
359 384
360 385
361 386
362 387
363 388
364 389
365 390
366 391
367 392
368 393
369 394
370 395
371 396
372 397
373 398
374 399
375 400
376 401
377 402
378 403
379 404
380 405
381 406
382 407
383 408
384 409
385 410
386 411
387 412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491