From 323b3bdaab45eb94f69e52bab77b6a4f28688997 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Mon, 8 Mar 2004 01:12:32 +0000 Subject: [PATCH] o adding a script for modello which is now used to generate the maven model sources from a modello model file. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162573 13f79535-47bb-0310-9956-ffa450edef68 --- maven-mboot/src/bash/maven.functions | 4 +- maven-mboot/src/bash/modello | 63 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100755 maven-mboot/src/bash/modello diff --git a/maven-mboot/src/bash/maven.functions b/maven-mboot/src/bash/maven.functions index 187ee60e18..b82a788868 100755 --- a/maven-mboot/src/bash/maven.functions +++ b/maven-mboot/src/bash/maven.functions @@ -13,8 +13,8 @@ downloadMBootDependencies() do if [ ! -f $repoLocal/$i ] then - mkdir -p $repoLocal/$i > /dev/null 2>&1 - wget http://www.ibiblio.org/maven/$i $repoLocal/$i > /dev/null 2>&1 + mkdir -p `dirname $repoLocal/$i` > /dev/null 2>&1 + wget http://www.ibiblio.org/maven/$i -O $repoLocal/$i fi done } diff --git a/maven-mboot/src/bash/modello b/maven-mboot/src/bash/modello new file mode 100755 index 0000000000..3d9700579d --- /dev/null +++ b/maven-mboot/src/bash/modello @@ -0,0 +1,63 @@ +#!/bin/sh + +VERSION=1.0 + +usage () +{ + echo "usage: `basename $0` --model= --dir=" >&2 + echo "" >&2 + echo " (ex: `basename $0` --model=model.mdo --dir=target/src)" >&2 + exit 1 +} + +dir="target/src/java" +model="model.mdo" +leaveBootFiles="0" +install="0" + +while [ $# -gt 0 ]; do + case $1 in + --help) + usage + ;; + --version) + echo "mboot: version $VERSION" + exit 0 + ;; + -v) + verbose=-v + ;; + --dir*) + if echo $1 | grep -q '=' ; then + dir=`echo $1 | sed 's/^--dir=//'` + else + dir=$2 + shift + fi + ;; + --model*) + if echo $1 | grep -q '=' ; then + model=`echo $1 | sed 's/^--model=//'` + else + model=$2 + shift + fi + ;; + esac + + shift +done + +export MBOOT_HOME=`dirname $0` + +. ${MBOOT_HOME}/maven.functions + +[ ! -f $model ] && echo "Specified model doesn't exist!" && exit + +[ ! -d $dir ] && mkdir -p $dir + +findAndSetMavenRepoLocal + +CP=$repoLocal/modello/jars/modello-1.0-SNAPSHOT.jar:$repoLocal/xstream/jars/xstream-1.0-SNAPSHOT.jar:$repoLocal/xpp3/jars/xpp3-1.1.3.3.jar + +java -classpath $CP org.codehaus.modello.Modello $model $dir