[New] added new setVersion.sh script

This commit is contained in:
Robert von Burg 2014-09-20 00:14:12 +02:00
parent 181782a829
commit ebc549dc71
2 changed files with 30 additions and 39 deletions

View File

@ -1,15 +1,35 @@
#!/bin/bash
if [ "$#" != "1" ] ; then
echo "ERROR: Version missing or wrong arguments!"
if [ "$#" != "2" ] ; then
echo "ERROR: Wrong arguments!"
echo "Usage: $0 <old_version> <new_version>"
exit 1
fi
if ! mvn -f pom.xml versions:set -DnewVersion="${1}" -DallowSnapshots=true -DgenerateBackupPoms=false ; then
echo "ERROR: Failed to change version in root!"
exit 1
fi
if ! mvn -f versioning_eitchnet_pom.xml versions:set -DnewVersion="${1}" -DallowSnapshots=true -DgenerateBackupPoms=false ; then
echo "ERROR: Failed to change version in submodule!"
exit 1
fi
#if ! mvn -f pom.xml versions:set -DnewVersion="${1}" -DallowSnapshots=true -DgenerateBackupPoms=false ; then
# echo "ERROR: Failed to change version in root!"
# exit 1
#fi
#if ! mvn -f versioning_eitchnet_pom.xml versions:set -DnewVersion="${1}" -DallowSnapshots=true -DgenerateBackupPoms=false ; then
# echo "ERROR: Failed to change version in submodule!"
# exit 1
#fi
old_version="${$1}"
new_version="${$2}"
root="${PWD}"
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:version" -v ${new_version} pom.xml
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:parent/my:version" -v ${new_version} pom.xml
for project in li.* ; then
cd "${root}/${project}"
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:version" -v ${new_version} pom.xml
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:parent/my:version" -v ${new_version} pom.xml
done
for project in ch.* ; then
cd "${root}/${project}"
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:version" -v ${new_version} pom.xml
xmlstarlet ed --ps -L -N my=http://maven.apache.org/POM/4.0.0 -u "/my:project/my:parent/my:version" -v ${new_version} pom.xml
done
sed --in-place "s/${old_version}/${new_version}/" li.strolch.dev/createBundle.sh

View File

@ -1,29 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<buildTimestamp>${maven.build.timestamp}</buildTimestamp>
</properties>
<groupId>ch.eitchnet</groupId>
<artifactId>ch.eitchnet</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>ch.eitchnet</name>
<description>Module build for ch.eitchnet</description>
<packaging>pom</packaging>
<scm>
<connection>scm:git:https://github.com/eitchnet/strolch.git</connection>
<developerConnection>scm:git:git@github.com:eitch/strolch.git</developerConnection>
<url>https://github.com/eitchnet/strolch</url>
</scm>
<modules>
<module>../ch.eitchnet.privilege</module>
<module>../ch.eitchnet.utils</module>
<module>../ch.eitchnet.xmlpers</module>
<module>ch.eitchnet.parent</module>
</modules>
</project>