blob: b1ce714eacf6b16265eb8477d5990204f7394190 [file] [log] [blame]
<?xml version="1.0" ?>
<!-- writen for Ant 1.5.1 -->
<project name="org.aspectj.ajde" default="plugin jars">
<description>Repackages a built AspectJ into AJDT</description>
<!-- VERSION-STRING -->
<!-- these property values will be overridden when called from the master build script -->
<property name="ajde.version" value="9.9.9" />
<property name="build.dir" value="build" />
<property name="ajde.build.dir" value="build/ajdetemp" />
<property file="aspectjlib.properties" />
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="dist" />
</target>
<target name="clean" depends="init">
<delete dir="${build.dir}" />
<delete dir="dist" />
</target>
<target name="packaged-plugin" depends="init" description="Create the plugin jar file from the assembled components in the build dir">
<copy todir="${build.dir}" includeemptydirs="false">
<fileset dir=".">
<exclude name="*src.zip" />
<exclude name="build.*" />
<exclude name=".*" />
<exclude name="*/*" />
<exclude name="META-INF/MANIFEST.MF" />
<exclude name="aspectjlib.properties" />
<depth max="0" />
</fileset>
</copy>
<copy file="META-INF/MANIFEST.MF" tofile="${build.dir}/META-INF/MANIFEST.MF">
<filterset begintoken="9" endtoken="9">
<filter token="2.2.2" value="${ajde.version}"/>
</filterset>
</copy>
<copy todir="${build.dir}/doc">
<fileset dir="doc" />
</copy>
<copy todir="${build.dir}/icons">
<fileset dir="icons" />
</copy>
<zip destfile="dist/org.aspectj.ajde_${ajde.version}.jar">
<fileset dir="build" />
</zip>
</target>
<target name="copy doc" description="This copies the aspectj docs into the org.eclipse.ajde
plugin. By default, it only copies over any changes from the current version">
<copy todir="doc" failonerror="false">
<fileset dir="${aspectj.doc.dir}">
<exclude name="examples" />
</fileset>
</copy>
</target>
<target name="ajdejar" description="Copy the AspectJ compiler components into the org.aspectj.ajde plugin">
<property name="src1" value="../org.aspectj.ajde/source"/>
<property name="bin1" value="../org.aspectj.ajde/classes"/>
<!-- Classes -->
<delete dir="${bin1}"/>
<unzip dest="${bin1}" src="${aspectj.dir}/aspectjtools/target/aspectjtools-${aspectj.version}.jar"/>
<delete includeemptydirs="true">
<fileset dir="${bin1}">
<exclude name="org/aspectj/**/*.*" />
</fileset>
</delete>
<delete includeemptydirs="true">
<fileset dir="${bin1}">
<include name="META-INF/**"/>
<include name="*.profile" />
<include name="*.html" />
<include name="*.properties" />
<include name=".api_description"/>
<include name=".options"/>
<include name="plugin.xml"/>
<include name="profile.list"/>
<include name="aspectj_1_5_0.dtd"/>
<include name="org.eclipse.jdt.core-empty"/>
<include name="about_files/**"/>
<include name="ant_tasks/**"/>
<include name="org/eclipse/**"/>
<include name="org/osgi/**"/>
</fileset>
</delete>
<!-- delete these as they are in weaver -->
<delete includeemptydirs="true">
<fileset dir="${bin1}">
<include name="org/aspectj/asm/**" />
<include name="org/aspectj/weaver/**" />
<include name="org/aspectj/apache/**" />
<include name="org/aspectj/bridge/**" />
<include name="org/aspectj/util/**" />
<include name="aj/org/objectweb/**" />
</fileset>
</delete>
<!-- delete these as they are in runtime -->
<delete includeemptydirs="true">
<fileset dir="${bin1}">
<include name="org/aspectj/internal/**" />
<include name="org/aspectj/runtime/**" />
<include name="org/aspectj/lang/**" />
</fileset>
</delete>
<!-- delete everything which is in ajde and ajbrowser -->
<delete includeemptydirs="true">
<fileset dir="${bin1}">
<include name="org/aspectj/ajde/*" />
<include name="org/aspectj/ajde/internal/**" />
<include name="org/aspectj/ajde/resources/**" />
<include name="org/aspectj/ajde/ui/**" />
<include name="org/aspectj/tools/ajbrowser/**" />
<include name="org/aspectj/tools/ajbrowser/core/**" />
<include name="org/aspectj/tools/ajbrowser/ui/**" />
<include name="org/aspectj/tools/ajbrowser/ui/swing/**" />
</fileset>
</delete>
<!-- Sources -->
<delete dir="${src1}" />
<!--
<unzip dest="${src1}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${src1}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
-->
<unzip dest="${src1}" src="${aspectj.dir}/aspectjtools/target/aspectjtools-${aspectj.version}-sources.jar"/>
<delete includeemptydirs="true">
<fileset dir="${src1}">
<exclude name="org/aspectj/**/*.*" />
</fileset>
</delete>
<!-- delete these as they are in weaver -->
<delete includeemptydirs="true">
<fileset dir="${src1}">
<include name="org/aspectj/asm/**" />
<include name="org/aspectj/weaver/**" />
<include name="org/aspectj/apache/**" />
<include name="org/aspectj/bridge/**" />
<include name="org/aspectj/util/**" />
<include name="org/aspectj/org/objectweb/**" />
</fileset>
</delete>
<!-- delete these as they are in runtime -->
<delete includeemptydirs="true">
<fileset dir="${src1}">
<include name="org/aspectj/internal/**" />
<include name="org/aspectj/runtime/**" />
<include name="org/aspectj/lang/**" />
</fileset>
</delete>
<!-- delete everything which is in ajde and ajbrowser -->
<delete includeemptydirs="true">
<fileset dir="${src1}">
<include name="org/aspectj/ajde/*" />
<include name="org/aspectj/ajde/internal/**" />
<include name="org/aspectj/ajde/resources/**" />
<include name="org/aspectj/ajde/ui/**" />
<include name="org/aspectj/tools/ajbrowser/**" />
<include name="org/aspectj/tools/ajbrowser/core/**" />
<include name="org/aspectj/tools/ajbrowser/ui/**" />
<include name="org/aspectj/tools/ajbrowser/ui/swing/**" />
</fileset>
</delete>
<!-- delete everything which shouldn't be anywhere at all -->
<delete includeemptydirs="true">
<fileset dir="${src1}">
<include name="org/aspectj/lib/**" />
</fileset>
</delete>
</target>
<target name="weaverjar" description="Copy the AspectJ weaver components into the org.aspectj.weaver plugin">
<property name="src2" value="../org.aspectj.weaver/source"/>
<property name="bin2" value="../org.aspectj.weaver/classes"/>
<!-- Classes -->
<delete dir="${bin2}"/>
<unzip dest="${bin2}" src="${aspectj.dir}/aspectjweaver/target/aspectjweaver-${aspectj.version}.jar"/>
<delete includeemptydirs="true">
<fileset dir="${bin2}">
<exclude name="META-INF/*.*" />
<exclude name="org/aspectj/apache/bcel/**/*.*" />
<exclude name="org/aspectj/asm/**/*.*" />
<exclude name="org/aspectj/bridge/**/*.*" />
<exclude name="org/aspectj/util/**/*.*" />
<exclude name="org/aspectj/weaver/**/*.*" />
<exclude name="aj/org/objectweb/**/*.*" />
</fileset>
</delete>
<!-- Sources -->
<delete dir="${src2}" />
<unzip dest="${src2}" src="${aspectj.dir}/aspectjweaver/target/aspectjweaver-${aspectj.version}-sources.jar"/>
<!--
<unzip dest="${src2}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${src2}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
-->
<delete includeemptydirs="true">
<fileset dir="${src2}">
<exclude name="org/aspectj/**/*.*" />
</fileset>
</delete>
<delete includeemptydirs="true">
<fileset dir="${src2}">
<exclude name="org/aspectj/apache/bcel/**/*.*" />
<exclude name="org/aspectj/asm/**/*.*" />
<exclude name="org/aspectj/bridge/**/*.*" />
<exclude name="org/aspectj/util/**/*.*" />
<exclude name="org/aspectj/weaver/**/*.*" />
</fileset>
</delete>
</target>
<target name="runtimejar" description="Copy the AspectJ runtime components into the org.aspectj.runtime plugin">
<property name="src" value="../org.aspectj.runtime/source"/>
<property name="bin" value="../org.aspectj.runtime/classes"/>
<!-- Classes -->
<delete dir="${bin}"/>
<unzip dest="${bin}" src="${aspectj.dir}/aspectjrt/target/aspectjrt-${aspectj.version}.jar"/>
<delete dir="${bin}/META-INF"/>
<!-- Sources -->
<delete dir="${src}" />
<unzip dest="${src}" src="${aspectj.dir}/aspectjrt/target/aspectjrt-${aspectj.version}-sources.jar"/>
<!--
<unzip dest="${src}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${src}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
-->
<delete includeemptydirs="true">
<fileset dir="${src}">
<exclude name="org/aspectj/internal/lang/annotation/**/*.*" />
<exclude name="org/aspectj/internal/lang/reflect/**/*.*" />
<exclude name="org/aspectj/runtime/**/*.*" />
<exclude name="org/aspectj/lang/**/*.*" />
</fileset>
</delete>
</target>
<!-- target name="plugin jars" depends="weaverjar" -->
<target name="plugin jars" depends="ajdejar,weaverjar,runtimejar"
description="When a new version of AspectJ is released, drop the
aspectjrt.jar and aspectjtools.jar from the AJ lib directory into
the org.aspectj.ajde directory, and then run 'ant ajde.jar' to create an ajde.jar
update from them. Also need to copy aspectjrt.jar to org.aspectj.runtime plugin.">
</target>
<target name="build.jars" depends="packaged-plugin">
</target>
<target name="gather.bin.parts">
<mkdir dir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}"/>
<copy todir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}" failonerror="true" overwrite="false">
<fileset dir="${build.dir}" includes="**" />
</copy>
</target>
<target name="gather.logs">
</target>
<target name="build.sources">
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}"/>
<copy file="ajdesrc.zip" todir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}" failonerror="false" overwrite="false"/>
</target>
<target name="gather.individual.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}"/>
<copy file="ajdesrc.zip" todir="${destination.temp.folder}/org.aspectj.ajde_${ajde.version}" failonerror="false" overwrite="false"/>
</target>
<target name="build.update.jar">
<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>
<zip destfile="${plugin.destination}/org.aspectj.ajde_${ajde.version}.jar" basedir="${temp.folder}/org.aspectj.ajde_${ajde.version}" filesonly="false" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
<target name="publish.bin.parts" depends="init" if="p2.publish.parts" unless="compilation.problem.marker.exists">
<mkdir dir="${build.result.folder}/org.aspectj.ajde_${ajde.version}"/>
<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>
<eclipse.gatherBundle
metadataRepository="${p2.build.repo}"
artifactRepository="${p2.build.repo}"
buildResultFolder="${build.result.folder}"
baseDirectory="${basedir}"
/>
</target>
</project>