<?xml version="1.0" standalone="yes" ?>
<project name="SimpleControlSystemExample" default="default">
	<description>Ant Build file for the XFeature test -- FD</description>

	<target name="default">
		<echo>Test the SimpleControlSystemExample of the FD sample configuration</echo>
		
       	<ant antfile="build.xml" dir=".." target="generate" inheritall="false">
        	<property name="FamilyXFM" location="SimpleControlSystem.xfm"/>
        	<property name="FamilyXDM" location="SimpleControlSystem.xdm"/>
        	<property name="AppXFMM" location="SimpleControlSystemApp.xfmm"/>
        	<property name="AppXDM" location="SimpleControlSystemApp.xdm"/>
        	<property name="TmpLoc" location="tmp"/>
       	</ant>
	   	<!--
		<ant target="GenerateApplicationSchema"/>
		<ant target="GenerateAndCheckDisplayModel"/>
		-->
		<ant target="clean"/>
	</target>
		
	<!--
	
	THE TWO TARGETS BELLOW ARE MOVED TO "build.xml" IN PARENT FOLDER
	
	<target name="GenerateApplicationSchema" description="Generates the application metamodel (*.xfmm) from family model (*.xfm).">
		<xmlvalidate file="FD.xfm" lenient="false" failonerror="true" warn="true">
          <attribute name="http://xml.org/sax/features/namespaces" value="true"/>
		  <attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
		</xmlvalidate>
		<xslt force="true" style="../FdXfmmGenMacroProcessing.xsl" in="FD.xfm" out="xfmMacroProcessing.xfm">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>
		<xslt force="true" style="../FdXfmmGenAddUniqueNames.xsl" in="xfmMacroProcessing.xfm" out="xfmAddUniqueNames.xfm">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>
		<xslt force="true" style="../FdXfmmGen.xsl" in="xfmAddUniqueNames.xfm" out="FdControlSystem.xfmm">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>
	</target>

	<target name="GenerateAndCheckDisplayModel" description="Generates the application display model (*.xdm) from family display model (*.xdm) and family meta-model (*.xfmm). Then it checks that the generated display model is complete.">
		<xslt force="true" style="../FdXdmGen.xsl" in="FD.xdm" out="xfmm2xdm.xsl">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>
		<xslt force="true" style="xfmm2xdm.xsl" in="FdControlSystem.xfmm" out="FdControlSystem.xdm">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>			
		<xslt force="true" style="../DisplayModelCompiler.xsl" in="FdControlSystem.xfmm" out="DisplayModelVerifier.xsl">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>			
		<xslt force="true" style="DisplayModelVerifier.xsl" in="FdControlSystem.xdm" out="DisplayModelVerificationResults.txt">
			<factory name="net.sf.saxon.TransformerFactoryImpl"/>
		</xslt>			
		<echo message="MESSAGE: The verification results are written to file 'DisplayModelVerificationResults.txt'"/>
	</target>
	-->
	
	<target name="clean">
		<delete file="DisplayModelVerifier.xsl"/>
		<delete file="xfmAddUniqueNames.xfm"/>
		<delete file="xfmm2xdm.xsl"/>
		<delete file="xfmMacroProcessing.xfm"/>
		<!--
		<delete file="app.xfmm"/>
		<delete file="app.xdm"/>
		<delete file="FeatureMetaModelValidationResults.txt"/>
		<delete file="DisplayModelVerificationResults.txt"/>
		<delete file="GlobalConstraintsVerificationResults.txt"/>
		-->
	</target>	
	
</project>

