Skip to content
Snippets Groups Projects
Commit 28ca9ba2 authored by birkhoff's avatar birkhoff
Browse files

updated tycho script

parent 931f70a1
No related branches found
No related tags found
No related merge requests found
...@@ -13,20 +13,32 @@ ...@@ -13,20 +13,32 @@
apply plugin: 'base' apply plugin: 'base'
import groovy.io.FileType import groovy.io.FileType
tychoVersion = "0.14.1" project.ext.tychoVersion = "0.15.0"
try{
excludeFromTychoBuild = excludeFromTychoBuild
}catch(MissingPropertyException e){
project.ext.excludeFromTychoBuild = []
}
try{
excludeFromClassPath = excludeFromClassPath
}catch(MissingPropertyException e){
project.ext.excludeFromClassPath = []
}
try{ try{
workspacePath = workspacePath workspacePath = workspacePath
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
workspacePath = "" project.ext.workspacePath = ""
} }
try{ try{
dependencyFolder = dependencyFolder dependencyFolder = dependencyFolder
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
dependencyFolder = "lib/dependencies/" // Folder in each subproject where project.ext.dependencyFolder = "lib/dependencies/" // Folder in each subproject where
} }
try{ try{
...@@ -47,8 +59,8 @@ try{ ...@@ -47,8 +59,8 @@ try{
} }
groupID = "group" project.ext.groupID = "group"
for( i = 0; i < folderNames.size(); i++ ){ for( int i = 0; i < folderNames.size(); i++ ){
if( folderNames[i] ==~ /.*\.[rR]eleng/ ){ if( folderNames[i] ==~ /.*\.[rR]eleng/ ){
groupID = folderNames[i] groupID = folderNames[i]
...@@ -64,8 +76,8 @@ try{ ...@@ -64,8 +76,8 @@ try{
features = features features = features
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
features = [] project.ext.features = []
for( i = 0; i < subprojects.name.size(); i++ ){ for( int i = 0; i < subprojects.name.size(); i++ ){
if( subprojects.name[i] ==~ /.*\.[fF]eature/ ){ if( subprojects.name[i] ==~ /.*\.[fF]eature/ ){
features.add( subprojects.name[i] ) features.add( subprojects.name[i] )
} }
...@@ -77,13 +89,13 @@ try{ ...@@ -77,13 +89,13 @@ try{
try{ try{
repositoryName = repositoryName repositoryName = repositoryName
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
repositoryName = groupID+".repository" project.ext.repositoryName = groupID+".repository"
} }
try{ try{
parentID = parentID parentID = parentID
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
parentID = groupID+".parent" 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
...@@ -91,21 +103,21 @@ Boolean noDescriptions = false // in case of using own CategoryDescription M ...@@ -91,21 +103,21 @@ Boolean noDescriptions = false // in case of using own CategoryDescription M
try{ try{
categoryDescriptions = categoryDescriptions categoryDescriptions = categoryDescriptions
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
categoryDescriptions = [ [:],[:] ] // label and descriptions of the features project.ext.categoryDescriptions = [ [:],[:] ] // label and descriptions of the features
noDescriptions = true 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 targetRepositories = targetRepositories
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
targetRepositories = ["http://download.eclipse.org/releases/indigo/"] project.ext.targetRepositories = ["http://download.eclipse.org/releases/indigo/"]
} }
try{ try{
buildProduct = buildProduct buildProduct = buildProduct
}catch(MissingPropertyException e){ }catch(MissingPropertyException e){
buildProduct = false project.ext.buildProduct = false
} }
...@@ -307,6 +319,7 @@ subprojects { ...@@ -307,6 +319,7 @@ subprojects {
task collectDependencies(type: Copy) { task collectDependencies(type: Copy) {
from configurations.compile from configurations.compile
from configurations.runtime
into "${dependencyFolder}" into "${dependencyFolder}"
...@@ -315,7 +328,7 @@ subprojects { ...@@ -315,7 +328,7 @@ subprojects {
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" description = "\tAdds all your Dependencies from your local lib folder in each project to it's classpath"
//if(project.name ==~ /birkhoff.bundle.*/){ if( excludeFromClassPath.every{ it != project.name }){
def dependencyList = [] def dependencyList = []
try{ try{
def dir = new File(workspacePath+project.name+"/"+dependencyFolder).eachFile() { file-> def dir = new File(workspacePath+project.name+"/"+dependencyFolder).eachFile() { file->
...@@ -352,7 +365,7 @@ subprojects { ...@@ -352,7 +365,7 @@ subprojects {
}catch(Exception e){ }catch(Exception e){
println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed" println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
} }
//}// if projectAbfrage }// if exclude projectAbfrage
}// setClassPath }// setClassPath
...@@ -399,9 +412,9 @@ subprojects { ...@@ -399,9 +412,9 @@ subprojects {
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") def content = new File(workspacePath+"${project.name}/META-INF/MANIFEST.MF").getText("UTF-8")
printFileLine = { def printFileLine = {
if( it ==~ /Bundle-Version.+qualifier/ ){ if( it ==~ /Bundle-Version.+qualifier/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
...@@ -490,8 +503,12 @@ task createParent() << { ...@@ -490,8 +503,12 @@ task createParent() << {
f << endRepos() f << endRepos()
f << moduleStart() f << moduleStart()
for(int i = 0; i < numberOfProjects(); i++){ for(int i = 0; i < numberOfProjects(); i++){
if( excludeFromTychoBuild.every{ it != projects(i) } ){
f << module(projects(i)) f << module(projects(i))
} }
}
f << module(repositoryName) f << module(repositoryName)
f << endParent() f << endParent()
...@@ -556,6 +573,11 @@ task completeInstall(dependsOn: [subprojects.collectDependencies, createPoms], t ...@@ -556,6 +573,11 @@ task completeInstall(dependsOn: [subprojects.collectDependencies, createPoms], t
commandLine 'mvn', 'install', '-f', workspacePath+parentID+'/pom.xml' commandLine 'mvn', 'install', '-f', workspacePath+parentID+'/pom.xml'
} }
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'
}
//--- Defining Tycho POM parts --// //--- Defining Tycho POM parts --//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment