Browse Source

works ... possibly could be tidier. Creates aj-build/ajdtoutput containing jars for sticking into AJDT.

tags/V1_5_1_final
aclement 18 years ago
parent
commit
64b57bdf03
1 changed files with 124 additions and 104 deletions
  1. 124
    104
      build/package.xml

+ 124
- 104
build/package.xml View File

<?xml version="1.0" ?> <?xml version="1.0" ?>
<!-- writen for Ant 1.5.1 --> <!-- writen for Ant 1.5.1 -->
<project name="org.aspectj.ajde" default="packaged-plugin">
<project name="Packaging AJ for AJDT" default="ajdtjars">


<description>
Creates a packaged plug-in jar for AJDE
</description>
<description>Takes an AJ build and spits out the jars for 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>
<property name="pkg.working.dir" value="../aj-build/ajdttemp" />
<property name="aspectj.lib.dir" value="../aj-build/dist/tools/lib"/>
<property name="ajdt.output.dir" value="../aj-build/ajdtoutput"/>
<target name="ajdtjars" depends="ajdejar,weaverjar,runtimejar"
description="Run in the build folder, it will take the aj-build/ output and create AJDT jars">
</target>

<target name="ajdejar" description="Construct ajde.jar and ajdesrc.zip for the ajde plugin using an AJ build"> <target name="ajdejar" description="Construct ajde.jar and ajdesrc.zip for the ajde plugin using an AJ build">
<!-- copy and unpack an aspectjtools.jar into a local build directory -->
<delete dir="${ajde.build.dir}"/>
<!-- copy and unpack an aspectjtools.jar -->
<delete dir="${pkg.working.dir}"/>
<copy file="${aspectj.lib.dir}/aspectjtools.jar" tofile="aspectjtools.jar" overwrite="true" /> <copy file="${aspectj.lib.dir}/aspectjtools.jar" tofile="aspectjtools.jar" overwrite="true" />
<mkdir dir="${ajde.build.dir}" />
<unzip dest="${ajde.build.dir}" src="aspectjtools.jar" />
<mkdir dir="${pkg.working.dir}" />
<unzip dest="${pkg.working.dir}" src="aspectjtools.jar" />
<delete file="aspectjtools.jar"/>
<!-- delete everything that isn't in the org.aspectj package --> <!-- delete everything that isn't in the org.aspectj package -->
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="org/aspectj/**/*.*" /> <exclude name="org/aspectj/**/*.*" />
</fileset> </fileset>
</delete> </delete>
<!-- delete everything which is going to be in aspectjweaver.jar --> <!-- delete everything which is going to be in aspectjweaver.jar -->
<echo message="Removing files not required in ajde.jar since they're contained in aspectjweaver.jar"/> <echo message="Removing files not required in ajde.jar since they're contained in aspectjweaver.jar"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<include name="org/aspectj/asm/**/*.*" /> <include name="org/aspectj/asm/**/*.*" />
<include name="org/aspectj/weaver/**/*.*" /> <include name="org/aspectj/weaver/**/*.*" />
<include name="org/aspectj/apache/bcel/**/*.*" /> <include name="org/aspectj/apache/bcel/**/*.*" />
<!-- delete everything which is going to be in aspectjrt.jar --> <!-- delete everything which is going to be in aspectjrt.jar -->
<echo message="Removing files not required in ajde.jar since they're contained in aspectjrt.jar"/> <echo message="Removing files not required in ajde.jar since they're contained in aspectjrt.jar"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<!-- bug 118235: currently the commented out classes appear in both ajde.jar and aspectjrt.jar <!-- bug 118235: currently the commented out classes appear in both ajde.jar and aspectjrt.jar
uncomment this if decide it should only live in aspectjrt.jar uncomment this if decide it should only live in aspectjrt.jar
<include name="org/aspectj/internal/lang/annotation/**/*.*" /> <include name="org/aspectj/internal/lang/annotation/**/*.*" />
<!-- construct the ajde.jar --> <!-- construct the ajde.jar -->
<zip destfile="ajde.jar"> <zip destfile="ajde.jar">
<fileset dir="${ajde.build.dir}" />
<fileset dir="${pkg.working.dir}" />
</zip> </zip>
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />


