annotate build.gradle @ 452:7dcc920e2d57

Moving towards gradle build
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 12 Jun 2012 23:32:12 +0200
parents
children 7b883bf03b14
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
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
3 version = '0.9.0'
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
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
39 dependencies {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
40 testCompile 'junit:junit:4.8.2'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
41 cliCompile 'junit:junit:4.8.2'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
42 cliCompile files(sourceSets.main.output) {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
43 builtBy compileJava
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
44 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
45 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
46
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
47 configurations {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
48 deployJars
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
49 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
50
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
51 def sharedMetaInf = {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
52 from project.file('COPYING')
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
53 }
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 task sourcesJar(type: Jar) {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
57 classifier = 'src'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
58 from sourceSets.main.java, sourceSets.test.java, sourceSets.cli.java
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
59 metaInf sharedMetaInf
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
60 }
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 task cmdlineJar(type: Jar) {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
63 appendix = 'console'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
64 from sourceSets.cli.output
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
65 metaInf sharedMetaInf
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
66 }
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 jar {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
69 manifest {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
70 attributes ("Implementation-Version": version)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
71 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
72 metaInf sharedMetaInf
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
73 }
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 artifacts {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
76 archives sourcesJar, cmdlineJar
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
77 deployJars jar, sourcesJar
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
78 }
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 install {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
81 configuration = configurations.deployJars
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
82 repositories.mavenDeployer {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
83 addFilter('f1') { artifact, file ->
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
84 println file.name
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
85 println artifact.ext
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
86 println file.name - ('.' + artifact.ext)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
87 println ' '
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
88 def fname = file.name - ('.' + artifact.ext)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
89 println fname.endsWith('src')
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
90 fname.endsWith('src')
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
91 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
92 addFilter('f2') { artifact, file ->
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
93 def fname = file.name - ('.' + artifact.ext)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
94 fname.endsWith('console')
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
95 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
96 addFilter('f3') { artifact, file ->
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
97 def fname = file.name - ('.' + artifact.ext)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
98 fname.endsWith(version)
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
99 }
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
100 }
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
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
103 test {
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
104 // <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
105 // <delete dir="${test-repos-root}" quiet="yes"/>
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
106 // <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
107
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
108 systemProperties 'hg4j.tests.repos' : 'value'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
109 systemProperties 'hg4j.tests.remote' : 'http://hg.serpentine.com/tutorial/hello'
7dcc920e2d57 Moving towards gradle build
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
110 }