blob: d0f9187f942ae1a989c08fa89276548ffd460e35 [file] [log] [blame]
<?xml version="1.0"?>
<!-- ======================================================================
ANT script to build org.eclispe.ohf.stem.geography project
and the initial set of STEM scenarios.
This must be run after installing the STEM workspace and after changes
to code generated by EMF models.
====================================================================== -->
<project name="STEM Internal Geographic Models" default="update_all">
Use the properties files to populate the plugin
<!-- P r o j e c t S p e c i f i c a t i o n s -->
<!-- The name of the project -->
<property name="" value="stem" />
<!-- Are we running headless? -->
<condition property="runningHeadless" >
<isset property="buildDirectory" />
<!-- The buildDirectory property is set in a headless build -->
<condition property="pluginRootDirectory" value="${buildDirectory}/plugins" else="..">
<isset property="runningHeadless" />
<!-- The baseLocation property is the location of the eclipse home installation -->
<!-- It is used to find eclipse plugins -->
<!-- It is set in a headless build, but not one started manually from Eclipse -->
<condition property="baseLocation" value="${eclipse.pdebuild.home}../..">
<isset property="runningHeadless" />
<!-- This is the location of the class files of the built plug-ins -->
<!-- If this is a manual build started from Eclipse then the directory -->
<!-- is "bin", if its a headless build then the directory is "@dot" -->
<!-- The property baseLocation is set in a headless build -->
<condition property="targetBin" value="@dot" else="bin">
<isset property="runningHeadless" />
<!-- The prefix for fully qualified names -->
<property name="ID_ROOT" value="org.eclipse.stem" />
<!-- The name of the plugin that contains the plugin.xml file to scan -->
<property name="scan.plugin" value="${ID_ROOT}.data.geography" />
<!-- The name of the source plugin (i.e., the one that contains this file -->
<property name="source.plugin" value="${ID_ROOT}" />
<!-- The name of the target plugin -->
<property name="target.plugin" value="${ID_ROOT}.data.geography.models" />
<!-- The path to the root directory of the source plugin -->
<property name="path.sourceplugin" location="${pluginRootDirectory}/${source.plugin}" />
<!-- The path to the root directory of the plugin that will be augmented with generated content -->
<property name="path.targetplugin" location="${pluginRootDirectory}/${target.plugin}" />
<!-- The path to the root directory of the resource files -->
<property name="path.resource.files" value="${path.sourceplugin}/resources/data/country" />
<!-- The path to the root directory of the plugin that will be augmented with generated content-->
<property name="path.generated.files" value="${path.sourceplugin}/temp" />
<!-- The path to the root directory of geography source code -->
<property name="path.geography.src" value="${path.targetplugin}/src/org/eclipse/stem/data/geography/models" />
<!-- The name of the plugin.xml file that will be augmented with generated content-->
<property name="" value="${path.targetplugin}/plugin.xml" />
<!-- The name of the file that will be augmented with generated content-->
<property name="" value="${path.targetplugin}/" />
<!-- The name of the plugin.xml file that that is the aggregation of the generated content-->
<property name="file.util.pluginxml" value="${path.generated.files}/plugin.xml" />
<!-- The name of the file that that is the aggregation of the generated content-->
<property name="file.util.pluginproperties" value="${path.generated.files}/" />
<!-- The name of the plugin.xml file that that is the aggregation of the generated content-->
<property name="" value="${path.generated.files}/" />
<!-- The class path to use -->
<path id="classpath.runtime">
<pathelement location="${path.sourceplugin}/${targetBin}" />
<pathelement location="${pluginRootDirectory}/../../org.eclipse.stem/core/${ID_ROOT}.core/${targetBin}" />
<pathelement location="${pluginRootDirectory}/../../org.eclipse.stem/core/${ID_ROOT}.definitions/${targetBin}" />
<pathelement location="${pluginRootDirectory}/../../org.eclipse.stem/core/${ID_ROOT}.geography/${targetBin}" />
<pathelement location="${pluginRootDirectory}/../${ID_ROOT}${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}${targetBin}" />
<pathelement location="${pluginRootDirectory}/${ID_ROOT}.data.geography/${targetBin}" />
<fileset dir="${baseLocation}/plugins/">
<include name="*emf*.jar" />
<fileset dir="${pluginRootDirectory}/../${ID_ROOT}">
<include name="*emf*.jar" />
<target name="update_all" depends="update_geography" />
<!-- Update the geography plugin with the latest definitions -->
<target name="update_geography" depends="update_geography_models, update_geography_plugin_xml, update_geography_plugin_properties" />
<target name="update_geography_plugin_xml" depends="create_candidates">
<copy tofile="${}" file="${file.util.pluginxml}" overwrite="true" />
<target name="update_geography_plugin_properties" depends="create_candidates">
<copy tofile="${}" file="${file.util.pluginproperties}" overwrite="true" />
<!-- Update the graph files in the geography plugin -->
<target name="update_geography_models" depends="create_candidates">
<copy todir="${path.targetplugin}/resources/data/" overwrite="true">
<fileset dir="${path.generated.files}/resources/data">
<include name="**/*.model" />
<!-- Create the model files for countries and the plugin.xml and fragments -->
<target name="create_candidates" depends="clean">
<!-- There is a problem here with specifying fork="true" maxmemory="768m". It causes an IOException on some machines -->
<java classname="${ID_ROOT}" fork="true" maxmemory="1024m">
<classpath refid="classpath.runtime" />
<arg value="${path.generated.files}" />
<arg value="${scan.plugin}" />
<jvmarg value="-Xms1024m"/>
<jvmarg value="-Xmx1024m"/>
<!-- clean out the .../temp/data directories -->
<!-- clean out the target directories -->
<target name="clean" depends="create_generated_files_dir">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${path.generated.files}/">
<include name="**/*" />
<fileset dir="${path.targetplugin}/resources/data/">
<include name="country/**/*" />
<target name="create_generated_files_dir">
<mkdir dir="${path.generated.files}/resources/data"/>