From 4747bc7750f0e883b90106e8e3ea1d8fd182f025 Mon Sep 17 00:00:00 2001
From: David Schneider <david.schneider@bivab.de>
Date: Thu, 29 Nov 2018 21:01:42 +0100
Subject: [PATCH] Add gradle tasks to download and extract and remove prob
 public examples

---
 .gitignore   |  1 +
 build.gradle | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 8c3cba9..1bb8669 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ temp
 out/
 src/test/**/*.tla
 src/test/**/*.cfg
+public_examples
diff --git a/build.gradle b/build.gradle
index 3d41462..1c6c787 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,6 +4,7 @@ plugins {
     id 'maven'
     id 'jacoco'
     id 'findbugs'
+    id "de.undercouch.download" version "3.4.3"
 }
 
 project.version = '1.0.4-SNAPSHOT'
@@ -63,13 +64,28 @@ test {
 	//exclude('de/tlc4b/tlc/integration')
 }
 
+task downloadPublicExamples(type: Download) {
+  src 'https://www3.hhu.de/stups/downloads/prob/source/ProB_public_examples.tgz'
+  dest buildDir
+  onlyIfModified true
+}
+
+task extractPublicExamples(dependsOn: downloadPublicExamples, type: Copy) {
+  from tarTree(resources.gzip("${buildDir}/ProB_public_examples.tgz"))
+  into projectDir
+}
+
+clean {
+  delete "${projectDir}/public_examples"
+}
 
-task regressionTests(type: Test){
+task regressionTests(dependsOn: extractPublicExamples, type: Test){
 	doFirst{ println("Running integration tests") }
 	scanForTestClasses = true
 	//include('de/tlc4b/tlc/integration/probprivate/**')
 	include('de/tlc4b/**')
 }
+check.dependsOn(regressionTests)
 
 // type 'gradle integrationTests jacocoIntegrationTestReport' in order to run the jacoco code coverage analysis
 task jacocoIntegrationTestReport(type: JacocoReport) {
-- 
GitLab