diff options
Diffstat (limited to 'make-copy-poms.sh')
-rwxr-xr-x | make-copy-poms.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/make-copy-poms.sh b/make-copy-poms.sh new file mode 100755 index 0000000..67b64cd --- /dev/null +++ b/make-copy-poms.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +info() +{ + echo "make-copy-poms: info: $1" 1>&2 +} + +copy() +{ + SOURCE="$1" + TARGET="$2" + + info "copy $1 $2.tmp" 1>&2 + cp "$1" "$2.tmp" || exit 1 + info "rename $2.tmp $2" 1>&2 + mv "$2.tmp" "$2" || exit 1 +} + +if [ $# -ne 1 ] +then + echo "make-copy-poms: usage: version" 1>&2 + exit 1 +fi + +VERSION="$1" +shift + +PROJECTS=`cat make-projects.txt | awk -F: '{print $1}'` || exit 1 + +for PROJECT in ${PROJECTS} +do + SOURCE="${PROJECT}.pom" + TARGET="output/${PROJECT}/${VERSION}/${PROJECT}-${VERSION}.pom" + copy "${SOURCE}" "${TARGET}" + TARGET="output/${PROJECT}/${VERSION}/pom.xml" + copy "${SOURCE}" "${TARGET}" +done + |