changeset 459:55e9588b84b8

Run tests with gradle
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 19 Jun 2012 21:06:53 +0200
parents c95cd5994ba2
children 5311e041d2dd
files build.gradle
diffstat 1 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Tue Jun 19 21:06:21 2012 +0200
+++ b/build.gradle	Tue Jun 19 21:06:53 2012 +0200
@@ -1,6 +1,6 @@
 def isRelease = false
 
-  version = '0.9.0-SNAPSHOT'
+  version = '0.9.5-SNAPSHOT'
   description = 'Pure Java API and Toolkit for Mercurial DVCS'
   group = 'org.tmatesoft.hg4j'
   
@@ -115,11 +115,43 @@
     }
 }
 
+
+ task findOutWhyProjectCopyDoesntWork() << {
+   // files under .hg/ are not copied with copy {}
+   ext.myjar = zipTree( 'test-data/test-repos.jar' )
+   ext.destDir = new File(project.getBuildDir(), "hg4j-tests1/")
+   outputs.dir ext.destDir
+   CopySpec ss = copySpec {
+     from ext.myjar
+     into ext.destDir
+     include '*', '*/.*', '**/.*/*', '**/.*', '**/*', '*/.*/**', '**/**', '.*/**', '**/.hg/*', '**/.hg*'
+     eachFile {element ->
+       println "AAA:$element.relativePath"
+     }
+   }
+   println "includeEmptyDir: $ss.includeEmptyDirs"
+   println "includes: $ss.includes"
+   println "allIncludes: $ss.allIncludes"
+   println "excludes: $ss.excludes"
+   println "allExcludes: $ss.allExcludes"
+ }
+
+
   test {
 // <property name="test-repos-root" value="${java.io.tmpdir}/hg4j-tests/"/>
 // <delete dir="${test-repos-root}" quiet="yes"/>
 // <unjar src="test-data/test-repos.jar" dest="${test-repos-root}"/>
   
-    systemProperties 'hg4j.tests.repos'  : 'value'
+    File testReposRoot = new File(project.getBuildDir(), "hg4j-tests2/");
+    if ( testReposRoot.exists() ) {
+      project.delete(testReposRoot)
+    }
+    testReposRoot.mkdirs();
+    
+    zipTree('test-data/test-repos.jar').visit {element ->
+     element.copyTo(element.relativePath.getFile(testReposRoot))
+    }
+
+    systemProperties 'hg4j.tests.repos'  : testReposRoot
     systemProperties 'hg4j.tests.remote' : 'http://hg.serpentine.com/tutorial/hello'
   }
\ No newline at end of file