# HG changeset patch # User Artem Tikhomirov # Date 1339536732 -7200 # Node ID 7dcc920e2d57d5850ee9f08ac863251460565bd3 # Parent b3b1db9301a229c1092b35c350b16fa0aa7256f9 Moving towards gradle build diff -r b3b1db9301a2 -r 7dcc920e2d57 build.gradle --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build.gradle Tue Jun 12 23:32:12 2012 +0200 @@ -0,0 +1,110 @@ +def isRelease = false + + version = '0.9.0' + description = 'Pure Java API and Toolkit for Mercurial DVCS' + group = 'org.tmatesoft.hg4j' + + apply plugin : 'java' + apply plugin : 'maven' + + sourceCompatibility = '1.5' + targetCompatibility = '1.5' + + sourceSets { + main { + java { + srcDir 'src/' + } + } + test { + java { + srcDir 'test/' + } + resources { + srcDir 'test-data/' + } + } + cli { + java { + srcDir 'cmdline/' + } + } + } + + repositories { + mavenLocal() + mavenCentral() + } + + dependencies { + testCompile 'junit:junit:4.8.2' + cliCompile 'junit:junit:4.8.2' + cliCompile files(sourceSets.main.output) { + builtBy compileJava + } + } + + configurations { + deployJars + } + + def sharedMetaInf = { + from project.file('COPYING') + } + + + task sourcesJar(type: Jar) { + classifier = 'src' + from sourceSets.main.java, sourceSets.test.java, sourceSets.cli.java + metaInf sharedMetaInf + } + + task cmdlineJar(type: Jar) { + appendix = 'console' + from sourceSets.cli.output + metaInf sharedMetaInf + } + + jar { + manifest { + attributes ("Implementation-Version": version) + } + metaInf sharedMetaInf + } + + artifacts { + archives sourcesJar, cmdlineJar + deployJars jar, sourcesJar + } + + install { + configuration = configurations.deployJars + repositories.mavenDeployer { + addFilter('f1') { artifact, file -> + println file.name + println artifact.ext + println file.name - ('.' + artifact.ext) + println ' ' + def fname = file.name - ('.' + artifact.ext) + println fname.endsWith('src') + fname.endsWith('src') + } + addFilter('f2') { artifact, file -> + def fname = file.name - ('.' + artifact.ext) + fname.endsWith('console') + } + addFilter('f3') { artifact, file -> + def fname = file.name - ('.' + artifact.ext) + fname.endsWith(version) + } + } + } + + test { +// +// +// + + systemProperties 'hg4j.tests.repos' : 'value' + systemProperties 'hg4j.tests.remote' : 'http://hg.serpentine.com/tutorial/hello' + } \ No newline at end of file