comparison 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
comparison
equal deleted inserted replaced
444:b3b1db9301a2 452:7dcc920e2d57
1 def isRelease = false
2
3 version = '0.9.0'
4 description = 'Pure Java API and Toolkit for Mercurial DVCS'
5 group = 'org.tmatesoft.hg4j'
6
7 apply plugin : 'java'
8 apply plugin : 'maven'
9
10 sourceCompatibility = '1.5'
11 targetCompatibility = '1.5'
12
13 sourceSets {
14 main {
15 java {
16 srcDir 'src/'
17 }
18 }
19 test {
20 java {
21 srcDir 'test/'
22 }
23 resources {
24 srcDir 'test-data/'
25 }
26 }
27 cli {
28 java {
29 srcDir 'cmdline/'
30 }
31 }
32 }
33
34 repositories {
35 mavenLocal()
36 mavenCentral()
37 }
38
39 dependencies {
40 testCompile 'junit:junit:4.8.2'
41 cliCompile 'junit:junit:4.8.2'
42 cliCompile files(sourceSets.main.output) {
43 builtBy compileJava
44 }
45 }
46
47 configurations {
48 deployJars
49 }
50
51 def sharedMetaInf = {
52 from project.file('COPYING')
53 }
54
55
56 task sourcesJar(type: Jar) {
57 classifier = 'src'
58 from sourceSets.main.java, sourceSets.test.java, sourceSets.cli.java
59 metaInf sharedMetaInf
60 }
61
62 task cmdlineJar(type: Jar) {
63 appendix = 'console'
64 from sourceSets.cli.output
65 metaInf sharedMetaInf
66 }
67
68 jar {
69 manifest {
70 attributes ("Implementation-Version": version)
71 }
72 metaInf sharedMetaInf
73 }
74
75 artifacts {
76 archives sourcesJar, cmdlineJar
77 deployJars jar, sourcesJar
78 }
79
80 install {
81 configuration = configurations.deployJars
82 repositories.mavenDeployer {
83 addFilter('f1') { artifact, file ->
84 println file.name
85 println artifact.ext
86 println file.name - ('.' + artifact.ext)
87 println ' '
88 def fname = file.name - ('.' + artifact.ext)
89 println fname.endsWith('src')
90 fname.endsWith('src')
91 }
92 addFilter('f2') { artifact, file ->
93 def fname = file.name - ('.' + artifact.ext)
94 fname.endsWith('console')
95 }
96 addFilter('f3') { artifact, file ->
97 def fname = file.name - ('.' + artifact.ext)
98 fname.endsWith(version)
99 }
100 }
101 }
102
103 test {
104 // <property name="test-repos-root" value="${java.io.tmpdir}/hg4j-tests/"/>
105 // <delete dir="${test-repos-root}" quiet="yes"/>
106 // <unjar src="test-data/test-repos.jar" dest="${test-repos-root}"/>
107
108 systemProperties 'hg4j.tests.repos' : 'value'
109 systemProperties 'hg4j.tests.remote' : 'http://hg.serpentine.com/tutorial/hello'
110 }