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 @@
apply plugin: 'base'
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{
workspacePath = workspacePath
}catch(MissingPropertyException e){
workspacePath = ""
project.ext.workspacePath = ""
}
try{
dependencyFolder = dependencyFolder
}catch(MissingPropertyException e){
dependencyFolder = "lib/dependencies/" // Folder in each subproject where
project.ext.dependencyFolder = "lib/dependencies/" // Folder in each subproject where
}
try{
......@@ -47,8 +59,8 @@ try{
}
groupID = "group"
for( i = 0; i < folderNames.size(); i++ ){
project.ext.groupID = "group"
for( int i = 0; i < folderNames.size(); i++ ){
if( folderNames[i] ==~ /.*\.[rR]eleng/ ){
groupID = folderNames[i]
......@@ -64,8 +76,8 @@ try{
features = features
}catch(MissingPropertyException e){
features = []
for( i = 0; i < subprojects.name.size(); i++ ){
project.ext.features = []
for( int i = 0; i < subprojects.name.size(); i++ ){
if( subprojects.name[i] ==~ /.*\.[fF]eature/ ){
features.add( subprojects.name[i] )
}
......@@ -77,13 +89,13 @@ try{
try{
repositoryName = repositoryName
}catch(MissingPropertyException e){
repositoryName = groupID+".repository"
project.ext.repositoryName = groupID+".repository"
}
try{
parentID = parentID
}catch(MissingPropertyException e){
parentID = groupID+".parent"
project.ext.parentID = groupID+".parent"
}
Boolean noDescriptions = false // in case of using own CategoryDescription Map
......@@ -91,21 +103,21 @@ Boolean noDescriptions = false // in case of using own CategoryDescription M
try{
categoryDescriptions = categoryDescriptions
}catch(MissingPropertyException e){
categoryDescriptions = [ [:],[:] ] // label and descriptions of the features
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
try{
targetRepositories = targetRepositories
}catch(MissingPropertyException e){
targetRepositories = ["http://download.eclipse.org/releases/indigo/"]
project.ext.targetRepositories = ["http://download.eclipse.org/releases/indigo/"]
}
try{
buildProduct = buildProduct
}catch(MissingPropertyException e){
buildProduct = false
project.ext.buildProduct = false
}
......@@ -307,6 +319,7 @@ subprojects {
task collectDependencies(type: Copy) {
from configurations.compile
from configurations.runtime
into "${dependencyFolder}"
......@@ -315,7 +328,7 @@ subprojects {
task setClassPath(dependsOn: 'collectDependencies')<<{
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 = []
try{
def dir = new File(workspacePath+project.name+"/"+dependencyFolder).eachFile() { file->
......@@ -352,7 +365,7 @@ subprojects {
}catch(Exception e){
println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
}
//}// if projectAbfrage
}// if exclude projectAbfrage
}// setClassPath
......@@ -399,9 +412,9 @@ subprojects {
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/ ){
versionNumber = it.substring(16) // possibile error: cuts off first 16 chars
......@@ -490,8 +503,12 @@ task createParent() << {
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()
......@@ -556,6 +573,11 @@ task completeInstall(dependsOn: [subprojects.collectDependencies, createPoms], t
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 --//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment