Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Changes ONOS version in POM files, and other release artifacts. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
| 9 | export NEW_VERSION=$1 |
| 10 | [ -z "$NEW_VERSION" ] && echo "New ONOS version not specified" && exit 1 |
| 11 | |
| 12 | export NEW_VERSION_SHORT=${NEW_VERSION%-SNAPSHOT} |
| 13 | |
| 14 | cd $ONOS_ROOT |
| 15 | |
| 16 | # Augment the version of the main pom and the modules nested underneath. |
| 17 | mvn versions:set -DnewVersion=$NEW_VERSION versions:commit |
| 18 | |
| 19 | # Augment the version of the Java API pom files and the overview.html file. |
| 20 | for pom in docs/pom.xml docs/external.xml; do |
| 21 | sed -i "" -E "1,/<version>/s/<version>[^<]*</<version>$NEW_VERSION</g" $pom |
| 22 | sed -i "" -E "1,/<doctitle>/s/<doctitle>ONOS Java API[^<]*</<doctitle>ONOS Java API ($NEW_VERSION)</g" $pom |
| 23 | done |
| 24 | |
| 25 | # Augment the version in envDefaults, onos.py and archetypes test |
| 26 | sed -i "" -E "s/ONOS_VERSION:-[^$]*/ONOS_VERSION:-$NEW_VERSION_SHORT./" $ONOS_ROOT/tools/build/envDefaults |
| 27 | sed -i "" -E "s/features\/.*\/xml/features\/$NEW_VERSION\/xml/" $ONOS_ROOT/tools/test/topos/onos.py |
| 28 | sed -i "" -E "s/ -Dversion=.*\"/ -Dversion=$NEW_VERSION\"/" $ONOS_ROOT/tools/test/bin/onos-archetypes-test |
Brian O'Connor | 988fc2a | 2015-03-17 20:29:21 -0700 | [diff] [blame] | 29 | sed -i "" -E "s/ONOS_POM_VERSION=.*\"/ONOS_POM_VERSION=\"$NEW_VERSION\"/" $ONOS_ROOT/tools/build/envDefaults |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 30 | |
Brian O'Connor | a7b33ca | 2015-06-05 20:50:34 -0700 | [diff] [blame] | 31 | # Augment the version in jdvue/bin and stc/bin |
| 32 | sed -i "" -E "s/VER=.*/VER=$NEW_VERSION/" $ONOS_ROOT/utils/jdvue/bin/jdvue |
| 33 | sed -i "" -E "s/VER=.*/VER=$NEW_VERSION/" $ONOS_ROOT/utils/stc/bin/stc |
| 34 | sed -i "" -E "s/VER=.*/VER=$NEW_VERSION/" $ONOS_ROOT/tools/test/bin/stc |
| 35 | |
Brian O'Connor | 68ddd74 | 2015-03-25 14:11:17 -0700 | [diff] [blame] | 36 | # Augment fallback version in CoreManager |
| 37 | sed -i "" -E "s/Version\.version\(\"[^\"]*\"\)/Version.version(\"$NEW_VERSION\")/" \ |
| 38 | $ONOS_ROOT/core/net/src/main/java/org/onosproject/core/impl/CoreManager.java |
| 39 | |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 40 | # Augment the version in archetypes tree. |
| 41 | mvn -f tools/package/archetypes/pom.xml versions:set -DnewVersion=$NEW_VERSION versions:commit |
Brian O'Connor | 809a963 | 2015-06-05 20:10:56 -0700 | [diff] [blame] | 42 | for atype in api bundle cli ui; do |
Thomas Vachuska | 683b31b | 2015-01-26 11:54:31 -0800 | [diff] [blame] | 43 | pom="tools/package/archetypes/$atype/src/main/resources/archetype-resources/pom.xml" |
| 44 | sed -i "" -E "1,/<onos.version>/s/<onos.version>[^<]*</<onos.version>$NEW_VERSION</g" $pom |
| 45 | done |
| 46 | |