forked from zkoss/zkthemes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
88 lines (83 loc) · 1.97 KB
/
release
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
#
#{{IS_NOTE
# Purpose:
# To build java projects
# Description:
# 'build help' for more descriptions
# History:
# Apring 6 18:10 2011, Created by jimmyshiau
#}}IS_NOTE
#
#Copyright (C) 2011 Potix Corporation. All Rights Reserved.
#
#{{IS_RIGHT
# This program is distributed under GPL Version 3.0 in the hope that
# it will be useful, but WITHOUT ANY WARRANTY.
#}}IS_RIGHT
#
cmd=$1
maindir="$(pwd)"
stamp=$(date +%Y%m%d)
parentVer=$(head -1 version)
#-- Prepare $targetList
#Add a project to the target list (the redudant ones won't be added)
if [ ! -f build.projects ] ; then
echo build.projects not found
exit 1
fi
targetListOld="$(cat build.projects | tr '\n' ' ')"
targetListOld="${targetListOld% }"
targetList=
for target in $targetListOld ; do
ver=$(head -1 $target/version)
if [ $parentVer == $ver ] ; then
targetList="$targetList $target"
fi
done
function updateVersion
{
if [ "$1" != "" ] ; then
ver=$(head -1 $1/version)
if [ "$cmd" == "official" ] ; then
verFL=$ver
else
verFL=$ver.FL.$stamp
fi
sed -i "1,/description/s/version>.*<\/version/version>$verFL<\/version/" $maindir/$1/pom.xml
else
ver=$(head -1 version)
if [ "$cmd" == "official" ] ; then
verFL=$parentVer
else
verFL=$parentVer.FL.$stamp
fi
sed -i "1,/version>.*<\/version/s/version>.*<\/version/version>$verFL<\/version/" pom.xml
fi
}
updateVersion ""
echo "targets: ${targetList}"
upTargetList="$targetList zkthemedemo breeze"
for target in $upTargetList ; do
if [ -d $target ] ; then
updateVersion $target
else
echo "Ignore: $target doesn't exist"
fi
done
mvn clean package
mkdir -p dist/maven
rm -f dist/maven/zktheme*.jar
mv -f target/*-bundle.jar dist/maven
for target in $targetList ; do
if [ -d $target ] ; then
rm -f dist/maven/$target*.jar
rm -f dist/$target*.jar
rm -f dist/$target*.zip
mv -f $target/target/*-bundle.jar dist/maven
mv -f $target/target/*.jar dist
mv -f $target/target/*.zip dist
else
echo "Ignore: $target doesn't exist"
fi
done