#!/bin/bash # This script transforms an XMI file generated by Modelio 3.5 in a valide vo-dml file. # - The XMI file has to be copied in $xmiDir # - All output files are stored in $xmiDir # The output vo-dml file is always named as modelname.vo-dml.xml whatever the name of the XMI file is # # Lauren MICHEL - 04/2017 # # Global resources # rootDir=/home/michel/vodml/testbench xmiDir=$rootDir/models xsltDir=$rootDir/xslt modelDir=$rootDir/models antDir=$rootDir/ant graphvizPath=/usr/bin/dot # # Get model references # if [ $# != 1 ] then echo USAGE buildModel [XMI file prefix] exit 1 fi # # Setup of XMI file access # lcModel=`echo "${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 # # Run the transformation # ant -Dmodels=$modelDir -Dmodel=$modelDir -Dxmi.source=$xmiDir/$1.xmi -Dxslt=$rootDir/xslt \ -Dvodml.model=$modelDir/$lcModel.vo-dml.xml -f $antDir/build.xml xmi2vo-dml_Modelio_UML2.4.1