Mercurial > jhg
annotate build.gradle @ 457:d78cb5ca3053
Get rid of ambiguity in method name
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 18 Jun 2012 17:06:42 +0200 |
parents | 7b883bf03b14 |
children | 55e9588b84b8 |
rev | line source |
---|---|
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 def isRelease = false |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
3 version = '0.9.0-SNAPSHOT' |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 description = 'Pure Java API and Toolkit for Mercurial DVCS' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 group = 'org.tmatesoft.hg4j' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 apply plugin : 'java' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 apply plugin : 'maven' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 sourceCompatibility = '1.5' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 targetCompatibility = '1.5' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 sourceSets { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 main { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 java { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 srcDir 'src/' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 test { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 java { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 srcDir 'test/' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 resources { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 srcDir 'test-data/' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 cli { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 java { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 srcDir 'cmdline/' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
30 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 repositories { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 mavenLocal() |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 mavenCentral() |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
39 configurations { |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
40 deployJars |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
41 } |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
42 |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 dependencies { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 testCompile 'junit:junit:4.8.2' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
45 cliCompile 'junit:junit:4.8.2' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
46 cliCompile files(sourceSets.main.output) { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
47 builtBy compileJava |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
48 } |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
49 deployJars "org.apache.maven.wagon:wagon-http:1.0-beta-2" |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
50 } |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
51 |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
52 def sharedMetaInf = { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
53 from project.file('COPYING') |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
54 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
55 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
56 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
57 task sourcesJar(type: Jar) { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
58 classifier = 'src' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
59 from sourceSets.main.java, sourceSets.test.java, sourceSets.cli.java |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
60 metaInf sharedMetaInf |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
61 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
62 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
63 task cmdlineJar(type: Jar) { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
64 appendix = 'console' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
65 from sourceSets.cli.output |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
66 metaInf sharedMetaInf |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
67 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
68 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
69 jar { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
70 manifest { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
71 attributes ("Implementation-Version": version) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
72 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
73 metaInf sharedMetaInf |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
74 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
75 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
76 artifacts { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
77 archives sourcesJar, cmdlineJar |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
78 deployJars jar, sourcesJar |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
79 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
80 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
81 install { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
82 configuration = configurations.deployJars |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
83 /* |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
84 repositories.mavenDeployer { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
85 addFilter('f1') { artifact, file -> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
86 println file.name |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
87 println artifact.ext |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
88 println file.name - ('.' + artifact.ext) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
89 println ' ' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
90 def fname = file.name - ('.' + artifact.ext) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
91 println fname.endsWith('src') |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
92 fname.endsWith('src') |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
93 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
94 addFilter('f2') { artifact, file -> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
95 def fname = file.name - ('.' + artifact.ext) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
96 fname.endsWith('console') |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
97 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
98 addFilter('f3') { artifact, file -> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
99 def fname = file.name - ('.' + artifact.ext) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
100 fname.endsWith(version) |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
101 } |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
102 } |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
103 */ |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
104 } |
453
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
105 |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
106 uploadArchives { |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
107 configuration = configurations.deployJars |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
108 repositories { |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
109 mavenDeployer { |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
110 configuration = configurations.deployJars |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
111 repository(url: "http://maven.tmatesoft.com/content/repositories/snapshots/") { |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
112 authentication(userName: "", password: "") |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
113 } |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
114 } |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
115 } |
7b883bf03b14
Artifacts upload using gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
452
diff
changeset
|
116 } |
452
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
117 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
118 test { |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
119 // <property name="test-repos-root" value="${java.io.tmpdir}/hg4j-tests/"/> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
120 // <delete dir="${test-repos-root}" quiet="yes"/> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
121 // <unjar src="test-data/test-repos.jar" dest="${test-repos-root}"/> |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
122 |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
123 systemProperties 'hg4j.tests.repos' : 'value' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
124 systemProperties 'hg4j.tests.remote' : 'http://hg.serpentine.com/tutorial/hello' |
7dcc920e2d57
Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
125 } |