From 2566d483844e92d5f936e973f585baf32ffc7828 Mon Sep 17 00:00:00 2001
From: birkhoff <mike.birkhoff@gmx.de>
Date: Mon, 30 Jul 2012 14:02:56 +0200
Subject: [PATCH] new structure of the build. Script is not anymore in the
 .releng folder, but in the workspace instead for easier and more stable
 dependency management. It is still possible to put the script in a subfolder,
 but it will be necessary change the workspacePath = '../' , workspacePath is
 now by default = ''

---
 de.prob.releng/build.gradle => build.gradle   | 12 ++++----
 .../settings.gradle => settings.gradle        |  3 +-
 .../tycho_build.gradle => tycho_build.gradle  | 30 ++++++++++++++-----
 3 files changed, 32 insertions(+), 13 deletions(-)
 rename de.prob.releng/build.gradle => build.gradle (92%)
 rename de.prob.releng/settings.gradle => settings.gradle (96%)
 rename de.prob.releng/tycho_build.gradle => tycho_build.gradle (94%)

diff --git a/de.prob.releng/build.gradle b/build.gradle
similarity index 92%
rename from de.prob.releng/build.gradle
rename to build.gradle
index 305917fb..e3c87cd1 100644
--- a/de.prob.releng/build.gradle
+++ b/build.gradle
@@ -1,11 +1,12 @@
 
 targetRepositories = ["http://cobra.cs.uni-duesseldorf.de/prob_dev_target/","http://download.eclipse.org/releases/indigo/","http://rodin-b-sharp.sourceforge.net/updates"]	
 
+groupID = "de.prob"
+
 apply from: 'tycho_build.gradle'
 
 // Local tasks
 
-
 project(':de.prob.core') {
 
 	repositories {
@@ -90,8 +91,9 @@ task deleteOldArtifacts(type: Delete) {
 }
 
 task collectArtifacts(type:Copy) {
-	    from "../"+groupID+'.repository/target/repository/'
-	    into '../updatesite'
-	    from "../index.html"
-	    into '../updatesite'
+	    from workspacePath + groupID+'.repository/target/repository/'
+	    into workspacePath + 'updatesite'
+	    from workspacePath + "index.html"
+	    into workspacePath + 'updatesite'
 }
+
diff --git a/de.prob.releng/settings.gradle b/settings.gradle
similarity index 96%
rename from de.prob.releng/settings.gradle
rename to settings.gradle
index 6adc11aa..b18aa1f3 100644
--- a/de.prob.releng/settings.gradle
+++ b/settings.gradle
@@ -1 +1,2 @@
-include 'de.prob.core', 'de.bmotionstudio.gef.editor' ,'de.bmotionstudio.rodin', 'de.prob.plugin', 'de.prob.ui', 'de.prob2.feature'
\ No newline at end of file
+
+include 'de.prob.core', 'de.bmotionstudio.gef.editor' ,'de.bmotionstudio.rodin', 'de.prob.plugin', 'de.prob.ui', 'de.prob2.feature'
diff --git a/de.prob.releng/tycho_build.gradle b/tycho_build.gradle
similarity index 94%
rename from de.prob.releng/tycho_build.gradle
rename to tycho_build.gradle
index 25a3644e..08dfe1d8 100644
--- a/de.prob.releng/tycho_build.gradle
+++ b/tycho_build.gradle
@@ -7,7 +7,7 @@ tychoVersion = "0.14.1"
 try{
 	workspacePath = workspacePath
 }catch(MissingPropertyException e){
-	workspacePath = "../"
+	workspacePath = ""
 }
 
 
@@ -131,17 +131,33 @@ subprojects {
 	
 	apply plugin: 'base'
 	apply plugin: 'java'
+	apply plugin: 'eclipse'
 	
 	task deleteArtifacts(type: Delete) {
   		delete 'target','pom.xml'
 	}
 	
 	/////				Copy Dependencies into subprojects DependencyFolder 				///// 
-	task collectDependencies(type: Copy){
+	task collectDependencies(type: Copy , dependsOn: ['eclipse']){
 
 		   	from configurations.compile
 	   	
-			into "../"+workspacePath+project.name+"/${dependencyFolder}" 					
+			
+			into "${dependencyFolder}" 	
+			
+			
+			eclipse {
+
+			  classpath {
+			    //adding extra configurations:
+			    plusConfigurations += configurations.compile
+
+			    //default settings for dependencies sources/javadoc download:
+			    downloadSources = true
+			    downloadJavadoc = false
+			  }
+			}
+							
 			
 	}
 	////////////////////////////////////////////////////////////////////////////////////////////	
@@ -157,12 +173,12 @@ subprojects {
 		*	
 		*	Version Numbers of the projects are collected via 
 		*	regular expressions in the Manifest.MF File.  
-		*	Versionnumber of the projects are equal to their
+		*	versionnumber of the projects are equal to their
 		*	Bundle-Version Number
 		*/
 		
 		
-		if(features.every{ it != project.name }){			// Generating Poms for sub projects except features
+		if(features.every{ it != project.name }){		// Generating Poms for sub projects except features
 			content = new File(workspacePath+"${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") 
 
 	 		printFileLine = { 
@@ -210,7 +226,7 @@ subprojects {
 				*	old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files
 				*/
 			}
-		}else{	// if subprojects aren't a feature
+		}else{	//  end  of { if subprojects aren't a feature } Block
 	
 //		--		Features 					--			//
 	
@@ -293,7 +309,7 @@ task createRepository() << {
 		f << categoryFeatures(featureArtifactId.replace(workspacePath,''), featureVersionNumber)
 	}// for
 			
-	for(int i = 0; i < features.size(); i++){
+	for( int i = 0; i < features.size(); i++ ){
 						
 		f << categoryDescription(features[i], descriptions[0][features[i]] ,descriptions[1][features[i]] )
 		//							featureName,	label,		description
-- 
GitLab