I'm not the biggest fan of Ant, but I need to use if for this project. However, I'm getting the following error message in my build script:
_compile:
[mkdir] Created dir: C:\dev\Projects\hotfix\aspects\dist\compile
[echo] Java target: 1.6
[iajc] maxMem ignored unless forked: 256m
[iajc] error AspectJ 1.6.13 ran out of memory during compilation:
[iajc]
[iajc] Please increase the memory available to ajc by editing the ajc script
[iajc] found in your AspectJ installation directory. The -Xmx parameter value
[iajc] should be increased from 64M (default) to 128M or even 256M.
[iajc]
[iajc] See the AspectJ FAQ available from the documentation link
My ant script is:
<target name="_compile">
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
<pathelement location="${aspectj.lib.home}/aspectjtools.jar"/>
</classpath>
</taskdef>
<mkdir dir="${compile.dir}"/>
<echo message="Java target: ${jdk.target}"/>
<iajc source="1.6" destDir="${compile.dir}" maxmem="256m">
<sourceroots>
<pathelement location="${java.src.dir}" />
</sourceroots>
<classpath refid="project.classpath"/>
</iajc>
<mkdir dir="${compile.test.dir}"/>
<mkdir dir="${test.src.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${compile.test.dir}" source="${jdk.target}" target="${jdk.target}"
debug="${jdk.debug}" classpathref="compiled.classpath"/>
</target>
You'll notice I am not even specifying any inpath; I'm just trying to build a jar of aspects to use with the Load-Time-Weaver. And my entire source dir is a whopping 6 files.
This only seems to happen when building as part of a complete project build (ie: ant has already built other jars, and wars). If I just build this jar by itself, i don't run into errors.
Is the only choice running this in a fork? Can I not specify additional memory to use to the process otherwise?
Thanks,
Eric