From 77e913c1d85304dec269ed489fc4ffef0fff2408 Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Fri, 23 Jul 2021 15:09:42 +0200
Subject: [PATCH] Fix dubious indents and formatting in Gradle scripts

---
 build.gradle              |  152 +++---
 de.prob.core/build.gradle |   26 +-
 tycho_build.gradle        | 1087 +++++++++++++++++--------------------
 3 files changed, 585 insertions(+), 680 deletions(-)

diff --git a/build.gradle b/build.gradle
index 9f27432d..bd42f307 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,11 +1,12 @@
 // to trigger a full tycho build please use 'gradle deleteFromClassPath completeInstall'
 import org.apache.tools.ant.taskdefs.condition.Os
 
-project.ext{
-
-	targetRepositories = ["http://download.eclipse.org/releases/luna/",
-                          "http://rodin-b-sharp.sourceforge.net/updates",
-                          "https://www3.hhu.de/stups/buildlibs/org.rodinp.dev/"]
+project.ext {
+	targetRepositories = [
+		"http://download.eclipse.org/releases/luna/",
+		"http://rodin-b-sharp.sourceforge.net/updates",
+		"https://www3.hhu.de/stups/buildlibs/org.rodinp.dev/",
+	]
 
 	groupID = "de.prob"
 }
@@ -16,7 +17,6 @@ apply from: 'tycho_build.gradle'
 
 
 /*task bMotionStudioHelpCustumBuild(type: Exec){
-
 	commandLine 'ant', '-f','de.bmotionstudio.help/customBuild.xml'
 }
 
@@ -25,26 +25,23 @@ install.dependsOn bMotionStudioHelpCustumBuild
 completeInstall.dependsOn bMotionStudioHelpCustumBuild*/
 
 project(':de.prob.core') {
-
 	repositories {
-	  mavenCentral()
+		mavenCentral()
 	}
 
-
-        def parser_version = '2.5.1'
+	def parser_version = '2.5.1'
 
 	dependencies {
-	 compile group: "de.hhu.stups", name: "answerparser", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "bparser", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "cliparser", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "ltlparser", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "parserbase", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "prologlib", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "unicode", version: parser_version , changing: true
-	 compile group: "de.hhu.stups", name: "theorymapping", version: parser_version , changing: true
-	 compile 'commons-lang:commons-lang:2.6'
+		compile group: "de.hhu.stups", name: "answerparser", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "bparser", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "cliparser", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "ltlparser", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "parserbase", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "prologlib", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "unicode", version: parser_version, changing: true
+		compile group: "de.hhu.stups", name: "theorymapping", version: parser_version, changing: true
+		compile 'commons-lang:commons-lang:2.6'
 	}
-
 }
 
 project(':de.prob.ui') {
@@ -52,98 +49,95 @@ project(':de.prob.ui') {
 		mavenCentral()
 	}
 	dependencies {
-	 	compile 'commons-codec:commons-codec:1.8'
+		compile 'commons-codec:commons-codec:1.8'
 	}
 }
 
 
 def download(address,target) {
-	    def file = new FileOutputStream(target)
-	    def out = new BufferedOutputStream(file)
-	    out << new URL(address).openStream()
-	    out.close()
+	def file = new FileOutputStream(target)
+	def out = new BufferedOutputStream(file)
+	out << new URL(address).openStream()
+	out.close()
 }
 
-task downloadCli  {
+task downloadCli {
 	doLast{
-		def dir = workspacePath+'de.prob.core/prob/'
+		def dir = workspacePath + 'de.prob.core/prob/'
 		delete file(dir)
-	    new File(dir).mkdirs()
+		new File(dir).mkdirs()
 
 		['leopard64':'macos','linux32':'linux','linux64':'linux64','win64':'windows'].each {
-		def n = it.getKey()
-
-		def targetdir = dir+it.getValue()
-		def targetzip = dir+"probcli_${n}.zip"
-		def url = "https://www3.hhu.de/stups/downloads/prob/cli/nightly/probcli_${n}.zip"
-		download(url,targetzip)
-	    FileTree zip = zipTree(targetzip)
-	    copy {
-		   from zip
-		   into targetdir
-	    }
+			def n = it.getKey()
+
+			def targetdir = dir + it.getValue()
+			def targetzip = dir + "probcli_${n}.zip"
+			def url = "https://www3.hhu.de/stups/downloads/prob/cli/nightly/probcli_${n}.zip"
+			download(url, targetzip)
+			FileTree zip = zipTree(targetzip)
+			copy {
+				from zip
+				into targetdir
+			}
+			delete file(targetzip)
+		}
+
+		def targetdir = dir + "windows/"
+		def targetzip = targetdir + "windowslib64.zip"
+		download("https://www3.hhu.de/stups/downloads/prob/cli/nightly/windowslib64.zip",targetzip)
+		FileTree zip = zipTree(targetzip)
+			copy {
+				from zip
+				into targetdir
+			}
 		delete file(targetzip)
 	}
-
-	def targetdir = dir+"windows/"
-	def targetzip = targetdir+"windowslib64.zip"
-	download("https://www3.hhu.de/stups/downloads/prob/cli/nightly/windowslib64.zip",targetzip)
-	FileTree zip = zipTree(targetzip)
-	    copy {
-		   from zip
-		   into targetdir
-	    }
-	delete file(targetzip)
-}
 }
 
 
+task downloadCli2 (type: Exec) {
+	def dir = workspacePath + 'de.prob.core/prob/'
+	delete file(dir)
+	new File(dir).mkdirs()
 
-task downloadCli2 ( type: Exec ) {
-
-		def dir = workspacePath+'de.prob.core/prob/'
-		delete file(dir)
-	    new File(dir).mkdirs()
-
-		['leopard64':'macos','linux32':'linux','linux64':'linux64','win64':'windows'].each {
+	['leopard64':'macos','linux32':'linux','linux64':'linux64','win64':'windows'].each {
 		def n = it.getKey()
 
-		def targetdir = dir+it.getValue()
-		def targetzip = dir+"probcli_${n}.zip"
+		def targetdir = dir + it.getValue()
+		def targetzip = dir + "probcli_${n}.zip"
 		def url = "https://www3.hhu.de/stups/downloads/prob/cli/nightly//probcli_${n}.zip"
-		download(url,targetzip)
-	    FileTree zip = zipTree(targetzip)
-	    copy {
-		   from zip
-		   into targetdir
-	    }
+		download(url, targetzip)
+		FileTree zip = zipTree(targetzip)
+		copy {
+			from zip
+			into targetdir
+		}
 		delete file(targetzip)
 	}
 
-	def targetdir = dir+"windows/"
-	def targetzip = targetdir+"windowslib64.zip"
-	download("https://www3.hhu.de/stups/downloads/prob/cli/nightly/windowslib64.zip",targetzip)
+	def targetdir = dir + "windows/"
+	def targetzip = targetdir + "windowslib64.zip"
+	download("https://www3.hhu.de/stups/downloads/prob/cli/nightly/windowslib64.zip", targetzip)
 	FileTree zip = zipTree(targetzip)
-	    copy {
-		   from zip
-		   into targetdir
-	    }
+	copy {
+		from zip
+		into targetdir
+	}
 	delete file(targetzip)
 }
 
 
-
 completeInstall.dependsOn downloadCli
 completeInstall.dependsOn subprojects.setClassPath
 
 task deleteOldArtifacts(type: Delete) {
-  	String updateSite = workspacePath+'updatesite'
+	String updateSite = workspacePath + 'updatesite'
 	delete updateSite
 }
 
-task collectArtifacts(type:Copy) {
-	    from workspacePath + groupID+'.repository/target/repository/'
-	    into workspacePath + 'updatesite'
-	    from workspacePath + "index.html"
-	    into workspacePath + 'updatesite'
+task collectArtifacts(type: Copy) {
+	from workspacePath + groupID + '.repository/target/repository/'
+	into workspacePath + 'updatesite'
+	from workspacePath + "index.html"
+	into workspacePath + 'updatesite'
 }
diff --git a/de.prob.core/build.gradle b/de.prob.core/build.gradle
index acb95c76..1819b6a3 100644
--- a/de.prob.core/build.gradle
+++ b/de.prob.core/build.gradle
@@ -3,17 +3,17 @@ apply plugin: 'java'
 def parser_version = '2.5.1'
 
 dependencies {
- compile group: "de.hhu.stups", name: "answerparser", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "bparser", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "cliparser", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "ltlparser", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "parserbase", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "prologlib", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "unicode", version: parser_version , changing: true
- compile group: "de.hhu.stups", name: "theorymapping", version: parser_version , changing: true
- compile 'commons-lang:commons-lang:2.6'
- compile 'commons-codec:commons-codec:1.8'
- compile 'com.thoughtworks.xstream:xstream:1.4.7'
- compile group: 'net.java.dev.jna', name: 'jna', version: '3.4.0'
- compile group: 'de.hhu.stups', name: 'ptolemy-jfmi', version: '1.1.0'
+	compile group: "de.hhu.stups", name: "answerparser", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "bparser", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "cliparser", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "ltlparser", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "parserbase", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "prologlib", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "unicode", version: parser_version , changing: true
+	compile group: "de.hhu.stups", name: "theorymapping", version: parser_version , changing: true
+	compile 'commons-lang:commons-lang:2.6'
+	compile 'commons-codec:commons-codec:1.8'
+	compile 'com.thoughtworks.xstream:xstream:1.4.7'
+	compile group: 'net.java.dev.jna', name: 'jna', version: '3.4.0'
+	compile group: 'de.hhu.stups', name: 'ptolemy-jfmi', version: '1.1.0'
 }
diff --git a/tycho_build.gradle b/tycho_build.gradle
index dfb0bb47..0f2a740d 100644
--- a/tycho_build.gradle
+++ b/tycho_build.gradle
@@ -3,11 +3,10 @@ import org.apache.tools.ant.taskdefs.condition.Os
 	Build Script can be executed via 'gradle install'
 	Build Script Dependencies can be downloaded via 'gradle collectDepenencies'
 	Executing the Build Script and download Dependencies can be executed via 'gradle completeInstall'
- 	For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'
+	For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'
 	Pom Generation can be executed via gradle deploy
 
 	If you have a product definition please add a buildProduct = true to your main build.gradle script
-
 */
 
 
@@ -16,663 +15,604 @@ apply plugin: 'base'
 import groovy.io.FileType
 project.ext.tychoVersion = "1.0.0"
 
-try{
+try {
 	excludeFromTychoBuild = excludeFromTychoBuild
-}catch(MissingPropertyException e){
+} catch (MissingPropertyException e) {
 	project.ext.excludeFromTychoBuild = []
 }
 
-try{
+try {
 	excludeFromClassPath = excludeFromClassPath
-}catch(MissingPropertyException e){
+} catch (MissingPropertyException e) {
 	project.ext.excludeFromClassPath = []
 }
 
-
-try{
+try {
 	workspacePath = workspacePath
-}catch(MissingPropertyException e){
+} catch (MissingPropertyException e) {
 	project.ext.workspacePath = ""
 }
 
-
-try{
+try {
 	dependencyFolder = dependencyFolder
-}catch(MissingPropertyException e){
-	project.ext.dependencyFolder = "lib/dependencies/"			// Folder in each subproject where
+} catch (MissingPropertyException e) {
+	project.ext.dependencyFolder = "lib/dependencies/" // Folder in each subproject where
 }
 
-try{
+try {
 	groupID = groupID
-}catch(MissingPropertyException e){
-
+} catch (MissingPropertyException e) {
 	// workspace nach releng durchsuchen
 	def folderNames = []
 	def folders = []
 	println "folders:"
-	new File(workspacePath+".").listFiles().each{ dir ->
-	    if( dir.isDirectory() ) folders <<  dir.getName()
+	new File(workspacePath+".").listFiles().each{dir ->
+		if (dir.isDirectory()) {
+			folders << dir.getName()
+		}
 	}
 
-	folders.each(){ it ->
+	folders.each { it ->
 		it = (String)it.replaceFirst(/\.\//, "")
-		if( !( ( it ==~ /\..+/ ) || (it ==~ /.*.repository/) || (it ==~ /.*.parent/) ) ) folderNames << it			// subProjects eventuell unnötig settings.gradle datei stattdessen benutzen
+		// subProjects eventuell unnötig settings.gradle datei stattdessen benutzen
+		if (!(it ==~ /\..+/ || it ==~ /.*.repository/ || it ==~ /.*.parent/)) {
+			folderNames << it
+		}
 	}
 
-
 	project.ext.groupID = "group"
-	for( int  i = 0; i < folderNames.size(); i++ ){
-
-		if( folderNames[i] ==~ /.*\.[rR]eleng/ ){
+	for (int i = 0; i < folderNames.size(); i++) {
+		if (folderNames[i] ==~ /.*\.[rR]eleng/) {
 			groupID = folderNames[i]
-			groupID = groupID.replace( ".releng", "")
-			groupID = groupID.replace( ".Releng", "")
+			groupID = groupID.replace(".releng", "")
+			groupID = groupID.replace(".Releng", "")
 		}
 	}
-
 }
 
-
-try{
+try {
 	features = features
-}catch(MissingPropertyException e){
-
+} catch (MissingPropertyException e) {
 	project.ext.features = []
-	for( int i = 0; i < subprojects.name.size(); i++ ){
-		if( subprojects.name[i] ==~ /.*\.[fF]eature/ ){
-			features.add( subprojects.name[i] )
+	for (int i = 0; i < subprojects.name.size(); i++){
+		if (subprojects.name[i] ==~ /.*\.[fF]eature/) {
+			features.add(subprojects.name[i])
 		}
 	}
-
 }
 
-
-try{
+try {
 	repositoryName = repositoryName
-}catch(MissingPropertyException e){
-	project.ext.repositoryName = groupID+".repository"
+} catch (MissingPropertyException e) {
+	project.ext.repositoryName = groupID + ".repository"
 }
 
-try{
+try {
 	parentID = parentID
-}catch(MissingPropertyException e){
-	project.ext.parentID = groupID+".parent"
+} catch (MissingPropertyException e) {
+	project.ext.parentID = groupID + ".parent"
 }
 
-Boolean noDescriptions = false					// in case of using own CategoryDescription Map
+Boolean noDescriptions = false // in case of using own CategoryDescription Map
 
-try{
+try {
 	categoryDescriptions = categoryDescriptions
-}catch(MissingPropertyException e){
-	project.ext.categoryDescriptions = [ [:],[:] ]		// label and descriptions of the features
+} catch (MissingPropertyException e) {
+	project.ext.categoryDescriptions = [[:], [:]] // label and descriptions of the features
 	noDescriptions = true
-}							// 	categoryDescriptions	=	[["feature": "labelName","feature2": "label"],["feature": "featureDescription","feature2": "feature2Description"]]		// label and descriptions of the features
+	// categoryDescriptions = [["feature": "labelName", "feature2": "label"], ["feature": "featureDescription", "feature2": "feature2Description"]] // label and descriptions of the features
+}
 
-try{
+try {
 	targetRepositories = targetRepositories
-}catch(MissingPropertyException e){
+} catch (MissingPropertyException e) {
 	project.ext.targetRepositories = ["http://download.eclipse.org/releases/luna/"]
 }
 
-try{
+try {
 	buildProduct = buildProduct
-
-}catch(MissingPropertyException e){
+} catch (MissingPropertyException e) {
 	project.ext.buildProduct = false
 }
 
 
-
-def projects(int i){
-	return  subprojects.name[i]
+// returns the name of a subproject listed in the settings.gradle file
+def projects(int i) {
+	return subprojects.name[i]
 }
-//	returns the name of a subproject listed in the settings.gradle file
 
 
-def numberOfProjects(){
+// returns the number of projects listed in the settings.gradle file
+def numberOfProjects() {
 	return subprojects.name.size()
 }
-//	returns the number of projects listed in the settings.gradle file
-//
-
 
 
-
-/* 		--		Return ParentId			--		*/
-
-def parentId(){
+// This is the project of the parent Pom
+// The Tycho Maven Build is triggered from this project's pom
+def parentId() {
 	return parentID
 }
-/*
-*	This is the project of the parent Pom
-*	The Tycho Maven Build is triggered from
-*	this project's pom
-*/
-
-
 
-/*	--			Return Group Id			--		*/
-def groupId(){
+// This Group ID will be used in every sub project
+def groupId() {
 	return groupID
 }
 
-/*
-*	This Group ID will be used in every sub project
-*/
-
-def addLibToCP(def project, def libPar){
-
-	def filePar = new File(workspacePath+project+"/.classpath")
+// Add certain Jar to Library
+def addLibToCP(def project, def libPar) {
+	def filePar = new File(workspacePath + project + "/.classpath")
 	boolean notYetAdded = true
-	filePar.eachLine{ line ->
+	filePar.eachLine {line ->
 		def pattern = ".*${dependencyFolder}${libPar}.*"
-		if(line ==~ /${pattern}/){
+		if (line ==~ /${pattern}/) {
 			notYetAdded = false
 		}
-
 	}
-	if(notYetAdded){
-		File newCP = new File(workspacePath+project+'/.cp')
-		filePar.eachLine{ line ->
-
-			 if(line ==~ /.*<\/classpath>.*/){
-
-				String entry = '\t<classpathentry exported="true" kind="lib" path="'+dependencyFolder+libPar+'"/>'+'\n</classpath>\n'
+	if (notYetAdded) {
+		File newCP = new File(workspacePath + project + '/.cp')
+		filePar.eachLine {line ->
+			if (line ==~ /.*<\/classpath>.*/) {
+				String entry = '\t<classpathentry exported="true" kind="lib" path="' + dependencyFolder + libPar + '"/>' + '\n</classpath>\n'
 				line = line.replaceAll(/<\/classpath>/, entry)
-				println project + " : "+ libPar +" added to classpath"
+				println project + " : " + libPar + " added to classpath"
 				newCP << line
-			}else{
-				newCP << line+"\n"
+			} else {
+				newCP << line + "\n"
 			}
 		}
 		filePar.delete()
-		newCP.renameTo(workspacePath+project+'/.classpath')
-	}else{
-		println project + " : "+ libPar +" classpath entry already present"
+		newCP.renameTo(workspacePath + project + '/.classpath')
+	} else {
+		println project + " : " + libPar + " classpath entry already present"
 	}
-
 }
-// Add certain Jar to Library
 
-
-def deleteLibFromCP(def project){
-
-	def filePar = new File(workspacePath+project+"/.classpath")
+// deletes whole DependenciesLibrary Folder
+def deleteLibFromCP(def project) {
+	def filePar = new File(workspacePath + project + "/.classpath")
 	boolean deleteCP = false
-	def newCP = new File(workspacePath+project+'/cp')
+	def newCP = new File(workspacePath + project + '/cp')
 	def pattern = ".*${dependencyFolder}[^<].*/>"
 
-	filePar.eachLine{ line ->
-
-		if(line ==~ /\n(\ |\t)*/) line = line.replaceAll(/\n(\ |\t)*/, '')		// delete empty lines
-		if(line ==~ /${pattern}/){
+	filePar.eachLine {line ->
+		if (line ==~ /\n(\ |\t)*/) {
+			// delete empty lines
+			line = line.replaceAll(/\n(\ |\t)*/, '')
+		}
+		if (line ==~ /${pattern}/) {
 			deleteCP = true
-			def pattern2 =  '(\\ |\\t)*<classpathentry exported="true" kind="lib" path="'+dependencyFolder+"[^<].*"+'"/>(\\ |\\t)*'
+			def pattern2 = '(\\ |\\t)*<classpathentry exported="true" kind="lib" path="' + dependencyFolder + "[^<].*"+'"/>(\\ |\\t)*'
 			line = line.replaceAll(/${pattern2}/, '')
 			newCP << line
-		}else{
+		} else {
 			newCP << line+"\n"
 		}
 	}
-	if(!deleteCP){
-		println project + " : no dependencies from "+ dependencyFolder+" found in classpath file! "
+	if (!deleteCP) {
+		println project + " : no dependencies from " + dependencyFolder + " found in classpath file! "
 		newCP.delete()
-	}else{
+	} else {
 		filePar.delete()
-		newCP.renameTo(workspacePath+project+'/.classpath')
-		println workspacePath+project+'/.classpath' +"!"
+		newCP.renameTo(workspacePath + project + '/.classpath')
+		println workspacePath + project + '/.classpath' + "!"
 	}
 }
-// deletes whole DependenciesLibrary Folder
 
-
-def addRunTimeLib( String libPar, String projectPar){
-
-	def mf = new File(projectPar+"/META-INF/MANIFEST.MF")
-	def newMf = new File(projectPar+"/MF")
+// Adds a Library to the current Bundle-ClassPath of the Manifest file
+def addRunTimeLib(String libPar, String projectPar) {
+	def mf = new File(projectPar + "/META-INF/MANIFEST.MF")
+	def newMf = new File(projectPar + "/MF")
 	newMf.delete()
-	mf.eachLine{ line ->
-		if(line ==~ /.*Bundle-ClassPath:.*\.jar.*/){
-
+	mf.eachLine {line ->
+		if (line ==~ /.*Bundle-ClassPath:.*\.jar.*/) {
 			libsInLine = line.replaceAll(/[\ \t]*Bundle-ClassPath:[\ \t]*/, '')
-			line = line.replaceFirst(/[^\ \t]*\.jar[\ \,]*/, dependencyFolder+libPar+",\n "+libsInLine)		// /[^\ \t]*.\.jar[\ \,]*/
-		}else{
-			if(line ==~ /.*Bundle-ClassPath: \.[\ \t]*/){
-				line = line+",\n "+dependencyFolder+libPar
-			}else{
-				if( line ==~ /.*Bundle-ClassPath: \.\,[\ \t]*/ ){
-					line = line+"\n "+dependencyFolder+libPar+","
-				}
+			line = line.replaceFirst(/[^\ \t]*\.jar[\ \,]*/, dependencyFolder + libPar + ",\n " + libsInLine) // /[^\ \t]*.\.jar[\ \,]*/
+		} else {
+			if (line ==~ /.*Bundle-ClassPath: \.[\ \t]*/) {
+				line = line + ",\n " + dependencyFolder + libPar
+			} else if (line ==~ /.*Bundle-ClassPath: \.\,[\ \t]*/) {
+				line = line + "\n " + dependencyFolder + libPar + ","
 			}
 		}
 
-		newMf << line+"\n"
+		newMf << line + "\n"
 	}
 	mf.delete()
-	newMf.renameTo(projectPar+"/META-INF/MANIFEST.MF")
-
-
-} // Adds a Library to the current Bundle-ClassPath of the Manifest file
-
+	newMf.renameTo(projectPar + "/META-INF/MANIFEST.MF")
+}
 
-def createRunTimeLib(String libPar, String projectPar){
-	def mf = new File(projectPar+"/META-INF/MANIFEST.MF")
-	mf << "Bundle-ClassPath: lib/dependencies/"+libPar
-} // Creates a Bundle-ClassPath Section in the Manifest file
+// Creates a Bundle-ClassPath Section in the Manifest file
+def createRunTimeLib(String libPar, String projectPar) {
+	def mf = new File(projectPar + "/META-INF/MANIFEST.MF")
+	mf << "Bundle-ClassPath: lib/dependencies/" + libPar
+}
 
-def boolean checkForRunTimeLibs(String projectPar){
+// checks for a Bundle-ClassPath section in the Manifest file
+def boolean checkForRunTimeLibs(String projectPar) {
 	boolean returnBool = false
-	def mf = new File(projectPar+"/META-INF/MANIFEST.MF")
-		mf.eachLine{ line ->
-			if(line ==~ /.*Bundle-ClassPath:.*/){
-				returnBool = true
-			}
+	def mf = new File(projectPar + "/META-INF/MANIFEST.MF")
+	mf.eachLine {line ->
+		if (line ==~ /.*Bundle-ClassPath:.*/) {
+			returnBool = true
 		}
-		return returnBool
-} // checks for a Bundle-ClassPath section in the Manifest file
-
+	}
+	return returnBool
+}
 
-def boolean checkRunTimeLib(String libPar, String projectPar){								// checks if lib is in RunTimeLibrary present and
-	def mf = new File(projectPar+"/META-INF/MANIFEST.MF")									// changes reference if necessary
-	def newMf = new File(projectPar+"/MF")
+// checks if lib is already present in Manifest file
+// if lib is present but is referenced from another folder than dependencyFolder the library from dependencyFolder will be referenced
+def boolean checkRunTimeLib(String libPar, String projectPar){
+	// checks if lib is in RunTimeLibrary present and changes reference if necessary
+	def mf = new File(projectPar + "/META-INF/MANIFEST.MF")
+	def newMf = new File(projectPar + "/MF")
 	newMf.delete()
 	boolean returnBool = false
 	boolean changed = false
-		mf.eachLine{ line ->
-			if(line ==~ /.*${libPar}.*/){
-				if( !( line ==~ /.*(\ |\t)*${dependencyFolder}${libPar}(\ |\t)*.*/ ) ){			//if lib is already referenced
-					line = line.replaceFirst( /[^\ \t]*${libPar}/, dependencyFolder+libPar ) 		// reference lib from dependencyFolder
-					changed = true
-					println line
-					println "yolo  ${libPar}\n"
-				}
-				returnBool = true
+	mf.eachLine {line ->
+		if (line ==~ /.*${libPar}.*/) {
+			if (!(line ==~ /.*(\ |\t)*${dependencyFolder}${libPar}(\ |\t)*.*/)){
+				// if lib is already referenced
+				// reference lib from dependencyFolder
+				line = line.replaceFirst( /[^\ \t]*${libPar}/, dependencyFolder+libPar )
+				changed = true
+				println line
+				println "yolo  ${libPar}\n"
 			}
-
-			newMf << line+"\n"
+			returnBool = true
 		}
-		if(changed){
-			mf.delete()
-			newMf.renameTo(projectPar+"/META-INF/MANIFEST.MF")
-		}else{
-			newMf.delete()
-		}
-		return returnBool
 
-}// checks if lib is already present in Manifest file
-// if lib is present but is referenced from another folder than dependencyFolder the library from dependencyFolder will be referenced
+		newMf << line + "\n"
+	}
+	if (changed) {
+		mf.delete()
+		newMf.renameTo(projectPar + "/META-INF/MANIFEST.MF")
+	} else {
+		newMf.delete()
+	}
+	return returnBool
+}
 
-/////////////////////////////////////////////////////////////////////////////////////////
-//		--	!!! 				DEFINING SUB PROJECTS 							!!!	-- //
-/////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////
+// !!! DEFINING SUB PROJECTS !!! //
+///////////////////////////////////
 
 subprojects {
-
 	apply plugin: 'base'
 	apply plugin: 'java'
-//	apply plugin: 'eclipse'
+	// apply plugin: 'eclipse'
 
 	task deleteArtifacts(type: Delete) {
-  		delete 'target','pom.xml'
+		delete 'target','pom.xml'
 	}
 
-	/////				Copy Dependencies into subprojects DependencyFolder 				/////
+	// Copy Dependencies into subprojects DependencyFolder
 	task collectDependencies(type: Copy) {
+		from configurations.compile
+		from configurations.runtime
 
-		   	from configurations.compile
-			from configurations.runtime
-
-			into "${dependencyFolder}"
-
+		into "${dependencyFolder}"
 	}
 
-	task setClassPath(dependsOn: 'collectDependencies'){
+	task setClassPath(dependsOn: 'collectDependencies') {
 		description = "\tAdds all your Dependencies from your local lib folder in each project to it's classpath"
 
-
 		doLast {
-
-		if( excludeFromClassPath.every{ it != project.name }){
-			def dependencyList = []
-			try{
-				def dir = new File(workspacePath+project.name+"/"+dependencyFolder).eachFile() { file->
-			    	if( !(file.getName() ==~/.*\.txt/) ){
-						dependencyList << file.getName()
+			if (excludeFromClassPath.every {it != project.name}) {
+				def dependencyList = []
+				try {
+					def dir = new File(workspacePath + project.name + "/" + dependencyFolder).eachFile() {file ->
+						if (!(file.getName() ==~ /.*\.txt/)) {
+							dependencyList << file.getName()
+						}
 					}
-				}
 
-				if(features.every{ it != project.name }){
-					boolean BundleClassPathPresent = checkForRunTimeLibs(project.name)
-					for(int icp = 0; icp < dependencyList.size; icp++){
-						addLibToCP(project.name, dependencyList[icp])	//Adds Lib to .classPath file
-
-						if(!BundleClassPathPresent){					// Adds Lib to Manifest File
-							createRunTimeLib(dependencyList[icp], project.name)
-							BundleClassPathPresent = true
-						}else{
-							if(!checkRunTimeLib(dependencyList[icp], project.name)){		// if library not present add it to RunTimeLibrary
-								addRunTimeLib( dependencyList[icp], project.name)
+					if (features.every {it != project.name}) {
+						boolean BundleClassPathPresent = checkForRunTimeLibs(project.name)
+						for (int icp = 0; icp < dependencyList.size; icp++) {
+							// Adds Lib to .classPath file
+							addLibToCP(project.name, dependencyList[icp])
+
+							if (!BundleClassPathPresent) {
+								// Adds Lib to Manifest File
+								createRunTimeLib(dependencyList[icp], project.name)
+								BundleClassPathPresent = true
+							} else if (!checkRunTimeLib(dependencyList[icp], project.name)) {
+								// if library not present add it to RunTimeLibrary
+								addRunTimeLib(dependencyList[icp], project.name)
 							}
 						}
+						// could still be usefull for debugging, that's why it's not deleted
+						/*dependencyList.each {dep ->
+							println project.name + ": " + dep
+						}*/
 					}
-					/*dependencyList.each{ dep->
-					println project.name+": "+ dep	// could still be usefull for debugging, that's why it's not deleted
-					}*/
-			}
-			def warningReadMe = new File(workspacePath+project.name+"/"+dependencyFolder+"_README.txt")
-			warningReadMe.delete()
-			warningReadMe << "Do Not Remove any Jars/Libraries in this Folder!\nThis folder contains all of your dependencies defined in your gradle script.\n"
-			warningReadMe << "Removing or renaming any of these files will result in an Error in your .classpath file\n"
-			warningReadMe << "If any error concerning missing dependencies should occur please run 'gradle deleteFromClassPath setClassPath' in your workspace folder from your shell."
-
-
-			}catch(Exception e){
-				println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
+					def warningReadMe = new File(workspacePath + project.name + "/" + dependencyFolder + "_README.txt")
+					warningReadMe.delete()
+					warningReadMe << "Do Not Remove any Jars/Libraries in this Folder!\nThis folder contains all of your dependencies defined in your gradle script.\n"
+					warningReadMe << "Removing or renaming any of these files will result in an Error in your .classpath file\n"
+					warningReadMe << "If any error concerning missing dependencies should occur please run 'gradle deleteFromClassPath setClassPath' in your workspace folder from your shell."
+				} catch (Exception e) {
+					println project.name + " has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
+				}
 			}
-		}// if exclude projectAbfrage
-
-	} /// doLast
-} // setClassPath
+		}
+	}
 
 	task deleteFromClassPath(){
-
 		description = "\tDeletes all your Dependencies located in your local lib folder from each project's classpath"
-doLast{
-		try{
 
-			boolean depsDelete = false
-			def depsFolder = new File(workspacePath+project.name+'/'+dependencyFolder)
-			if(depsFolder.exists()) depsDelete = true
-			depsFolder.deleteDir()
+		doLast {
+			try {
+				boolean depsDelete = false
+				def depsFolder = new File(workspacePath + project.name + '/' + dependencyFolder)
+				if (depsFolder.exists()) {
+					depsDelete = true
+				}
+				depsFolder.deleteDir()
 
-			if(features.every{ it != project.name } && depsDelete){
-				deleteLibFromCP(project.name)
+				if (features.every {it != project.name} && depsDelete) {
+					deleteLibFromCP(project.name)
+				}
+			} catch (Exception e) {
+				println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
 			}
-
-		}catch(Exception e){
-			println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
 		}
-
 	}
-}
 
-	/////---- 			For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'				----///////
+	// For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'
 
 	////////////////////////////////////////////////////////////////////////////////////////////
 
 	task deploy() {
 		description = "\tGenerating the Tycho Poms. Please remember to add a '.qualifier' to the version numbers!"
-doLast {
-		String 	versionNumber = 'Version Number Error:\tcheck Manifest for Bundle-Version Number and make sure to add a ".qualifier" to the version numbers!\n'
-		String 	artifactId = 'Could not find Bundle-SymbolicName in Manifest.file'
-
-
-		/* -- In case of changed Manifest File in Eclipse:
-		*
-		*	Version Numbers of the projects are collected via
-		*	regular expressions in the Manifest.MF File.
-		*	versionnumber of the projects are equal to their
-		*	Bundle-Version Number
-		*/
-
-
-		if(features.every{ it != project.name }){		// Generating Poms for sub projects except features
-			def content = new File(workspacePath+"${project.name}/META-INF/MANIFEST.MF").getText("UTF-8")
-
-	 		def printFileLine = {
-				if(  it ==~ /Bundle-Version.+qualifier/ ){
-					 versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
-
-					/*	Version Number is taken from Bundle-Version in Manifest.MF
-					*	If there is no Bundle-Version or the versionnumber needs to
-					*	be taken from a different key word, please change the
-					*	regular expression and the substring above
-					*/
 
-					versionNumber = versionNumber.replace(".qualifier","-SNAPSHOT")
-				}
+		doLast {
+			String versionNumber = 'Version Number Error:\tcheck Manifest for Bundle-Version Number and make sure to add a ".qualifier" to the version numbers!\n'
+			String artifactId = 'Could not find Bundle-SymbolicName in Manifest.file'
+
+			// -- In case of changed Manifest File in Eclipse:
+			// Version Numbers of the projects are collected via
+			// regular expressions in the Manifest.MF File.
+			// versionnumber of the projects are equal to their
+			// Bundle-Version Number
+
+			// Generating Poms for sub projects except features
+			if (features.every {it != project.name}) {
+				def content = new File(workspacePath + "${project.name}/META-INF/MANIFEST.MF").getText("UTF-8")
+
+				def printFileLine = {
+					if (it ==~ /Bundle-Version.+qualifier/) {
+						versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
+
+						// Version Number is taken from Bundle-Version in Manifest.MF
+						// If there is no Bundle-Version or the versionnumber needs to
+						// be taken from a different key word, please change the
+						// regular expression and the substring above
+						
+						versionNumber = versionNumber.replace(".qualifier", "-SNAPSHOT")
+					}
 
-				if(  it ==~ /Bundle-SymbolicName:.+/ ){
-					artifactId = it
-					artifactId = artifactId.replace("Bundle-SymbolicName:", '');
-					artifactId = artifactId.replace(";",'')
-					artifactId = artifactId.replace(" ",'')
-					artifactId = artifactId.replace("singleton:=true",'')
+					// Artifact ID is taken from Bundle-SymbolicName minus the 16 chars ';singleton:=true'
+					if (it ==~ /Bundle-SymbolicName:.+/) {
+						artifactId = it
+						artifactId = artifactId.replace("Bundle-SymbolicName:", '')
+						artifactId = artifactId.replace(";", '')
+						artifactId = artifactId.replace(" ", '')
+						artifactId = artifactId.replace("singleton:=true", '')
+					}
 				}
-				/*	Artifact ID is taken from Bundle-SymbolicName minus the
-				*	16 chars ';singleton:=true'
-				*/
-			}
-
-			content.eachLine( printFileLine )
 
-			println artifactId
-			println "\t"+versionNumber
-
-			def f = new File(workspacePath+artifactId+'/pom.xml')
-			f.delete()
-
-			// 			---- 			Test Cases					 ------ 				//
-
-			if( project.name ==~ /.*\.[tT]ests*/){
-
-				f << start()+elder()+testArtifact(artifactId, versionNumber)+end()
-			}else{
-
-			// ---- 				Normal Plugin 				-----						//
-				f << start()+elder()+artifact(artifactId, versionNumber)+end()
-				/*
-				*	old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
-				*/
-			}
-		}else{	//  end  of { if subprojects aren't a feature } Block
+				content.eachLine(printFileLine)
 
-//		--		Features 					--			//
+				println artifactId
+				println "\t" + versionNumber
 
-			if(features.any{ it == project.name } ){
+				def f = new File(workspacePath + artifactId + '/pom.xml')
+				f.delete()
 
-				def parsedXml = new XmlParser().parse(workspacePath+"${project.name}/feature.xml")
+				if (project.name ==~ /.*\.[tT]ests*/) {
+					// Test Cases
+					f << start() + elder() + testArtifact(artifactId, versionNumber) + end()
+				} else {
+					// Normal Plugin
+					f << start() + elder() + artifact(artifactId, versionNumber) + end()
+					// old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
+				}
+			} else if (features.any {it == project.name}) {
+				// Features
+				def parsedXml = new XmlParser().parse(workspacePath + "${project.name}/feature.xml")
 
-				artifactId   = parsedXml.attribute("id")
+				artifactId = parsedXml.attribute("id")
 				versionNumber = parsedXml.attribute("version")
-				versionNumber = versionNumber.replace(".qualifier","-SNAPSHOT")
+				versionNumber = versionNumber.replace(".qualifier", "-SNAPSHOT")
 
 				println artifactId
-				println "\t"+versionNumber
+				println "\t" + versionNumber
 
-				def f = new File(workspacePath+artifactId+'/pom.xml')
+				def f = new File(workspacePath + artifactId + '/pom.xml')
 				f.delete()
 				f << feature(artifactId, versionNumber)
 			}
 		}
-	} //doLast
-}//deploy
-
-}// defining subprojects
+	}
+}
 
 
 clean {
 	dependsOn += subprojects.deleteArtifacts
 }
 
+// define Parent
 task createParent() {
-	//		---------				 define Parent 				---------		//
-doLast{
-	new File(workspacePath+"${parentID}").mkdir()
-	String versionNumber 	=	'1.0.0.qualifier'
-	String artifactId 		=	parentId()
-
-	def f = new File(workspacePath+artifactId+'/pom.xml')
-	f.delete()
-	f << parentPom(artifactId)
-	for(int i = 0; i < targetRepositories.size(); i++){
-		f << repos(targetRepositories[i], i)
-	}
-	f << endRepos()
-	f << moduleStart()
-	for(int i = 0; i < numberOfProjects(); i++){
-
-		if( excludeFromTychoBuild.every{ it != projects(i) } ){
-
-			f << module(projects(i))
+	doLast {
+		new File(workspacePath + "${parentID}").mkdir()
+		String versionNumber = '1.0.0.qualifier'
+		String artifactId = parentId()
+
+		def f = new File(workspacePath + artifactId + '/pom.xml')
+		f.delete()
+		f << parentPom(artifactId)
+		for (int i = 0; i < targetRepositories.size(); i++) {
+			f << repos(targetRepositories[i], i)
+		}
+		f << endRepos()
+		f << moduleStart()
+		for (int i = 0; i < numberOfProjects(); i++) {
+			if (excludeFromTychoBuild.every {it != projects(i)}) {
+				f << module(projects(i))
+			}
 		}
+		f << module(repositoryName)
+		f << endParent()
 	}
-	f << module(repositoryName)
-	f << endParent()
-
-}
 }
 
-task createRepository()  {
-doLast{
-	//			------------	 	define Repository			---------		//
-
-	new File(workspacePath+"${repositoryName}").mkdir()
-
-	String versionNumber 	=	'1.0.0.qualifier'
-	String artifactId		=	repositoryName
-	String featureVersionNumber = '1.0.0.qualifier'
-	String featureArtifactId
-	def f = new File(workspacePath+artifactId+'/category.xml')
-	f.delete()
-	f << categoryHead()
-	for(int i = 0; i < features.size(); i++){
-
-		def parsedXml = new XmlParser().parse("${workspacePath}${features[i]}/feature.xml")
-
-		featureVersionNumber  = parsedXml.attribute("version")
-		featureArtifactId  = parsedXml.attribute("id")
-
-		if(noDescriptions){
-			categoryDescriptions[0].put( features[i], parsedXml.attribute("label") )
-			categoryDescriptions[1].put( features[i], parsedXml.description.text() )
+// define Repository
+task createRepository() {
+	doLast{
+		new File(workspacePath + "${repositoryName}").mkdir()
+
+		String versionNumber = '1.0.0.qualifier'
+		String artifactId = repositoryName
+		String featureVersionNumber = '1.0.0.qualifier'
+		String featureArtifactId
+		def f = new File(workspacePath + artifactId + '/category.xml')
+		f.delete()
+		f << categoryHead()
+		for (int i = 0; i < features.size(); i++) {
+			def parsedXml = new XmlParser().parse("${workspacePath}${features[i]}/feature.xml")
+
+			featureVersionNumber  = parsedXml.attribute("version")
+			featureArtifactId  = parsedXml.attribute("id")
+
+			if (noDescriptions) {
+				categoryDescriptions[0].put(features[i], parsedXml.attribute("label"))
+				categoryDescriptions[1].put(features[i], parsedXml.description.text())
+			}
+			f << categoryFeatures(featureArtifactId.replace(workspacePath, ''), featureVersionNumber)
 		}
-		f << categoryFeatures(featureArtifactId.replace(workspacePath,''), featureVersionNumber)
-	}// for
-
-	for( int i = 0; i < features.size(); i++ ){
 
-		if(noDescriptions){
-			f << categoryDescription(features[i], categoryDescriptions[0][features[i]] ,categoryDescriptions[1][features[i]] )
-			//						featureName,			label,							description
-		}else{
-			f << categoryDescription(features[i], categoryDescriptions[features[i]][0] ,categoryDescriptions[features[i]][1])
+		for (int i = 0; i < features.size(); i++) {
+			if (noDescriptions) {
+				// featureName, label, description
+				f << categoryDescription(features[i], categoryDescriptions[0][features[i]],categoryDescriptions[1][features[i]])
+			} else {
+				f << categoryDescription(features[i], categoryDescriptions[features[i]][0],categoryDescriptions[features[i]][1])
+			}
 		}
-	}//for
 
-	f << categoryEnd()
+		f << categoryEnd()
 
-	def pom = new File(workspacePath+artifactId+'/pom.xml')
-	pom.delete()
-	pom << reposi()
-}// end of repository definition
+		def pom = new File(workspacePath + artifactId + '/pom.xml')
+		pom.delete()
+		pom << reposi()
+	}
 }
 
 task createPoms(dependsOn: [createParent, createRepository, subprojects.deploy])
 
 
-task install(dependsOn: [createPoms] , type:Exec) {
+task install(dependsOn: [createPoms], type: Exec) {
 	description = "\tExecutes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
-	commandLine 'mvn', 'install', '-f', workspacePath+parentID+'/pom.xml'
+	commandLine 'mvn', 'install', '-f', workspacePath + parentID + '/pom.xml'
 }
 
-task completeInstall(dependsOn: [subprojects.collectDependencies, createPoms], type:Exec ){
-
+task completeInstall(dependsOn: [subprojects.collectDependencies, createPoms], type:Exec){
 	description = "\tCopies dependencies into dependencyFolder of each subproject and executes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
-	commandLine 'mvn', 'install', '-f', workspacePath+parentID+'/pom.xml'
+	commandLine 'mvn', 'install', '-f', workspacePath + parentID + '/pom.xml'
 }
 
-task tycho(dependsOn: [createPoms] , type:Exec) {
+task tycho(dependsOn: [createPoms], type: Exec) {
 	description = "\tExecutes a 'mvn install' of the parent pom.xml and auto-generates Tycho Poms"
-	commandLine 'mvn', 'install', '-f', workspacePath+parentID+'/pom.xml'
+	commandLine 'mvn', 'install', '-f', workspacePath + parentID + '/pom.xml'
 }
 
 
-//---     Defining Tycho POM parts			--//
+// --- Defining Tycho POM parts -- //
 
 
-    def artifact(artifactId,versionNumber) { """
-		<groupId>${groupId()}</groupId>
-		<artifactId>${artifactId}</artifactId>
-		<version>${versionNumber}</version>
-		<packaging>eclipse-plugin</packaging>
-		<build>
-			<plugins>
-				<plugin>
-					<groupId>org.eclipse.tycho</groupId>
-					<artifactId>tycho-compiler-plugin</artifactId>
-					<configuration>
-						<source>1.8</source>
-						<target>1.8</target>
-					</configuration>
-	      			</plugin>
-	    		</plugins>
-	 	</build>
-	""" }
-
-    def testArtifact(artifactId,versionNumber) { """
-			<groupId>${groupId()}</groupId>
-			<artifactId>${artifactId}</artifactId>
-			<version>${versionNumber}</version>
-			<packaging>eclipse-test-plugin</packaging>
-			<build>
-				<plugins>
-					<plugin>
-						<groupId>org.eclipse.tycho</groupId>
-						<artifactId>tycho-surefire-plugin</artifactId>
-	        				<configuration>
-							<!-- <useUIHarness>true</useUIHarness> -->
-							<!-- <useUIThread>true</useUIThread> -->
-							${macTestArguments()}
-							<!-- <product>org.rodinp.platform.product</product> -->
-	        				</configuration>
-	      				</plugin>
-	    			</plugins>
-	 		</build>
-		""" }
-
-	String macTestArguments() {
-		if ( Os.isFamily(Os.FAMILY_MAC) ){
-			return "<argLine>-XstartOnFirstThread</argLine>\n"
-		}else{
-			return "\n"
-		}
-	}
-
+def artifact(artifactId,versionNumber) {"""
+	<groupId>${groupId()}</groupId>
+	<artifactId>${artifactId}</artifactId>
+	<version>${versionNumber}</version>
+	<packaging>eclipse-plugin</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.8</source>
+					<target>1.8</target>
+				</configuration>
+				</plugin>
+		</plugins>
+	</build>
+"""}
 
-	def start() { """<?xml version="1.0" encoding="UTF-8"?>
-	<project
-		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-		<modelVersion>4.0.0</modelVersion>
-	"""}
+def testArtifact(artifactId,versionNumber) {"""
+	<groupId>${groupId()}</groupId>
+	<artifactId>${artifactId}</artifactId>
+	<version>${versionNumber}</version>
+	<packaging>eclipse-test-plugin</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-surefire-plugin</artifactId>
+				<configuration>
+					<!-- <useUIHarness>true</useUIHarness> -->
+					<!-- <useUIThread>true</useUIThread> -->
+					${macTestArguments()}
+					<!-- <product>org.rodinp.platform.product</product> -->
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+"""}
 
+String macTestArguments() {
+	if (Os.isFamily(Os.FAMILY_MAC)) {
+		return "<argLine>-XstartOnFirstThread</argLine>\n"
+	} else {
+		return "\n"
+	}
+}
 
-	def elder() {"""
-		<parent>
-			<groupId>${groupId()}</groupId>
-			<artifactId>${parentId()}</artifactId>
-			<version>1.0.0.qualifier</version>
-			<relativePath>../${parentId()}/pom.xml</relativePath>
-		</parent>
-	"""}
 
+def start() {"""\
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+"""}
 
-	def end() {"""
-	</project>
-	"""}
 
-// 				--	defining Parent Pom				--				//
+def elder() {"""
+	<parent>
+		<groupId>${groupId()}</groupId>
+		<artifactId>${parentId()}</artifactId>
+		<version>1.0.0.qualifier</version>
+		<relativePath>../${parentId()}/pom.xml</relativePath>
+	</parent>
+"""}
 
 
+def end() {"""
+</project>
+"""}
 
+// -- defining Parent Pom -- //
 
-def parentPom(artifactId) { """<?xml version="1.0" encoding="UTF-8"?>
+def parentPom(artifactId) {"""\
+<?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>${groupId()}</groupId>
-  	<artifactId>${artifactId}</artifactId>
-  	<version>1.0.0.qualifier</version>
+	<artifactId>${artifactId}</artifactId>
+	<version>1.0.0.qualifier</version>
 
 	<packaging>pom</packaging>
 
@@ -687,28 +627,20 @@ def parentPom(artifactId) { """<?xml version="1.0" encoding="UTF-8"?>
 			<url>https://repo1.maven.org/maven2</url>
 		</pluginRepository>
 	</pluginRepositories> 
-   <repositories>
-	<!-- configure p2 repository to resolve against -->
-
-
+	<repositories>
+		<!-- configure p2 repository to resolve against -->
 """}
 
-
 def repos(String targetRepo, int i) {"""
-
-	<repository>
-	  <id>targetRepository${i}</id>
-	  <layout>p2</layout>
-	  <url>${targetRepo}</url>
-	</repository>
-
+		<repository>
+			<id>targetRepository${i}</id>
+			<layout>p2</layout>
+			<url>${targetRepo}</url>
+		</repository>
 """}
 
-
-
 def endRepos() {"""
-  </repositories>
-
+	</repositories>
 	<build>
 		<plugins>
 			<plugin>
@@ -722,213 +654,192 @@ def endRepos() {"""
 	</build>
 """}
 
-def moduleStart(){"""
+def moduleStart() {"""
 	<!-- the modules that should be built together -->
 	<modules>
-	"""}
-
-//for(int i = 0; i < numberOfProjects(); i++)
-
-def module(String project){"""		<module>../${project}</module>
 """}
 
+// for (int i = 0; i < numberOfProjects(); i++)
 
+def module(String project) {"""\
+		<module>../${project}</module>
+"""}
 
-def endParent() {"""
+def endParent() {"""\
 	</modules>
 </project>
-	"""}
+"""}
 
 // end of defining parent pom.xml
 
 // repository Pom
-def reposi() { """
+def reposi() {"""\
 <?xml version="1.0" encoding="UTF-8"?>
-  <project
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-      <groupId>${groupID}</groupId>
-      <artifactId>${parentID}</artifactId>
-      <version>1.0.0.qualifier</version>
-      <relativePath>../${parentID}/pom.xml</relativePath>
-    </parent>
-
-
-    <groupId>${groupID}</groupId>
-    <artifactId>${repositoryName}</artifactId>
-    <version>1.0.0.qualifier</version>
-    <packaging>eclipse-repository</packaging>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>${groupID}</groupId>
+		<artifactId>${parentID}</artifactId>
+		<version>1.0.0.qualifier</version>
+		<relativePath>../${parentID}/pom.xml</relativePath>
+	</parent>
+
+	<groupId>${groupID}</groupId>
+	<artifactId>${repositoryName}</artifactId>
+	<version>1.0.0.qualifier</version>
+	<packaging>eclipse-repository</packaging>
 
 	${reposiBuildStep()}
 </project>
 """}
 
 def String reposiBuildStep(){
-
-	if( buildProduct != false ){
-		return	"""
-		    <build>
-		  <plugins>
-		    <plugin>
-		      <groupId>org.eclipse.tycho</groupId>
-		      <artifactId>tycho-p2-director-plugin</artifactId>
-		      <version>\${tycho-version}</version>
-		      <executions>
-		        <execution>
-		          <!-- (optional) install the product for all configured os/ws/arch environments using p2 director -->
-		          <id>materialize-products</id>
-		          <goals>
-		            <goal>materialize-products</goal>
-		          </goals>
-		        </execution>
-
-			 		<execution>
-			            <!-- (optional) create product zips (one per os/ws/arch) -->
-			            <id>archive-products</id>
-			            <goals>
-			              <goal>archive-products</goal>
-			            </goals>
-			          </execution>
-
+	if (buildProduct != false) {
+		return """
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-p2-director-plugin</artifactId>
+				<version>\${tycho-version}</version>
+				<executions>
+					<execution>
+						<!-- (optional) install the product for all configured os/ws/arch environments using p2 director -->
+						<id>materialize-products</id>
+						<goals>
+							<goal>materialize-products</goal>
+						</goals>
+					</execution>
+
+					<execution>
+						<!-- (optional) create product zips (one per os/ws/arch) -->
+						<id>archive-products</id>
+						<goals>
+							<goal>archive-products</goal>
+						</goals>
+					</execution>
 				</executions>
-		    </plugin>
-		  </plugins>
-		</build>
+			</plugin>
+		</plugins>
+	</build>
 		"""
-	}else{
+	} else {
 		return "\n"
 	}
 }
 
 
 // creates a category in
-def categoryHead() { """<?xml version="1.0" encoding="UTF-8"?>
+def categoryHead() {"""\
+<?xml version="1.0" encoding="UTF-8"?>
 <site>
-
 """}
 
-def categoryFeatures(artifactId, versionNumber){"""
+def categoryFeatures(artifactId, versionNumber) {"""
 	<feature url="features/${artifactId}_${versionNumber}.jar" id="${artifactId}" version="${versionNumber}">
 		<category name="${artifactId}.category"/>
 	</feature>
 """}
 
-def categoryDescription(artifactId, categoryName, categorydescription){"""
-<category-def name="${artifactId}.category" label="${categoryName}">
-      <description>
+def categoryDescription(artifactId, categoryName, categorydescription) {"""
+	<category-def name="${artifactId}.category" label="${categoryName}">
+		<description>
 ${categorydescription}
-      </description>
-   </category-def>
+		</description>
+	</category-def>
 """}
 
-def categoryEnd(){"""
+def categoryEnd() {"""
 </site>
 """}
 // end of category definition
 
 // feature pom
-def feature(artifactId, versionNumber) { """
+def feature(artifactId, versionNumber) {"""\
 <?xml version="1.0" encoding="UTF-8"?>
-	<project
-		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-		<modelVersion>4.0.0</modelVersion>
-		<parent>
-			<groupId>${groupId()}</groupId>
-			<artifactId>${parentId()}</artifactId>
-			<version>1.0.0.qualifier</version>
-			<relativePath>../${parentId()}/pom.xml</relativePath>
-		</parent>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
 		<groupId>${groupId()}</groupId>
-		<artifactId>${artifactId}</artifactId>
-		<version>${versionNumber}</version>
-		<packaging>eclipse-feature</packaging>
-	</project>
+		<artifactId>${parentId()}</artifactId>
+		<version>1.0.0.qualifier</version>
+		<relativePath>../${parentId()}/pom.xml</relativePath>
+	</parent>
+	<groupId>${groupId()}</groupId>
+	<artifactId>${artifactId}</artifactId>
+	<version>${versionNumber}</version>
+	<packaging>eclipse-feature</packaging>
+</project>
 """}
 // end of feature pom
 
 
-// 						-------- 					In case you want to generate the product definition  					 ------ 			//
+// -------- In case you want to generate the product definition ------ //
 /*
-
 def productXML(){
-"""
+"""\
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
 <product name="${groupID}.product" uid="${groupID}" id="${groupID}.product" application="${product}" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
+	<configIni use="default">
+	</configIni>
 
-   <configIni use="default">
-   </configIni>
-
-   <launcherArgs>
-      <programArgs>-consoleLog</programArgs>
-      <vmArgs>-Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgs>
-      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
-   </launcherArgs>
-
-   <plugins>
+	<launcherArgs>
+		<programArgs>-consoleLog</programArgs>
+		<vmArgs>-Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgs>
+		<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+	</launcherArgs>
 
-   </plugins>
+	<plugins>
+	</plugins>
 	<features>
-"""+listProductFeature()+"""
-   	<feature id="org.eclipse.rcp" version="3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272"/>
+""" + listProductFeature() + """
+		<feature id="org.eclipse.rcp" version="3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272"/>
 	</features>
-   <configurations>
-      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
-      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
-      <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
-   </configurations>
-
+	<configurations>
+		<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
+		<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+		<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
+	</configurations>
 </product>
-
-
 """
 
 /*
-"""
+"""\
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
 <product name="de.prob.product" uid="de.prob" id="de.prob.standalone.product" application="de.prob.standalone.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
+	<configIni use="default">
+	</configIni>
 
-   <configIni use="default">
-   </configIni>
-
-   <launcherArgs>
-      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
-   </launcherArgs>
-
-   <plugins>
-   </plugins>
-
+	<launcherArgs>
+		<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+	</launcherArgs>
 
+	<plugins>
+	</plugins>
 </product>
-
-
 """*/
 
 /*
-
-     <feature id="birkhoff.feature" version="1.0.0.qualifier"/>
-
-
+	<feature id="birkhoff.feature" version="1.0.0.qualifier"/>
 */
 /*
 }
 
 def String listProductFeatures(){
 	String returnString = ""
-	for(int i = 0; i < features.size(); i++){
-
-		returnString +=  '\n\t\t<feature id="${features[i]}" version="1.0.0.qualifier"/>'
-
+	for (int i = 0; i < features.size(); i++) {
+		returnString += '\n\t\t<feature id="${features[i]}" version="1.0.0.qualifier"/>'
 	}
 	return returnString
-
 }
 */
 
-//	Build Script can be executed via gradle install
-// 	For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'
-//	Pom Generation can be executed via gradle deploy
+// Build Script can be executed via gradle install
+// For a complete classPath Refresh please execute 'gradle deleteFromClassPath setClassPath'
+// Pom Generation can be executed via gradle deploy
-- 
GitLab