From 4396b6c47d9dbe93b339e8e893739137371565a7 Mon Sep 17 00:00:00 2001
From: Philipp Spohr <spohr.philipp@web.de>
Date: Fri, 28 Jul 2017 21:01:23 +0200
Subject: [PATCH] Assuming Lemon/CPLEX are installed, Gradle now fetches and
 compiles yoshiko

---
 .gitignore   |  6 ------
 build.gradle | 22 +++++++++++++---------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index 803272b..c74338a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,9 +13,3 @@ gradle/wrapper/gradle-wrapper.properties
 /.settings/org.eclipse.buildship.core.prefs
 /.settings/org.eclipse.jdt.core.prefs
 /bin/de
-/CMakeCache.txt
-/Makefile
-/cmake_install.cmake
-
-# CMAKE
-/CMakeFiles
diff --git a/build.gradle b/build.gradle
index 63b951a..69f4b0b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,36 +24,40 @@ Clone task to fetch the required C++ code from the yoshiko repository
 */
 task cloneYoshikoCode {
 
-	
-
 	description = 'Fetches the Yoshiko Source from the github repository for further processing'
 	doLast{
 		if (!(file(yoshikoDir).exists())){
 			logger.info("Yoshiko source files don't exist yet, cloning ...")
 			org.ajoberstar.grgit.Grgit.clone(dir: file(yoshikoDir), uri: 'https://github.com/spqrPh/yoshiko')
+			//TODO: Always checkout a version that is tagged as "stable"
+			mkdir yoshikoDir+"/build"
 		}
 	}
 }
 
 task launchCMake(type: Exec, group: "init") {
-    logger.info("Executing CMAKE in directory:"+workingDir)
+    workingDir yoshikoDir+"/build"
     executable = "cmake"
-    args  yoshikoDir
+    args  ".."
 }
 
-compileCpp.dependsOn launchCMake
 
 cpp {
   applicationType = "clibrary"
+  buildTasksEnabled = false
   exec.with {
-    execPath = "echo"
+    execPath = yoshikoDir+"/build"
     compileCppExecPath = "make"
-    compileCppBaseArgs = ".."
-    compileCppExecWorkingDir = "build"
+    compileCppBaseArgs = ""
+    compileCppExecWorkingDir = yoshikoDir+"/build"
   }
 }
 
-compileJava.dependsOn(cloneYoshikoCode)
+//Task-Chain
+launchCMake.dependsOn cloneYoshikoCode
+compileCpp.dependsOn launchCMake
+compileJava.dependsOn compileCpp
+
 
 repositories {
      maven { url "http://code.cytoscape.org/nexus/content/repositories/snapshots/" }
-- 
GitLab