Skip to content
Snippets Groups Projects
Commit 868d4d10 authored by birkhoff's avatar birkhoff
Browse files

unwanted parts of substrings are replaced and no longer cut off to prevent...

unwanted parts of substrings are replaced and no longer cut off to prevent mistakes through text formating
parent 2f5e04da
Branches
Tags
No related merge requests found
...@@ -87,8 +87,8 @@ subprojects { ...@@ -87,8 +87,8 @@ subprojects {
} }
if( it ==~ /Bundle-SymbolicName:.+/ ){ if( it ==~ /Bundle-SymbolicName:.+/ ){
artifactId = it.substring(21) artifactId = it
artifactId = artifactId.replace("Bundle-SymbolicName:", '');
artifactId = artifactId.replace(";",'') artifactId = artifactId.replace(";",'')
artifactId = artifactId.replace(" ",'') artifactId = artifactId.replace(" ",'')
artifactId = artifactId.replace("singleton:=true",'') artifactId = artifactId.replace("singleton:=true",'')
...@@ -125,9 +125,10 @@ subprojects { ...@@ -125,9 +125,10 @@ subprojects {
printFileLine = { printFileLine = {
if( it ==~ /.+version.+qualifier.+/ ){ if( it ==~ /.+version.+qualifier.+/ ){
versionNumber = it.substring(15,it.size()-1) versionNumber = it
versionNumber = versionNumber.replace(" ", '')
versionNumber = versionNumber.replace("version=", '')
versionNumber = versionNumber.replace('"', '') versionNumber = versionNumber.replace('"', '')
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml /* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier" * feature.xml is searched for version="version.qualifier"
...@@ -138,12 +139,13 @@ subprojects { ...@@ -138,12 +139,13 @@ subprojects {
if( it ==~ /.+id=".+/ && idfound == false ){ if( it ==~ /.+id=".+/ && idfound == false ){
artifactId = it.substring(10,it.length()-1) artifactId = it
artifactId = artifactId.replace("id=", '')
artifactId = artifactId.replace(" ", '')
artifactId = artifactId.replace('"', '')
idfound = true idfound = true
} }
/* Artifact ID is taken from Bundle-SymbolicName minus the
* 16 chars ';singleton:=true'
*/
} }
content.eachLine( printFileLine ) content.eachLine( printFileLine )
...@@ -210,21 +212,30 @@ task createRepository() << { ...@@ -210,21 +212,30 @@ task createRepository() << {
for(int i = 0; i < features.size(); i++){ for(int i = 0; i < features.size(); i++){
content = new File("${features[i]}/feature.xml").getText("UTF-8") content = new File("${features[i]}/feature.xml").getText("UTF-8")
boolean idfound = false
printFileLine = { printFileLine = {
if( it ==~ /.+version.+qualifier.+/ ){ if( it ==~ /.+version.+qualifier.+/ ){
featureVersionNumber = it.substring(15,it.size()-1) featureVersionNumber = it
featureVersionNumber = featureVersionNumber.replace(" ", '')
featureVersionNumber = featureVersionNumber.replace("version=", '')
featureVersionNumber = featureVersionNumber.replace('"', '') featureVersionNumber = featureVersionNumber.replace('"', '')
// possibile error: cuts off first 15 chars and leaves out last '"'
/* Version Number is taken from Feature.xml
* feature.xml is searched for version="version.qualifier"
* first 15 chars and last '"' are cut off
*/
} }
if( it ==~ /.+id=".+/ && idfound == false ){
featureArtifactId = it
featureArtifactId = featureArtifactId.replace("id=", '')
featureArtifactId = featureArtifactId.replace(" ", '')
featureArtifactId = featureArtifactId.replace('"', '')
idfound = true
}
} }
content.eachLine( printFileLine ) content.eachLine( printFileLine )
f << categoryFeatures(features[i].replace(workspacePath,''), featureVersionNumber) f << categoryFeatures(featureArtifactId.replace(workspacePath,''), featureVersionNumber)
}// for }// for
for(int i = 0; i < features.size(); i++){ for(int i = 0; i < features.size(); i++){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment