blob: a629f4f6fdf5eb1af764c42d3759229ea48ce57d [file] [log] [blame]
<!--
Copyright (c) 20?? ? and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
? - initial API and implementation
Dan Brown (Audacious Inquiry) - added postProcessing target and related properties
-->
<project name="common">
<property name="cdaPluginPath" location="${basedir}/../org.eclipse.mdht.uml.cda"/>
<property name="modelPath.uml" location="${basedir}.model/model/${modelName}.uml"/>
<property name="ecoreModelPath.uml" location="${basedir}/model/${modelName}_Ecore.uml"/>
<property name="domainModelPath.uml" location="${basedir}/model/${modelName}_domain_Ecore.uml"/>
<property name="consolidatedModelPath.uml" location="${basedir}/model/${modelName}_consolidated.uml"/>
<property name="vocabModelPath.uml" location="${basedir}/model/${modelName}_consolidated-vocab.uml"/>
<property name="flattenedModelPath.uml" location="${basedir}/model/${modelName}_flattened.uml"/>
<property name="filteredModelPath.uml" location="${basedir}/model/${modelName}_filtered.uml"/>
<property name="propertiesFilePath" value="${basedir}/plugin.properties" />
<!-- <property name="validation.failOnError" value="false"/> -->
<property name="runPostProcessing" value="false"/>
<target name="all">
<antcall target="transformModel"></antcall>
</target>
<target name="transformModel" description="Transform Ecore UML model.">
<cdatools model="${modelPath.uml}">
<!-- <validateModel failOnError="${validation.failOnError}"/> -->
<transformToEcoreModel ecoreModel="${ecoreModelPath.uml}" />
</cdatools>
<convertEcorePaths filePath="${ecoreModelPath.uml}"/>
<antcall target="postProcessing"/>
<antcall target="refresh"/>
</target>
<available file="${domainModelPath.uml}" property="domainModelPath.uml.present"/>
<target name="convertDomainPaths" if="domainModelPath.uml.present">
<convertEcorePaths filePath="${domainModelPath.uml}"/>
</target>
<target name="postProcessing" if="${runPostProcessing}">
<antcall target="postProcess" />
</target>
<target name="refresh" if="eclipse.running" description="Refresh this folder.">
<eclipse.convertPath fileSystemPath="${basedir}" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<macrodef name="replaceTemplateNames">
<attribute name="oldTemplateName" />
<attribute name="newTemplateName" />
<sequential>
<replace file="${propertiesFilePath}" token="@{oldTemplateName}" value="@{newTemplateName}" />
<echo level="info" message="Replacing instances of &quot;@{oldTemplateName}&quot; in ${propertiesFilePath} with &quot;@{newTemplateName}&quot;" />
</sequential>
</macrodef>
</project>