<!-- build a src zip --> <!-- build a src zip -->
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<!-- delete everything that isn't in the org.aspectj package --> <!-- delete everything that isn't in the org.aspectj package -->
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="org/aspectj/**/*.*"/> <exclude name="org/aspectj/**/*.*"/>
</fileset> </fileset>
</delete> </delete>
<!-- delete everything which is going to be in aspectjweaversrc.zip --> <!-- delete everything which is going to be in aspectjweaversrc.zip -->
<echo message="Removing files not required in ajdesrc.zip since they're contained in aspectjweaversrc.zip"/> <echo message="Removing files not required in ajdesrc.zip since they're contained in aspectjweaversrc.zip"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<include name="org/aspectj/asm/**/*.*" /> <include name="org/aspectj/asm/**/*.*" />
<include name="org/aspectj/weaver/**/*.*" /> <include name="org/aspectj/weaver/**/*.*" />
<include name="org/aspectj/apache/bcel/**/*.*" /> <include name="org/aspectj/apache/bcel/**/*.*" />
<!-- delete everything which is going to be in aspectjrtsrc.zip --> <!-- delete everything which is going to be in aspectjrtsrc.zip -->
<echo message="Removing files not required in ajdesrc.zip since they're contained in aspectjrtsrc.zip"/> <echo message="Removing files not required in ajdesrc.zip since they're contained in aspectjrtsrc.zip"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<!-- bug 118235: currently the commented out classes appear in both ajde.jar and aspectjrt.jar <!-- bug 118235: currently the commented out classes appear in both ajde.jar and aspectjrt.jar
uncomment this if decide it should only live in aspectjrt.jar uncomment this if decide it should only live in aspectjrt.jar
<include name="org/aspectj/internal/lang/annotation/**/*.*" /> <include name="org/aspectj/internal/lang/annotation/**/*.*" />
</delete> </delete>
<zip destfile="ajdesrc.zip"> <zip destfile="ajdesrc.zip">
<fileset dir="${ajde.build.dir}"/>
<fileset dir="${pkg.working.dir}"/>
</zip> </zip>
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />
<copy file="ajde.jar" todir="${ajdt.output.dir}"/>
<copy file="ajdesrc.zip" todir="${ajdt.output.dir}"/>
<delete file="ajde.jar"/>
<delete file="ajdesrc.zip"/>
</target> </target>
<target name="weaverjar" description="Construct aspectjweaver.jar and aspectjweaversrc.zip for the aspectjweaver plugin using an AJ build"> <target name="weaverjar" description="Construct aspectjweaver.jar and aspectjweaversrc.zip for the aspectjweaver plugin using an AJ build">
<!-- copy and unpack an aspectjweaver.jar into a local build directory --> <!-- copy and unpack an aspectjweaver.jar into a local build directory -->
<delete dir="${ajde.build.dir}"/>
<delete dir="${pkg.working.dir}"/>
<copy file="${aspectj.lib.dir}/aspectjweaver.jar" tofile="aspectjweaver.jar" overwrite="true" /> <copy file="${aspectj.lib.dir}/aspectjweaver.jar" tofile="aspectjweaver.jar" overwrite="true" />
<mkdir dir="${ajde.build.dir}" />
<unzip dest="${ajde.build.dir}" src="aspectjweaver.jar" />
<mkdir dir="${pkg.working.dir}" />
<unzip dest="${pkg.working.dir}" src="aspectjweaver.jar" />
<delete file="aspectjweaver.jar"/>
<!-- delete everything which shouldn't be included in the aspectjweaver.jar --> <!-- delete everything which shouldn't be included in the aspectjweaver.jar -->
<echo message="Removing files not required in aspectjweaver.jar"/> <echo message="Removing files not required in aspectjweaver.jar"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="META-INF/*.*" /> <exclude name="META-INF/*.*" />
<exclude name="org/aspectj/apache/bcel/**/*.*" /> <exclude name="org/aspectj/apache/bcel/**/*.*" />
<exclude name="org/aspectj/asm/**/*.*" /> <exclude name="org/aspectj/asm/**/*.*" />
<exclude name="org/aspectj/bridge/**/*.*" /> <exclude name="org/aspectj/bridge/**/*.*" />
<exclude name="org/aspectj/util/**/*.*" /> <exclude name="org/aspectj/util/**/*.*" />
<exclude name="org/aspectj/weaver/**/*.*" /> <exclude name="org/aspectj/weaver/**/*.*" />
<exclude name="org/aspectj/org/objectweb/asm/**/*.*"/>
</fileset> </fileset>
</delete> </delete>
<!-- construct the aspectjweaver.jar directly in the org.aspectj.weaver plugin --> <!-- construct the aspectjweaver.jar directly in the org.aspectj.weaver plugin -->
<zip destfile="../org.aspectj.weaver/aspectjweaver.jar">
<fileset dir="${ajde.build.dir}" />
<zip destfile="aspectjweaver.jar">
<fileset dir="${pkg.working.dir}" />
</zip> </zip>
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />


