enhance release script to support the a snapshot option, rendering the extra generate_snapshot script useless

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7254 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2011-09-11 19:18:11 +00:00
parent 866eb78393
commit bbd2b945cf
2 changed files with 10 additions and 76 deletions

View File

@ -6,6 +6,7 @@ usage() {
echo "-v override the release's version number provided in pom.xml"
echo "-d no docs generation"
echo "-s no SVN tags"
echo "-S generate a snapshot"
echo ""
echo "This script MUST BE executed from the 'etc' folder of the PMD projet."
}
@ -22,7 +23,7 @@ check_dependency() {
}
make_tree_structure() {
local root_dir="{1}"
local root_dir="${1}"
mkdir -p "${root_dir}/etc"
mkdir "${root_dir}/bin"
@ -44,6 +45,9 @@ while getopts v:dsh OPT; do
s)
readonly no_tags="true"
;;
S)
readonly snapshot="true"
;;
*)
echo "Unrecognized options:${OPTARG}"
exit 1;
@ -69,9 +73,7 @@ echo "working directory is:${pmd_top_dir}"
pmd_bin_dir="${pmd_top_dir}/pmd-bin-${version}"
pmd_src_dir="${pmd_top_dir}/pmd-src-${version}"
echo
echo "Rebuilding everything"
echo
set -e
@ -124,7 +126,12 @@ echo "generating source file ${pmd_top_dir}/pmd-src-${version}.zip"
ant -f ../bin/build.xml jarsrc
if [ -z ${no_tags} ]; then
svn -q export "https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_${release_tag}" "${pmd_src_dir}"
else
if [ "${snapshot}" = "true" ] ; then
svn -q export https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x "${pmd_src_dir}"
fi
fi
make_tree_structure "${pmd_src_dir}"
cp "../lib/pmd-src-${version}.jar" "${pmd_src_dir}/lib/"
cp "../lib/pmd-${version}.jar" "${pmd_src_dir}/lib"

View File

@ -1,73 +0,0 @@
#!/bin/bash
version=`grep "<version>4.2" ../pom.xml |sed -e "s/^.*>4/4/g" -e "s/<\/.*//g"`
stripped_version=`grep "<version>4.2" ../pom.xml |sed -e "s/^.*>4/4/g" -e "s/<\/.*//g" -e "s/\-SNAPSHOT//g"`
pmd_top_dir=`pwd`/../release
pmd_bin_dir=$pmd_top_dir/pmd-$version
pmd_src_dir=$pmd_top_dir/pmd-$version
mkdir $pmd_top_dir
echo
echo "Rebuilding everything"
echo
cd ..
ant -f bin/build.xml dist
./docs.sh all
cd etc
echo
echo "generating binary file $pmd_top_dir/pmd-bin-$version.zip"
echo
rm -rf $pmd_bin_dir
rm -f $pmd_top_dir/pmd-bin-$version.zip
mkdir -p $pmd_bin_dir/etc
mkdir $pmd_bin_dir/bin
mkdir $pmd_bin_dir/lib
mkdir -p $pmd_bin_dir/java14/lib
mkdir $pmd_bin_dir/java14/bin
cp ../LICENSE.txt changelog.txt $pmd_bin_dir/etc
cd ../bin/
cp pmd.* build.xml cpd.sh cpdgui.bat designer.* $pmd_bin_dir/bin
cd ../etc/
cp ../java14/lib/*.jar $pmd_bin_dir/java14/lib/
cp ../java14/bin/cpd* ../java14/bin/pmd.* ../java14/bin/designer.* $pmd_bin_dir/java14/bin/
chmod 755 $pmd_bin_dir/java14/bin/*
cp ../lib/pmd-$stripped_version.jar ../lib/asm-3.2.jar ../lib/jaxen-1.1.1.jar ../lib/junit-4.4.jar $pmd_bin_dir/lib/
mkdir $pmd_bin_dir/etc/xslt
cp xslt/*.xslt xslt/*.js xslt/*.gif xslt/*.css $pmd_bin_dir/etc/xslt/
cp -R ../target/docs $pmd_bin_dir
cd $pmd_top_dir
zip -q -r pmd-bin-$version.zip pmd-$version/
cd -
echo
echo "binary package generated"
echo
release_tag=`echo $version|sed -e "s/\./_/g"`
echo "generating source file $pmd_top_dir/pmd-src-$version.zip"
rm -rf $pmd_src_dir
rm -f $pmd_top_dir/pmd-src-$version.zip
cd ../bin/
ant jarsrc
cd ..
svn -q export https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x $pmd_src_dir
cp lib/pmd-src-$stripped_version.jar $pmd_src_dir/lib/
cp lib/pmd-$stripped_version.jar $pmd_src_dir/lib
cp -R target/docs $pmd_src_dir
rm -f $pmd_src_dir/etc/clover.license
cd $pmd_top_dir
zip -q -r pmd-src-$version.zip pmd-$version/
cd -
echo
echo "source package generated"
echo