<?xml version="1.0" encoding="UTF-8"?>
<project name="ch.sahits.codegen" default="build.jars" basedir=".">
<property name="p2.build.repo" value="file:${buildDirectory}/buildRepo"/>
<property name="basews" value="${ws}"/>
<property name="baseos" value="${os}"/>
<property name="basearch" value="${arch}"/>
<property name="basenl" value="${nl}"/>
<property name="bundleId" value="ch.sahits.codegen"/>
<property name="bundleVersion" value="2.1.0"/>
<property name="p2.publishonerror" value="false"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="false"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="logExtension" value=".log"/>
<property name="compilerArg" value=""/>
<property name="javacSource" value="1.3"/>
<property name="javacTarget" value="1.2"/>
<condition property="dir_bootclasspath" value="${java.home}/../Classes">
<os family="mac"/>
</condition>
<property name="dir_bootclasspath" value="${java.home}/lib"/>
<path id="path_bootclasspath">
<fileset dir="${dir_bootclasspath}">
<include name="*.jar"/>
</fileset>
</path>
<property name="bootclasspath" refid="path_bootclasspath"/>
<condition property="bundleBootClasspath" value="${J2SE-1.5}" >
<isset property="J2SE-1.5"/>
</condition>
<condition property="bundleJavacSource" value="1.5" >
<isset property="J2SE-1.5"/>
</condition>
<condition property="bundleJavacTarget" value="1.5" >
<isset property="J2SE-1.5"/>
</condition>
<property name="bundleJavacSource" value="${javacSource}"/>
<property name="bundleJavacTarget" value="${javacTarget}"/>
<property name="bundleBootClasspath" value="${bootclasspath}"/>
<target name="init" depends="properties">
<condition property="pluginTemp" value="${buildTempFolder}/plugins" >
<isset property="buildTempFolder"/>
</condition>
<property name="pluginTemp" value="${basedir}"/>
<condition property="build.result.folder" value="${pluginTemp}/ch.sahits.codegen_${bundleVersion}" >
<isset property="buildTempFolder"/>
</condition>
<property name="build.result.folder" value="${basedir}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<property name="plugin.destination" value="${basedir}"/>
<condition property="p2.publish.parts" value="true" >
<istrue value="${p2.gathering}"/>
</condition>
<property name="compilation.problem.marker" value="${build.result.folder}/compilation.problem"/>
<condition property="compilation.problem.marker.exists" value="true" >
<and>
<available file="${compilation.problem.marker}"/>
<isfalse value="p2.publishonerror"/>
</and>
</condition>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<target name="build.update.jar" depends="init" description="Build the plug-in: ch.sahits.codegen for an update site.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<jar destfile="${plugin.destination}/ch.sahits.codegen_${bundleVersion}.jar" basedir="${temp.folder}/ch.sahits.codegen_${bundleVersion}" filesetmanifest="merge"/>
<delete dir="${temp.folder}"/>
</target>
<target name="@dot" depends="init" unless="@dot" description="Create jar: ch.sahits.codegen @dot.">
<delete dir="${build.result.folder}/@dot"/>
<mkdir dir="${build.result.folder}/@dot"/>
<path id="@dot.classpath">
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui_3.5.0.I20090604-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.runtime_3.5.0.v20090525.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.osgi_3.5.0.v20090520.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.transforms.hook_1.0.100.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.common_3.5.0.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.jobs_3.4.100.v20090429-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800/runtime_registry_compatibility.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20090429-1800"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.preferences_3.2.300.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.contenttype_3.4.0.v20090429-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.runtime.compatibility.auth_3.2.100.v20090413.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.app_1.2.0.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.osgi.services_3.2.0.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/javax.servlet_2.5.0.v200806031605.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.swt_3.5.0.v3550b.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.swt.gtk.linux.x86_3.5.0.v3550b.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jface_3.5.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.commands_3.5.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.workbench_3.5.0.I20090603-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20090429-1800/compatibility.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20090429-1800/e4-workbench.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.workbench.compatibility_3.2.0.I20090429-1800"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/com.ibm.icu_4.0.1.v20090415.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.help_3.4.0.v20090526.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.expressions_3.4.100.v20090429-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jface.databinding_1.3.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.databinding.observable_1.2.0.I20090604-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.databinding.property_1.2.0.I20090526-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.databinding_1.2.0.I20090604-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.resources_3.5.0.v20090512.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.resources.compatibility_3.4.0.v20090505.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ant.core_3.2.100.v20090520.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.variables_3.2.200.v20090521.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.filesystem_1.2.0.v20090507.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.filesystem.linux.x86_1.2.0.v20080604-1400.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.ide_3.5.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.views_3.4.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jface.text_3.5.0.v20090602.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.text_3.5.0.v20090513-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.forms_3.4.0.v20090526.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.engine_1.0.100.v20090525.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.core_1.0.100.v20090520-1905.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.metadata_1.0.100.v20090525.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.metadata.repository_1.0.100.v20090525.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.repository_1.0.0.v20090601-1921.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.security_1.0.100.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ecf.filetransfer_3.0.0.v20090604-1131.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ecf_3.0.0.v20090604-1131.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ecf.ssl_1.0.0.v20090604-1131.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.concurrent_1.0.0.v20090520-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ecf.identity_3.0.0.v20090604-1131.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.artifact.repository_1.0.100.v20090527-1812.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.equinox.p2.jarprocessor_1.0.100.v20090520-1905.jar"/>
<pathelement path="../ch.sahits.codegen.core/bin/"/>
<pathelement path="../ch.sahits.codegen.core/@dot"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.ui_3.5.0.v20090604.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.core_3.5.0.v_963.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.compiler.apt_1.0.200.v20090528-1135.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.compiler.tool_1.0.100.v_963.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.team.core_3.5.0.I20090527-0620.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.search_3.5.0.v20090526-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.core.filebuffers_3.5.0.v20090526-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.workbench.texteditor_3.5.0.v20090603.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.compare.core_3.5.0.I20090430-0408.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ltk.core.refactoring_3.5.0.v20090513-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ltk.ui.refactoring_3.4.100.v20090604.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.navigator_3.4.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.compare_3.5.0.I20090514-0808.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.editors_3.5.0.v20090527-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.team.ui_3.5.0.I20090430-0408.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.navigator.resources_3.4.0.I20090525-2000.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.views.properties.tabbed_3.5.0.I20090429-1800.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.debug.core_3.5.0.v20090526-1600.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.debug.ui_3.5.0.v20090603.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.ui.console_3.4.0.v20090513.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.launching_3.5.0.v20090527.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.debug_3.5.0.v20090526/jdi.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.debug_3.5.0.v20090526/jdimodel.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.debug_3.5.0.v20090526/tools.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.jdt.core.manipulation_1.3.0.v20090603.jar"/>
<pathelement path="../ch.sahits.codegen.help/bin/"/>
<pathelement path="../ch.sahits.codegen.help/@dot"/>
<pathelement path="../ch.sahits.model/bin/"/>
<pathelement path="../ch.sahits.model/@dot"/>
<pathelement path="../ch.sahits.util/sahitsUtil_1.2.1.jar"/>
<pathelement path="../ch.sahits.util/sahitsUtil_src_1.2.1.jar"/>
<pathelement path="../org.jdom/jdom.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.emf.codegen_2.5.0.v200906151043.jar"/>
<pathelement path="../../../../opt/eclipseRCP3.5/plugins/org.eclipse.emf.common_2.5.0.v200906151043.jar"/>
</path>
<!-- compile the source code -->
<javac destdir="${build.result.folder}/@dot" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" >
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
<classpath refid="@dot.classpath" />
<src path="src/" />
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<compilerarg line="-log '${build.result.folder}/@dot${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</javac>
<antcall target="checkCompilationResults"/>
<!-- Copy necessary resources -->
<copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false">
<fileset dir="src/">
<exclude name="**/*.java"/>
<exclude name="**/package.htm*"/>
</fileset>
</copy>
</target>
<target name="src.zip" depends="init" unless="src.zip">
<mkdir dir="${build.result.folder}"/>
<antcall target="zip.src.zip"/>
</target>
<target name="zip.src.zip">
<zip destfile="${build.result.folder}/src.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
</zip>
</target>
<target name="copy.src.zip">
<copy todir="${source.destination.folder}/" failonerror="true" overwrite="true">
<fileset dir="src/">
<include name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: ch.sahits.codegen.">
<delete file="${compilation.problem.marker}" quiet="true"/>
<available property="@dot" file="${build.result.folder}/@dot"/>
<antcall target="@dot"/>
</target>
<target name="checkCompilationResults" if="compilation.error.occured">
<echo file="${compilation.problem.marker}" message="ch.sahits.codegen : compilation.error.occured=${compilation.error.occured}"/>
</target>
<target name="build.sources" depends="init">
<available property="src.zip" file="${build.result.folder}/src.zip"/>
<antcall target="src.zip"/>
</target>
<target name="publish.bin.parts" depends="init" if="p2.publish.parts" unless="compilation.problem.marker.exists">
<mkdir dir="${build.result.folder}/ch.sahits.codegen_${bundleVersion}"/>
<copy todir="${build.result.folder}" failonerror="true" overwrite="true">
<fileset dir="${basedir}">
<include name="META-INF/MANIFEST.MF"/>
<include name="plugin.xml"/>
<include name="fragment.xml"/>
</fileset>
</copy>
<antcall target="apitools.generation">
<param name="target.folder" value="${build.result.folder}"/>
<param name="projectLocation" value="${basedir}"/>
<param name="binary.folders" value="${build.result.folder}/@dot"/>
<param name="projectName" value="${bundleId}_${bundleVersion}"/>
</antcall>
<eclipse.gatherBundle
metadataRepository="${p2.build.repo}"
artifactRepository="${p2.build.repo}"
buildResultFolder="${build.result.folder}"
baseDirectory="${basedir}"
/>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}"/>
<copy todir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}" failonerror="true" overwrite="false">
<fileset dir="${build.result.folder}/@dot">
<include name="**"/>
</fileset>
</copy>
<copy todir="${destination.temp.folder}/ch.sahits.codegen_{bundleVersion}" failonerror="true" overwrite="true">
<fileset dir="${basedir}">
<include name="plugin.xml"/>
<include name="META-INF/"/>
<include name="schema/"/>
<include name="jet_templates/"/>
<include name="icons/GeneralCodegenHeader.png"/>
<include name="icons/GeneralCodegenIcon.png"/>
<include name="icons/JavaCodegenerationHeader.png"/>
<include name="icons/JavaCodeGeneratorIcon.png"/>
</fileset>
</copy>
<antcall target="apitools.generation">
<param name="target.folder" value="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}"/>
<param name="projectLocation" value="${basedir}"/>
<param name="binary.folders" value="${build.result.folder}/@dot"/>
<param name="projectName" value="${bundleId}_${bundleVersion}"/>
</antcall>
</target>
<target name="build.zips" depends="init">
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}"/>
<copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}" failonerror="false" overwrite="false"/>
<antcall target="copy.src.includes">
<param name="source.destination.folder" value="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}"/>
</antcall>
</target>
<target name="gather.individual.sources" depends="init">
<antcall target="copy.src.zip">
<param name="source.destination.folder" value="${destination.temp.folder}"/>
</antcall>
<antcall target="copy.src.includes">
<param name="source.destination.folder" value="${destination.temp.folder}"/>
</antcall>
</target>
<target name="copy.src.includes" depends="init">
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}"/>
<copy todir="${destination.temp.folder}/ch.sahits.codegen_${bundleVersion}" failonerror="false" overwrite="false">
<fileset dir="${build.result.folder}">
<include name="@dot${logExtension}"/>
</fileset>
</copy>
</target>
<target name="clean" depends="init" description="Clean the plug-in: ch.sahits.codegen of all the zips, jars and logs created.">
<delete dir="${build.result.folder}/@dot"/>
<delete file="${build.result.folder}/src.zip"/>
<delete file="${plugin.destination}/ch.sahits.codegen_${bundleVersion}.jar"/>
<delete file="${plugin.destination}/ch.sahits.codegen_${bundleVersion}.zip"/>
<delete dir="${temp.folder}"/>
<delete file="${compilation.problem.marker}" quiet="true"/>
</target>
<target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
<eclipse.convertPath fileSystemPath="/home/andi/codegen/ch.sahits.codegen" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: ch.sahits.codegen.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="build.sources"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<delete>
<fileset dir="${temp.folder}">
<include name="**/*.bin${logExtension}"/>
</fileset>
</delete>
<zip destfile="${plugin.destination}/ch.sahits.codegen_${bundleVersion}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
<target name="apitools.generation" if="generateAPIDescription">
<apitooling.apigeneration projectName="${projectName}" project="${projectLocation}" binary="${binary.folders}" target="${target.folder}" />
</target>
</project>