Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2019-10-10 12:45:45 +0000
committerJan Belle2019-10-11 13:40:53 +0000
commitaac958396bc0a687d2fac361f2b3bcb073e16d1f (patch)
treedc077eae11fd8151a59d8352f2cfa9e0bf4ce5bc /releng/org.eclipse.etrice.site/build.gradle
parent105760a8e143d474638d3d1b3ee443a9ed666fc8 (diff)
downloadorg.eclipse.etrice-aac958396bc0a687d2fac361f2b3bcb073e16d1f.tar.gz
org.eclipse.etrice-aac958396bc0a687d2fac361f2b3bcb073e16d1f.tar.xz
org.eclipse.etrice-aac958396bc0a687d2fac361f2b3bcb073e16d1f.zip
[releng] Ensure consistent versioning of eclipse plugins
* Set all plugin and feature versions to 0.0.0 * Remove all version constraints of plugin dependencies * Implement build logic to update version strings * Integrate maven tycho build in gradle build Plugin and feature versions are updated by the build process. Version is computed from last git tag. Bug 541499 Change-Id: Ic9453508a27488239718074c318182977a21c214
Diffstat (limited to 'releng/org.eclipse.etrice.site/build.gradle')
-rw-r--r--releng/org.eclipse.etrice.site/build.gradle60
1 files changed, 58 insertions, 2 deletions
diff --git a/releng/org.eclipse.etrice.site/build.gradle b/releng/org.eclipse.etrice.site/build.gradle
index 991070c1c..0867a1a06 100644
--- a/releng/org.eclipse.etrice.site/build.gradle
+++ b/releng/org.eclipse.etrice.site/build.gradle
@@ -2,7 +2,63 @@ configurations {
archive
}
-artifacts {
- archive fileTree(dir: 'target', include: 'org.eclipse.etrice.site-*.zip').files
+task updateVersionStrings {
+ doLast {
+ def manifestVersion = "${scmVersion.undecoratedVersion}.qualifier"
+ // Replace plugin versions
+ ant.replaceregexp(
+ match: "Bundle-Version:\\s*[\\w.-]*",
+ replace: "Bundle-Version: $manifestVersion") {
+ fileset(dir: rootDir, includes: '**/MANIFEST.MF')
+ }
+ // Replace feature versions
+ ant.replaceregexp(
+ match: "(?s)<feature(.*?)version\\s*=\\s*\"[\\w.-]*\"(.*)>",
+ replace: "<feature\\1version=\"$manifestVersion\"\\2>") {
+ fileset(dir: rootDir, includes: '**/feature.xml')
+ }
+ // Replace first occurence of version tag in poms
+ ant.replaceregexp(
+ match: "(?s)(.*?)<version>[\\w.-]*</version>(.*)",
+ replace: "\\1<version>$version</version>\\2") {
+ fileset(dir: rootDir, includes: '**/pom.xml')
+ }
+ }
+}
+
+task runMaven(type: MavenExec, dependsOn: updateVersionStrings) {
+ workingDir rootDir
+ goals 'clean', 'verify'
+ options {
+ define = ['build.type' : version.endsWith('SNAPSHOT') ? 'N' : 'R']
+ if(findProperty('sign') != null) {
+ activateProfiles = ['sign']
+ }
+ }
+}
+
+def maven = findProperty('maven')
+if(maven != null) {
+ if(!maven.empty) {
+ runMaven.mavenDir = rootProject.file(maven)
+ }
}
+else {
+ updateVersionStrings.enabled = false
+ runMaven.enabled = false
+}
+
+def siteZipName = "${project.name}-${version}.zip"
+task copySiteZip(type: Copy, dependsOn: runMaven) {
+ from 'target'
+ include "${project.name}-*.zip"
+ into buildDir
+ rename { siteZipName }
+}
+
+artifacts {
+ archive(layout.buildDirectory.file(siteZipName)) {
+ builtBy copySiteZip
+ }
+} \ No newline at end of file

Back to the top