add a function to create root directory tree to harmonize script action between src release and binary release

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@7250 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2011-09-11 19:17:03 +00:00
parent 260e0730b7
commit a37296d7b9

View File

@ -21,6 +21,14 @@ check_dependency() {
fi
}
make_tree_structure() {
local root_dir="{1}"
mkdir -p "${root_dir}/etc"
mkdir "${root_dir}/bin"
mkdir "${root_dir}/lib"
}
while getopts v:dsh OPT; do
case "$OPT" in
h)
@ -87,9 +95,7 @@ fi
echo "generating binary file ${pmd_top_dir}/pmd-bin-${version}.zip"
mkdir -p "${pmd_bin_dir}/etc"
mkdir "${pmd_bin_dir}/bin"
mkdir "${pmd_bin_dir}/lib"
make_tree_structure "${pmd_bin_dir}"
cp ../LICENSE.txt changelog.txt "${pmd_bin_dir}/etc"
cd ../bin/
cp pmd.* build.xml cpd.sh cpdgui.bat designer.* "${pmd_bin_dir}/bin"
@ -122,6 +128,7 @@ cd ..
if [ -z ${no_tags} ]; then
svn -q export "https://pmd.svn.sourceforge.net/svnroot/pmd/tags/pmd/pmd_release_${release_tag}" "${pmd_src_dir}"
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"
cp -R target/docs "${pmd_src_dir}"