summaryrefslogtreecommitdiffstats
path: root/maven/make-copy-poms.sh
blob: 44e5e061f61d8c5909a34f88b23d762a5703829e (plain)
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/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=`./make-list-projects.sh | awk -F: '{print $1}'` || exit 1

for PROJECT in ${PROJECTS}
do
  SOURCE="output/${PROJECT}.pom"
  TARGET="output/${PROJECT}/${VERSION}/${PROJECT}-${VERSION}.pom"
  copy "${SOURCE}" "${TARGET}"
  TARGET="output/${PROJECT}/${VERSION}/pom.xml"
  copy "${SOURCE}" "${TARGET}"
done