o adding install capability

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162564 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2004-02-07 16:55:04 +00:00
parent 91754d90ef
commit bb6dd6ae52
3 changed files with 26 additions and 8 deletions

View File

@ -1,3 +1,2 @@
o obey jar overrides
o transitive deps
o install

View File

@ -151,9 +151,10 @@ buildMavenProject()
# 5. Create JAR.
# $1 == directory where project lives
# $4 == jar name
# $5 == flag to leave mboot files
# $2 == jar name
# $3 == flag to install
# $4 == flag to leave mboot files
(
home=`pwd`
@ -236,8 +237,21 @@ buildMavenProject()
echo "Building jars (${jarName}) in `pwd`/target"
buildJar $buildDest target/${jarName}
if [ -z $3 ]
if [ "$3" = "1" ]
then
findAndSetMavenRepoLocal
groupId=`cat project.xml | tr '\n' ' ' | sed 's#<dependencies>.*</dependencies>##' | grep '<groupId>' | sed -e 's#^.*<groupId>##;s#</groupId>.*$##'`
echo "Installing ${jarName} in ${repoLocal}/${groupId}/jars"
cp target/${jarName} ${repoLocal}/${groupId}/jars
fi
if [ "$4" = "0" ]
then
rm -f bootstrap.classpath > /dev/null 2>&1
rm -f bootstrap.libs > /dev/null 2>&1
@ -247,6 +261,7 @@ buildMavenProject()
rm -f bootstrap.tests.excludes > /dev/null 2>&1
rm -f bootstrap.tests.resources > /dev/null 2>&1
fi
)
}

View File

@ -12,7 +12,8 @@ usage ()
dir="."
jar="default"
leaveBootFiles=""
leaveBootFiles="0"
install="0"
while [ $# -gt 0 ]; do
case $1 in
@ -45,6 +46,9 @@ while [ $# -gt 0 ]; do
--leave-boot-files)
leaveBootFiles=1;
;;
--install)
install=1;
;;
esac
shift
@ -58,4 +62,4 @@ export MBOOT_HOME=`dirname $0`
[ ! -f $dir/project.xml ] && echo "No project.xml in specified directory!" && exit
buildMavenProject $dir $jar $leaveBootFiles
buildMavenProject $dir $jar $install $leaveBootFiles