blob: 6fda2224f760b03000b6052a29ed06be39cf8948 [file] [log] [blame]
<project name="org.eclipse.ajdt.examples" default="packaged-plugin">
<description>
Create a packaged org.eclipse.ajdt.examples_version feature plugin distribution file
</description>
<!-- VERSION-STRING -->
<!-- these property values will be overridden when called from the master build script -->
<property name="ajdt.version" value="9.9.9" />
<property name="ajde.version" value="9.9.9" />
<property name="build.dir" value="build" />
<property name="eclipse.build.version" value="3.0.0" />
<!-- To run this script from inside an automated build environment such
as Cruise Control the following properties are expected to have
been set and passed in :-
* external.build (set to any value)
* eclipse.home (set to the directory where Eclipse has been
installed on the build machine)
* eclipse.build.version (override the value default value set above)
-->
<path id="project.examples.class.path">
<pathelement location="src/"/>
<pathelement location="../org.eclipse.ajdt.ui/build/ajdtui.jar"/>
<pathelement location="../org.aspectj.runtime/aspectjrt.jar"/>
<pathelement location="../org.aspectj.ajde/ajde.jar"/>
<!-- Below are dependencies that require a local install of Eclipse. -->
<pathelement location="${eclipse.home}/plugins/org.eclipse.jface_${eclipse.build.version}/jface.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.core.runtime_${eclipse.build.version}/runtime.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.core.resources_${eclipse.build.version}/resources.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui_${eclipse.build.version}/ui.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.jdt.core_${eclipse.build.version}/jdtcore.jar"/>
<!-- Build platform issue with the below one ? -->
<pathelement location="${eclipse.home}/plugins/org.eclipse.swt.win32_${eclipse.build.version}/ws/win32/swt.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.workbench_${eclipse.build.version}/workbench.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.workbench.texteditor_${eclipse.build.version}/texteditor.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.views_${eclipse.build.version}/views.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.jdt.ui_${eclipse.build.version}/jdt.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.ide_${eclipse.build.version}/ide.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.osgi_${eclipse.build.version}/osgi.jar"/>
<!-- Java runtime library : depends on the JVM used to run Ant -->
<pathelement location="${java.home}/lib/rt.jar"/>
</path>
<target name="createArchive">
<property name="exampleDir" location="${basedir}/examples"/>
<property name="archiveDir" location="${basedir}/archive"/>
<property name="classpathFile" location="${basedir}/aspectj.classpath"/>
<delete dir="archive"/>
<mkdir dir="${archiveDir}"/>
<antcall target="packageExample">
<param name="example" value="tjp"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="introduction"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="tracing"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="bean"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="observer"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="telecom"/>
</antcall>
<antcall target="packageExample">
<param name="example" value="spacewar"/>
</antcall>
</target>
<target name="packageExample">
<zip destfile="${archiveDir}/${example}.jar"
basedir="${exampleDir}/${example}"/>
</target>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="dist"/>
</target>
<target name="clean" depends="init" >
<delete dir="${build.dir}"/>
<delete dir="dist"/>
<!--delete dir="archive"/-->
</target>
<target name="externalbuild" if="external.build" >
<delete dir="bin"/>
<mkdir dir="bin"/>
<echo message="abc"/>
<echo message="${project.examples.class.path}"/>
<javac srcdir="src" destdir="bin">
<classpath refid="project.examples.class.path" />
</javac>
</target>
<target name="eclipsebuild" unless="external.build" >
<eclipse.incrementalBuild project="org.eclipse.ajdt.examples" />
</target>
<target name="buildproject" depends="externalbuild,eclipsebuild" />
<target name="ajdtexamplesjar" depends="init"
description="Create ajdtExamples.jar, the library containing the plug-in
class files and properties.">
<!-- The following ant call is intended to provide the flexibility
to build AJDT from within Eclipse or else from a command line
run of Ant (e.g. in a Cruise Control environment).
-->
<antcall target="buildproject" />
<copy file="src/org/eclipse/ajdt/examples/AspectJExampleMessages.properties"
tofile="bin/org/eclipse/ajdt/examples/AspectJExampleMessages.properties"
overwrite="true"/>
<zip destfile= "${build.dir}/ajdtExamples.jar" >
<fileset dir="bin"/>
</zip>
</target>
<target name="ajdtexamplessrcjar" depends="init"
description="The source jar file for ajdt examples, ajdtExamplessrc.jar">
<zip destfile= "${build.dir}/ajdtExamplessrc.jar" >
<fileset dir="src"/>
</zip>
</target>
<target name="packaged-plugin" depends="createArchive,ajdtexamplesjar,ajdtexamplessrcjar"
description="Create the plugin jar file from the assembled components in the build dir">
<copy todir="${build.dir}/icons">
<fileset dir="icons" />
</copy>
<copy todir="${build.dir}/archive">
<fileset dir="archive" />
</copy>
<copy todir="${build.dir}">
<fileset dir=".">
<include name="*.xml"/>
<exclude name="build.*"/>
<include name="*.properties"/>
<exclude name="plugin.*xml" />
</fileset>
</copy>
<copy file="plugin.xml" tofile="${build.dir}/plugin.xml">
<filterset begintoken="9" endtoken="9">
<filter token="2.2.2" value="${ajdt.version}"/>
</filterset>
</copy>
<zip destfile= "dist/org.eclipse.ajdt.examples_${ajdt.version}.jar" >
<fileset dir= "build" />
</zip>
</target>
</project>