forked from phoedos/pmd
add usage function for release script, and missing required argument check
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7235 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -1,11 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
version=$1
|
usage() {
|
||||||
|
echo "$(basename ${0}) version-number"
|
||||||
|
echo "this scripts requires the release version number"
|
||||||
|
}
|
||||||
|
|
||||||
pmd_top_dir=~/tmp
|
version="${1}"
|
||||||
pmd_bin_dir=$pmd_top_dir/pmd-$version
|
|
||||||
pmd_src_dir=$pmd_top_dir/pmd-$version
|
if [ -z ${version} ]; then
|
||||||
pmd_tmp_dir=$pmd_top_dir/pmd-tmp
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "building release version ${version}"
|
||||||
|
|
||||||
|
pmd_top_dir="$(mktemp -d)"
|
||||||
|
echo "working directory is:${pmd_top_dir}"
|
||||||
|
pmd_bin_dir="${pmd_top_dir}/pmd-${version}"
|
||||||
|
pmd_src_dir="${pmd_top_dir}/pmd-${version}"
|
||||||
|
pmd_tmp_dir="${pmd_top_dir}/pmd-tmp"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Rebuilding everything"
|
echo "Rebuilding everything"
|
||||||
@ -26,37 +39,37 @@ echo
|
|||||||
echo "generating binary file $pmd_top_dir/pmd-bin-$version.zip"
|
echo "generating binary file $pmd_top_dir/pmd-bin-$version.zip"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
rm -rf $pmd_bin_dir
|
rm -rf "${pmd_bin_dir}"
|
||||||
rm -f $pmd_top_dir/pmd-bin-$version.zip
|
rm -f "${pmd_top_dir}/pmd-bin-${version}.zip"
|
||||||
mkdir -p $pmd_bin_dir/etc
|
mkdir -p "${pmd_bin_dir}/etc"
|
||||||
mkdir $pmd_bin_dir/bin
|
mkdir "${pmd_bin_dir}/bin"
|
||||||
mkdir $pmd_bin_dir/lib
|
mkdir "${pmd_bin_dir}/lib"
|
||||||
mkdir -p $pmd_bin_dir/java14/lib
|
mkdir -p "${pmd_bin_dir}/java14/lib"
|
||||||
mkdir $pmd_bin_dir/java14/bin
|
mkdir "${pmd_bin_dir}/java14/bin"
|
||||||
cp ../LICENSE.txt changelog.txt $pmd_bin_dir/etc
|
cp ../LICENSE.txt changelog.txt "${pmd_bin_dir}/etc"
|
||||||
cd ../bin/
|
cd ../bin/
|
||||||
cp pmd.* build.xml cpd.sh cpdgui.bat designer.* $pmd_bin_dir/bin
|
cp pmd.* build.xml cpd.sh cpdgui.bat designer.* "${pmd_bin_dir}/bin"
|
||||||
cd ../etc/
|
cd ../etc/
|
||||||
cp ../java14/lib/*.jar $pmd_bin_dir/java14/lib/
|
cp ../java14/lib/*.jar "${pmd_bin_dir}/java14/lib/"
|
||||||
cp ../java14/bin/cpd* ../java14/bin/pmd.* ../java14/bin/designer.* $pmd_bin_dir/java14/bin/
|
cp ../java14/bin/cpd* ../java14/bin/pmd.* ../java14/bin/designer.* "${pmd_bin_dir}/java14/bin/"
|
||||||
chmod 755 $pmd_bin_dir/java14/bin/*
|
chmod 755 "${pmd_bin_dir}/java14/bin/*"
|
||||||
cp ../lib/pmd-$version.jar ../lib/asm-3.2.jar ../lib/jaxen-1.1.1.jar ../lib/junit-4.4.jar $pmd_bin_dir/lib/
|
cp ../lib/pmd-$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
|
mkdir "${pmd_bin_dir}/etc/xslt"
|
||||||
cp xslt/*.xslt xslt/*.js xslt/*.gif xslt/*.css $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
|
cp -R ../target/docs "${pmd_bin_dir}"
|
||||||
cd $pmd_top_dir
|
cd "${pmd_top_dir}"
|
||||||
zip -q -r pmd-bin-$version.zip pmd-$version/
|
zip -q -r "pmd-bin-${version}.zip pmd-${version}/"
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "binary package generated"
|
echo "binary package generated"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
release_tag=`echo $version|sed -e "s/\./_/g"`
|
release_tag=$(echo ${version} | sed -e 's/\./_/g' )
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo "Type \"yes\" to tag svn repository using 'pmd_release_$release_tag'"
|
echo "Type \"yes\" to tag svn repository using 'pmd_release_${release_tag}'"
|
||||||
|
|
||||||
read RESP;
|
read RESP;
|
||||||
|
|
||||||
@ -65,7 +78,7 @@ if [ "$RESP" = "yes" ]; then
|
|||||||
echo "Tagging release using"
|
echo "Tagging release using"
|
||||||
echo "svn copy -m \"$version release tag\" https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag"
|
echo "svn copy -m \"$version release tag\" https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag"
|
||||||
echo
|
echo
|
||||||
svn copy -m "$version release tag" https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag
|
svn copy -m "${version} release tag" https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "Skipping svn tag!!!"
|
echo "Skipping svn tag!!!"
|
||||||
@ -74,20 +87,20 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "generating source file $pmd_top_dir/pmd-src-$version.zip"
|
echo "generating source file ${pmd_top_dir}/pmd-src-${version}.zip"
|
||||||
|
|
||||||
rm -rf $pmd_src_dir
|
rm -rf "${pmd_src_dir}"
|
||||||
rm -f $pmd_top_dir/pmd-src-$version.zip
|
rm -f "${pmd_top_dir}/pmd-src-${version}.zip"
|
||||||
cd ../bin/
|
cd ../bin/
|
||||||
ant jarsrc
|
ant jarsrc
|
||||||
cd ..
|
cd ..
|
||||||
svn -q export https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_$release_tag $pmd_src_dir
|
svn -q export "https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_${release_tag}" "${pmd_src_dir}"
|
||||||
cp lib/pmd-src-$version.jar $pmd_src_dir/lib/
|
cp "lib/pmd-src-${version}.jar" "${pmd_src_dir}/lib/"
|
||||||
cp lib/pmd-$version.jar $pmd_src_dir/lib
|
cp "lib/pmd-${version}.jar" "${pmd_src_dir}/lib"
|
||||||
cp -R target/docs $pmd_src_dir
|
cp -R target/docs "${pmd_src_dir}"
|
||||||
rm -f $pmd_src_dir/etc/clover.license
|
rm -f "${pmd_src_dir}/etc/clover.license"
|
||||||
cd $pmd_top_dir
|
cd "${pmd_top_dir}"
|
||||||
zip -q -r pmd-src-$version.zip pmd-$version/
|
zip -q -r "pmd-src-${version}.zip" "pmd-${version}/"
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Reference in New Issue
Block a user