#!/bin/bash # This script run the run_vo-dml task without using property files # This allow to process one model at the time and to process different models stored in one directory # # USAGE: buildModel [model] # - [model]: prefix of the XMI file. # # L Michel 10/2017 # # # Global resources # export rootDir=`dirname $0` cd $rootDir export rootDir=`pwd` export xmiDir=$rootDir/models export xsltDir=$rootDir/../../vo-dml/tools/xslt export modelDir=$rootDir/models export antDir=$rootDir/../../vo-dml/tools #export graphvizPath=/usr/bin/dot #MacOS export graphvizPath=/usr/local/bin/dot # # Get model references # if [ $# != 1 ] then echo USAGE buildModel [model prefix] exit 1 fi # # Setup of XMI file access # lcModel="$1" if [ ! -f $xmiDir/$1.xmi ] then echo File $xmiDir/$1.xmi does not exist echo No $1 project in $xmiDir echo USAGE buildModel [model prefix] exit 1 fi # # Set the UMKL name space as supported by WSLT # sedfile=$modelDir/__tmp__.file for i in `grep -l "20110701" $modelDir/$lcModel.xmi` do sed -e "s/20110701/20100901/g" $modelDir/$lcModel.xmi > $sedfile cp $modelDir/tmp.file $modelDir/$lcModel.xmi rm $sedfile done # # -D parameters overide vo-dml.properties # ant -Dmodels=$modelDir -Dmodel=$modelDir \ -Dxmi.source=$lcModel.xmi -Dxslt=$xsltDir \ -Ddm.filename.prefix=$lcModel \ -Dxmi.source=$lcModel.xmi -Dxmi.source.profile=Modelio_UML2.4.1 \ -Dgraphviz.path=$graphvizPath \ -Dvodml.model=$modelDir/$lcModel.vo-dml.xml -f $antDir/build.xml run_vo-dml