Skip to content

Commit

Permalink
#289: replace version regex
Browse files Browse the repository at this point in the history
  • Loading branch information
afdia committed Jul 24, 2017
1 parent cf058fd commit 7f2f8c4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 0 additions & 1 deletion umlet-eclipse-feature/feature.xml
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="umlet-eclipse-feature"
label="UMLet Eclipse Plugin"
Expand Down
28 changes: 28 additions & 0 deletions umlet-eclipse-feature/pom.xml
Expand Up @@ -26,6 +26,34 @@
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- update versions in feature.xml with current pom.xml version (replace the -<qualifier> with ".qualifier" to be compatible with OSGI versioning; ".qualifier" will be replaced by tycho with a timestamp, other qualifier values are not supported) -->
<execution>
<id>updateManifestVersion</id>
<!-- this goal must be called explicitly at the same time the mvn version is updated (otherwise tycho would still use the old version) -->
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="newVersionTemp" value="${newVersion}" />
<loadresource property="newVersionOsgi">
<propertyresource name="newVersionTemp" />
<filterchain>
<tokenfilter>
<replaceregex pattern="-.*" replace=".qualifier" />
</tokenfilter>
</filterchain>
</loadresource>
<replaceregexp file="feature.xml" match='(version=").*(")' replace="\1${newVersionOsgi}\2" byline="true" />
<echo message="Updated feature.xml versions to ${newVersionOsgi} (derived from VM Argument: ${newVersion})" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 7f2f8c4

Please sign in to comment.