diff --git a/build.gradle b/build.gradle index 43dbf8ebcf4537f093301531dd5d12cc429eb676..8ae05df93abd75b992db3a7b51e8c350599d8a2c 100644 --- a/build.gradle +++ b/build.gradle @@ -132,6 +132,10 @@ subprojects { description = "\tGenerating the Tycho Poms. Please remember to add a '.qualifier' to the version numbers!" versionNumber = 'Version Number Error:\tcheck Manifest for Bundle-Version Number and make sure to add a ".qualifier" to the version numbers!\n' + + 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 diff --git a/de.bmotionstudio.gef.editor/build.gradle b/de.bmotionstudio.gef.editor/build.gradle index c5a89e9c6a65abdc8821b650be529ba25c92213c..ba42248b12f97a16ebe8c06ddd312189a2a6024d 100644 --- a/de.bmotionstudio.gef.editor/build.gradle +++ b/de.bmotionstudio.gef.editor/build.gradle @@ -1,3 +1,51 @@ +apply plugin: 'base' + +deploy <<{ + + content = new File("${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") + + + + 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 + */ + + } + + if( it ==~ /Bundle-SymbolicName:.+/ ){ + artifactId = it.substring(21) + 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(artifactId+'/pom.xml') + f.delete() + f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() + /* + * old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files + */ + +} + + + + +/* -- In case of Error use old Build Script -- deploy <<{ @@ -10,7 +58,7 @@ deploy <<{ * 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 - */ + *//* } } @@ -26,4 +74,4 @@ deploy <<{ f.delete() f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() -} \ No newline at end of file +} */ \ No newline at end of file diff --git a/de.bmotionstudio.rodin/build.gradle b/de.bmotionstudio.rodin/build.gradle index e6f02c697acfa9eeb5c32d8421aaf01e88a6b5b1..94332104c71193c53f9bf6f60e822f29c2790e23 100644 --- a/de.bmotionstudio.rodin/build.gradle +++ b/de.bmotionstudio.rodin/build.gradle @@ -1,4 +1,49 @@ +apply plugin: 'base' +deploy <<{ + + content = new File("${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") + + + + 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 + */ + + } + + if( it ==~ /Bundle-SymbolicName:.+/ ){ + artifactId = it.substring(21) + 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(artifactId+'/pom.xml') + f.delete() + f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() + /* + * old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files + */ + +} + + +/* deploy <<{ content = new File("de.bmotionstudio.rodin/META-INF/MANIFEST.MF").getText("UTF-8") @@ -10,7 +55,7 @@ deploy <<{ * 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 - */ + *//* } } @@ -27,4 +72,6 @@ deploy <<{ f.delete() f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() -} \ No newline at end of file +} + +*/ \ No newline at end of file diff --git a/de.prob.core/build.gradle b/de.prob.core/build.gradle index 401209f8d89c271ef0a65219e17c7c8e625ca339..c8f6efb11fe034cc9b420b3dcddec861839a509c 100644 --- a/de.prob.core/build.gradle +++ b/de.prob.core/build.gradle @@ -1,11 +1,13 @@ apply plugin: 'base' deploy <<{ - - content = new File("de.prob.core/META-INF/MANIFEST.MF").getText("UTF-8") + content = new File("${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") + + - printFileLine = { if( it ==~ /Bundle-Version.+qualifier/ ){ + 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 @@ -15,13 +17,19 @@ deploy <<{ */ } + + if( it ==~ /Bundle-SymbolicName:.+/ ){ + artifactId = it.substring(21) + artifactId = artifactId.replace(";singleton:=true",'') + } + /* Artifact ID is taken from Bundle-SymbolicName minus the + * 16 chars ';singleton:=true' + */ } content.eachLine( printFileLine ) - artifactId = 'de.prob.core' - println artifactId println "\t"+versionNumber diff --git a/de.prob.parent/build.gradle b/de.prob.parent/build.gradle index 6b332ad775f04d00eb1e471ca01074fac53f3008..be028d5715a6ffda7542ba944e0324bbb9d64f9c 100644 --- a/de.prob.parent/build.gradle +++ b/de.prob.parent/build.gradle @@ -66,9 +66,6 @@ deploy <<{ versionNumber = '1.0.0.qualifier' artifactId = parentId() - - println projects(2) + numberOfProjects() + projects(1) - def f = new File(artifactId+'/pom.xml') f.delete() diff --git a/de.prob.plugin/build.gradle b/de.prob.plugin/build.gradle index 86ac130a06fda16b193f58bf9ed30c5350a16299..a40edf015d9ee76b746ca077a87148654276cc5b 100644 --- a/de.prob.plugin/build.gradle +++ b/de.prob.plugin/build.gradle @@ -1,4 +1,50 @@ +apply plugin: 'base' +deploy <<{ + + content = new File("${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") + + + + 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 + */ + + } + + if( it ==~ /Bundle-SymbolicName:.+/ ){ + artifactId = it.substring(21) + 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(artifactId+'/pom.xml') + f.delete() + f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() + /* + * old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files + */ + +} + + + +/* deploy <<{ @@ -11,7 +57,7 @@ deploy <<{ * 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 - */ + *//* } } @@ -27,4 +73,4 @@ deploy <<{ f.delete() f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/de.prob.repository/build.gradle b/de.prob.repository/build.gradle index ab746c32baa9980cd848c6d9f488d168ebff59af..f6bcac70abe81c7667c67daffb253b164ede9d98 100644 --- a/de.prob.repository/build.gradle +++ b/de.prob.repository/build.gradle @@ -21,7 +21,7 @@ def reposi(artifact) { """ deploy <<{ versionNumber = '1.0.0.qualifier' - artifactId = 'de.prob.repository' + artifactId = project.name println artifactId diff --git a/de.prob.ui/build.gradle b/de.prob.ui/build.gradle index 59fef50c1f0e7344cf859f553992554adcfab9dc..88cff69e7f409927812cacebf166ae99736cb141 100644 --- a/de.prob.ui/build.gradle +++ b/de.prob.ui/build.gradle @@ -1,4 +1,49 @@ +apply plugin: 'base' +deploy <<{ + + content = new File("${project.name}/META-INF/MANIFEST.MF").getText("UTF-8") + + + + 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 + */ + + } + + if( it ==~ /Bundle-SymbolicName:.+/ ){ + artifactId = it.substring(21) + 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(artifactId+'/pom.xml') + f.delete() + f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() + /* + * old pom.xml files are deleted and replaced by new auto generated Tycho pom.xml files + */ + +} + + +/* deploy <<{ content = new File("de.prob.ui/META-INF/MANIFEST.MF").getText("UTF-8") @@ -10,7 +55,7 @@ deploy <<{ * 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 - */ + *//* } } @@ -26,4 +71,5 @@ deploy <<{ f.delete() f << start()+elder()+repos()+artifact(artifactId, versionNumber)+end() -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/de.prob2.feature/build.gradle b/de.prob2.feature/build.gradle index 695a03f7a501233685eb4231dd11eeb548deb29f..05a35fa8c8e026f72a0949dfcf366a183a4b0ca0 100644 --- a/de.prob2.feature/build.gradle +++ b/de.prob2.feature/build.gradle @@ -18,9 +18,13 @@ def feature(artifactId, versionNumber) { """ deploy <<{ - content = new File("de.prob2.feature/feature.xml").getText("UTF-8") + boolean idfound = false - printFileLine = { if( it ==~ /.+version.+qualifier.+/ ){ + content = new File("${project.name}/feature.xml").getText("UTF-8") + + printFileLine = { + + if( it ==~ /.+version.+qualifier.+/ ){ versionNumber = it.substring(15,it.size()-1) // possibile error: cuts off first 15 chars and leaves out last '"' @@ -30,12 +34,19 @@ deploy <<{ */ } + + + if( it ==~ /.+id=".+/ && idfound == false ){ + artifactId = it.substring(10,it.length()-1) + idfound = true + } + /* Artifact ID is taken from Bundle-SymbolicName minus the + * 16 chars ';singleton:=true' + */ } content.eachLine( printFileLine ) - - - artifactId = 'de.prob2.feature' + println artifactId println "\t"+versionNumber