File: lock-version-common.sh

package info (click to toggle)
libshib-parent-project2-java 1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 640 kB
  • ctags: 20
  • sloc: xml: 915; sh: 268; makefile: 6
file content (38 lines) | stat: -rwxr-xr-x 1,258 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash

declare -r SVN=${SVN:-"/usr/bin/svn"}
declare -r SED=${SED:-"/usr/bin/sed"}

# $1 the version number to use
# $2 the directory of the monolithic project or project module
function lock_pom {
    if [ ! -f "$2/pom.xml" ] ; then
        return
    fi

    echo "Setting the version of parent POM in $2/pom.xml"
    $SED "s/TRUNK-SNAPSHOT/$1/1" "$2/pom.xml" > "$2/pom.xml.tmp"
    RETVAL=$?
    if [ $RETVAL != 0 ] ; then
        echo "Setting the version of the parent POM in $2/pom.xml failed with a status code of $RETVAL"
        exit 1;
    fi
    mv "$2/pom.xml.tmp" "$2/pom.xml"
}

# $1 the version number to use
# $2 the directory of the monolithic project or project module
function lock_checkstyle {
    if [ ! -f "$2/.checkstyle" ] ; then
        return
    fi

    echo "Setting the version of the checkstyle configuration located in $2/.checkstyle"
    $SED "s/java-parent-project-v2\/trunk\/resources/java-parent-project-v2\/tags\/$1\/resources/1" "$2/.checkstyle" > "$2/.checkstyle.tmp"
    RETVAL=$?
    if [ $RETVAL != 0 ] ; then
        echo "Setting the version of the checkstyle configuration located in $2/.checkstyle failed with a status code of $RETVAL"
        exit 1;
    fi
    mv "$2/.checkstyle.tmp" "$2/.checkstyle"
}