do all the samples prep in a doFirst function in test
@@ -149,6 +149,41 @@ dependencies {
}
test {
+
+ doFirst {
+ if(project.hasProperty("downloadOrionMigrationSamples")) {
+
+ def samplesDir = file("${buildDir}/resources/test/samples/")
+
+ delete samplesDir
+
+ ant.get(src: "https://github.com/ConsenSys/orion-to-tessera-migration-samples/archive/master.zip",
+ dest: "$buildDir/samples.zip", skipexisting: true,verbose:true)
+
+ def zipFile = file("${buildDir}/samples.zip")
+
+ copy {
+ from zipTree(zipFile)
+ into file("${buildDir}/resources/test/")
+ }
+
+
+ mkdir samplesDir
+
+ def expandedDir = file("${buildDir}/resources/test/orion-to-tessera-migration-samples-master/")
+
+ copy {
+ from expandedDir
+ into samplesDir
+ }
+
+ delete expandedDir
+
+
+
+ }
+ }
+
systemProperty("javax.xml.bind.JAXBContextFactory", "org.eclipse.persistence.jaxb.JAXBContextFactory")
systemProperty("javax.xml.bind.context.factory", "org.eclipse.persistence.jaxb.JAXBContextFactory")
forkEvery = 1;
@@ -161,13 +196,7 @@ test {
-task downloadAndUnpackSamples {
- if(project.hasProperty("downloadOrionMigrationSamples")) {
- ant.get(src: "https://github.com/ConsenSys/orion-to-tessera-migration-samples/archive/master.tar.gz", dest: "$buildDir/samples.tar.gz", skipexisting: true,verbose:true)
- ant.untar(src: "$buildDir/samples.tar.gz", dest: "$buildDir/resources/test/samples",overwrite: false,compression:"gzip")
- }
-
-}
//modularity.disableEffectiveArgumentsAdjustment()
+