<!-- build a src zip --> <!-- build a src zip -->
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<!-- delete everything that isn't in the org.aspectj package --> <!-- delete everything that isn't in the org.aspectj package -->
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="org/aspectj/**/*.*"/> <exclude name="org/aspectj/**/*.*"/>
</fileset> </fileset>
</delete> </delete>
<!-- delete everything which shouldn't be included in the aspectjweaversrc.zip --> <!-- delete everything which shouldn't be included in the aspectjweaversrc.zip -->
<echo message="Removing files not required in aspectjweaversrc.zip"/> <echo message="Removing files not required in aspectjweaversrc.zip"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="org/aspectj/apache/bcel/**/*.*" /> <exclude name="org/aspectj/apache/bcel/**/*.*" />
<exclude name="org/aspectj/asm/**/*.*" /> <exclude name="org/aspectj/asm/**/*.*" />
<exclude name="org/aspectj/bridge/**/*.*" /> <exclude name="org/aspectj/bridge/**/*.*" />
</fileset> </fileset>
</delete> </delete>
<zip destfile="../org.aspectj.weaver/aspectjweaversrc.zip">
<fileset dir="${ajde.build.dir}"/>
<zip destfile="aspectjweaversrc.zip">
<fileset dir="${pkg.working.dir}"/>
</zip> </zip>
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />

<copy file="aspectjweaver.jar" todir="${ajdt.output.dir}"/>
<copy file="aspectjweaversrc.zip" todir="${ajdt.output.dir}"/>
<delete file="aspectjweaver.jar"/>
<delete file="aspectjweaversrc.zip"/>
</target> </target>


<target name="runtimejar" description="Copy the aspectjrt.jar from an <target name="runtimejar" description="Copy the aspectjrt.jar from an
AJ build into the runtime plugin containing AJ build into the runtime plugin containing
the src"> the src">
<copy file="${aspectj.lib.dir}/aspectjrt.jar" <copy file="${aspectj.lib.dir}/aspectjrt.jar"
tofile="../org.aspectj.runtime/aspectjrt.jar"
tofile="aspectjrt.jar"
overwrite="true" /> overwrite="true" />
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />
<!-- build a src zip --> <!-- build a src zip -->
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${ajde.build.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${pkg.working.dir}" src="${aspectj.lib.dir}/../../ide/eclipse/org.aspectj.ajde.source/src/aspectjsrc.zip"/>
<!-- delete everything which shouldn't be included in the aspectjrtsrc.zip --> <!-- delete everything which shouldn't be included in the aspectjrtsrc.zip -->
<echo message="Removing files not required in aspectjrtsrc.zip"/> <echo message="Removing files not required in aspectjrtsrc.zip"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${ajde.build.dir}">
<fileset dir="${pkg.working.dir}">
<exclude name="org/aspectj/internal/lang/annotation/**/*.*" /> <exclude name="org/aspectj/internal/lang/annotation/**/*.*" />
<exclude name="org/aspectj/internal/lang/reflect/**/*.*" /> <exclude name="org/aspectj/internal/lang/reflect/**/*.*" />
<exclude name="org/aspectj/runtime/**/*.*" /> <exclude name="org/aspectj/runtime/**/*.*" />
</fileset> </fileset>
</delete> </delete>
<zip destfile="../org.aspectj.runtime/aspectjrtsrc.zip">
<fileset dir="${ajde.build.dir}"/>
<zip destfile="aspectjrtsrc.zip">
<fileset dir="${pkg.working.dir}"/>
</zip> </zip>
<delete dir="${ajde.build.dir}" />
<delete dir="${pkg.working.dir}" />

<copy file="aspectjrt.jar" todir="${ajdt.output.dir}"/>
<copy file="aspectjrtsrc.zip" todir="${ajdt.output.dir}"/>
<delete file="aspectjrt.jar"/>
<delete file="aspectjrtsrc.zip"/>
</target> </target>


<!-- target name="plugin jars" depends="weaverjar" -->
<target name="plugin jars" depends="copy doc,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.">

<!-- 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 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>


<!--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>
</project> </project>

Loading…
Cancel
Save