Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Help: using Ant tasks under 3.0 M5
Help: using Ant tasks under 3.0 M5 [message #28101] Thu, 27 November 2003 10:49 Go to next message
Eclipse UserFriend
Originally posted by: marcus.edwards.digitalsteps.com

Hello,

As AspectJ/AJDT are not working under the latest M5 release of Eclipse, I'm
shifting to getting the compilation working using Ant tasks. (Aside: this is
probably a much better arrangement in any event as it means there is no
dependency on Eclipse and the build process can be automated.)

I am having no success getting the process working and the documentation
seems a little thin on the ground. I've copied the examples in the
documentation I've looked at all and still can't get it work. Any help or
pointers to other documentation would be greatly appreciated.

I've attached the ant build.xml file below and a copy of the console output.
I am running the ant build file from Eclipse as an external tool and passing
in the required parameters ('aspectj-home', 'src' and 'dest'). The project
is set up with the source under <project>/src and the output in
<project>/bin.

Thanks,
Marcus
----
--- 8< --- build.xml
<?xml version="1.0"?>
<project name="scratch" default="compile" basedir=".">
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
<classpath>
<pathelement location="${aspectj-home}/aspectjtools.jar"/>
</classpath>
</taskdef>

<target name="compile" depends="check-properties">
<mkdir dir="${dest}"/>
<iajc destdir="${dest}"
tagfile=".tagfile"
sourceroots="${src}"
incremental="true">
<classpath>
<pathelement location="${aspectj-home}/aspectjrt.jar"/>
</classpath>
</iajc>
</target>

<target name="check-properties">
<fail unless="aspectj-home" message="Property 'aspectj-home' must be
defined"/>
<fail unless="src" message="Property 'src' must be defined"/>
<fail unless="dest" message="Property 'dest' must be defined"/>
<echo>Using aspectj-home=${aspectj-home}</echo>
<echo>Using src=${src}</echo>
<echo>Using dest=${dest}</echo>
</target>
</project>

--- 8< --- console output

Apache Ant version 1.5.4 compiled on August 12 2003
Buildfile: d:\workspace\scratch\build.xml
parsing buildfile d:\workspace\scratch\build.xml with URI =
file:d:/workspace/scratch/build.xml
Project base dir set to: D:\workspace\scratch
[taskdef] Loading definitions from resource
org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties
Arguments: -verbose -Dorg.eclipse.ant.ui.ATTR_ANT_PROCESS_ID=1069929855864
Build sequence for target `compile' is [check-properties, compile]
Complete build sequence is [check-properties, compile]

check-properties:
[echo] Using
aspectj-home=d:/apps/eclipse-3.0M5/plugins/org.aspectj.ajde_ 1.1.4
[echo] Using src=src
[echo] Using dest=bin

compile:
[iajc] AspectJ Compiler 1.1.1
[iajc] Usage: <options> <source file | @argfile>..
[iajc] AspectJ-specific options:
[iajc] -injars <jarList> use classes in <jarList> zip files as
source
[iajc] (<jarList> uses classpath delimiter)
[iajc] -aspectpath <list> weave aspects from <list> zip files into
sources
[iajc] (<list> uses classpath delimiter)
[iajc] -outjar <file> put output classes in zip file <file>
[iajc] -argfile <file> specify line-delimited list of source
files
[iajc] -incremental continuously-running compiler,
needs -sourceroots
[iajc] (reads stdin: enter to recompile and 'q'
to quit)
[iajc] -sourceroots <dirs> compile all .aj and .java files in
<dirs>
[iajc] (<dirs> uses classpath delimiter)
[iajc] -emacssym generate .ajesym symbol files for emacs
support
[iajc] -Xlint same as '-Xlint:warning'
[iajc] -Xlint:<level> set default level for crosscutting
messages
[iajc] (<level> may be ignore, warning, or
error)
[iajc] -Xlintfile <file> specify properties file to set
per-message levels
[iajc] (cf
org/aspectj/weaver/XlintDefault.properties)
[iajc] Standard Eclipse compiler options:
[iajc] -help emit this help message and quit
[iajc] -version emit compiler version number and quit
[iajc] -classpath <list> directories and zip files for the
classpath
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -bootclasspath <list> override bootclasspath for finding
compile types
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -extdirs <list> override extension dirs for finding
compile types
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -d <dir> destination directory for output classes
[iajc] -target <ver> classfile setting (1.1 or 1.2, default
is 1.1)
[iajc] -1.3 set compliance level to 1.3 (default)
[iajc] -1.4 set compliance level to 1.4
[iajc] -source <ver> assertions toggle (1.3 or 1.4, default
is 1.3
[iajc] in -1.3 mode and 1.4 in -1.4 mode)
[iajc] -nowarn emit no warnings (same as '-warn:none')
[iajc] -warn:<list> emit warnings specified by
comma-delimited list
[iajc] (eg '-warn:unusedLocals,deprecation')
[iajc] constructorName method with constructor name
[iajc] packageDefaultMethod attempt to override package-default
method
[iajc] deprecation usage of deprecated type or member
[iajc] maskedCatchBlocks hidden catch block
[iajc] unusedLocals unused local variable (never read)
[iajc] unusedArguments unused method argument (never read)
[iajc] unusedImports unused imports
[iajc] syntheticAccess performing synthetic access for
inner classes
[iajc] assertIdentifier 'assert' used as identifier
[iajc] -deprecation same as '-warn:deprecation'
[iajc] -noImportError emit no errors for unresolved imports
[iajc] -proceedOnError keep compiling after errors, dumping
class files
[iajc] with problem methods
[iajc] -g[:<level>] debug attributes level
[iajc] -g all debug info (same as
'-g:lines,vars,source')
[iajc] -g:none no debug info
[iajc] -g:<items> debug info for any/all of [lines, vars,
source]
[iajc] -preserveAllLocals code gen preserve all local variables
(for debug)
[iajc] -referenceInfo compute reference info
[iajc] -encoding <name> specify default source encoding format
[iajc] (Specify encoding for any source
file/folder by
[iajc] suffixing each input name with
'[encoding]')
[iajc] -verbose emit accessed/processed compilation
units
[iajc] -log <filename> specify a log file for compile messages
[iajc] -progress show progress (requires -log mode)
[iajc] -time display speed information
[iajc] -noExit do not call System.exit(n) at end of
compilation
[iajc] (n=0 if no error)
[iajc] -repeat <n> repeat compilation process <n> times
(perf analysis)
[iajc] AspectJ Compiler 1.1.1
[iajc] Usage: <options> <source file | @argfile>..
[iajc] AspectJ-specific options:
[iajc] -injars <jarList> use classes in <jarList> zip files as
source
[iajc] (<jarList> uses classpath delimiter)
[iajc] -aspectpath <list> weave aspects from <list> zip files into
sources
[iajc] (<list> uses classpath delimiter)
[iajc] -outjar <file> put output classes in zip file <file>
[iajc] -argfile <file> specify line-delimited list of source
files
[iajc] -incremental continuously-running compiler,
needs -sourceroots
[iajc] (reads stdin: enter to recompile and 'q'
to quit)
[iajc] -sourceroots <dirs> compile all .aj and .java files in
<dirs>
[iajc] (<dirs> uses classpath delimiter)
[iajc] -emacssym generate .ajesym symbol files for emacs
support
[iajc] -Xlint same as '-Xlint:warning'
[iajc] -Xlint:<level> set default level for crosscutting
messages
[iajc] (<level> may be ignore, warning, or
error)
[iajc] -Xlintfile <file> specify properties file to set
per-message levels
[iajc] (cf
org/aspectj/weaver/XlintDefault.properties)
[iajc] Standard Eclipse compiler options:
[iajc] -help emit this help message and quit
[iajc] -version emit compiler version number and quit
[iajc] -classpath <list> directories and zip files for the
classpath
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -bootclasspath <list> override bootclasspath for finding
compile types
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -extdirs <list> override extension dirs for finding
compile types
[iajc] (<list> uses platform-specific path
delimiter)
[iajc] -d <dir> destination directory for output classes
[iajc] -target <ver> classfile setting (1.1 or 1.2, default
is 1.1)
[iajc] -1.3 set compliance level to 1.3 (default)
[iajc] -1.4 set compliance level to 1.4
[iajc] -source <ver> assertions toggle (1.3 or 1.4, default
is 1.3
[iajc] in -1.3 mode and 1.4 in -1.4 mode)
[iajc] -nowarn emit no warnings (same as '-warn:none')
[iajc] -warn:<list> emit warnings specified by
comma-delimited list
[iajc] (eg '-warn:unusedLocals,deprecation')
[iajc] constructorName method with constructor name
[iajc] packageDefaultMethod attempt to override package-default
method
[iajc] deprecation usage of deprecated type or member
[iajc] maskedCatchBlocks hidden catch block
[iajc] unusedLocals unused local variable (never read)
[iajc] unusedArguments unused method argument (never read)
[iajc] unusedImports unused imports
[iajc] syntheticAccess performing synthetic access for
inner classes
[iajc] assertIdentifier 'assert' used as identifier
[iajc] -deprecation same as '-warn:deprecation'
[iajc] -noImportError emit no errors for unresolved imports
[iajc] -proceedOnError keep compiling after errors, dumping
class files
[iajc] with problem methods
[iajc] -g[:<level>] debug attributes level
[iajc] -g all debug info (same as
'-g:lines,vars,source')
[iajc] -g:none no debug info
[iajc] -g:<items> debug info for any/all of [lines, vars,
source]
[iajc] -preserveAllLocals code gen preserve all local variables
(for debug)
[iajc] -referenceInfo compute reference info
[iajc] -encoding <name> specify default source encoding format
[iajc] (Specify encoding for any source
file/folder by
[iajc] suffixing each input name with
'[encoding]')
[iajc] -verbose emit accessed/processed compilation
units
[iajc] -log <filename> specify a log file for compile messages
[iajc] -progress show progress (requires -log mode)
[iajc] -time display speed information
[iajc] -noExit do not call System.exit(n) at end of
compilation
[iajc] (n=0 if no error)
[iajc] -repeat <n> repeat compilation process <n> times
(perf analysis)
BUILD FAILED: file:d:/workspace/scratch/build.xml:19: 1 errors
Total time: 521 milliseconds
Re: using Ant tasks under 3.0 M5 [message #28140 is a reply to message #28101] Thu, 27 November 2003 14:52 Go to previous message
Eclipse UserFriend
Originally posted by: marcus.edwards.digitalsteps.com

"Marcus Edwards" <marcus.edwards@digitalsteps.com> wrote in message
news:bq4kuf$r9o$1@eclipse.org...
> As AspectJ/AJDT are not working under the latest M5 release of Eclipse,
I'm
> shifting to getting the compilation working using Ant tasks.

I've got it working by including fork="true" in the iajc task call. For what
it's worth, the updated build script now
looks like this:

--- 8< --- build.xml

<?xml version="1.0"?>
<project name="scratch" default="compile" basedir=".">
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
<classpath>
<pathelement location="${aspectj-home}/aspectjtools.jar"/>
</classpath>
</taskdef>

<path id="classpath">
<pathelement location="${aspectj-home}/aspectjrt.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>

<target name="compile" depends="check-properties">
<mkdir dir="${dest}"/>
<iajc
destdir="${dest}"
fork="true"
sourceroots="${src}">
<!-- classpath entries -->
<classpath refid="classpath"/>
</iajc>
</target>

<target name="check-properties">
<fail unless="aspectj-home" message="Property 'aspectj-home' must be
defined"/>
<echo>Using aspectj-home=${aspectj-home}</echo>
<echo>Using src=${src}</echo>
<echo>Using dest=${dest}</echo>
</target>
</project>
Re: using Ant tasks under 3.0 M5 [message #573154 is a reply to message #28101] Thu, 27 November 2003 14:52 Go to previous message
Eclipse UserFriend
Originally posted by: marcus.edwards.digitalsteps.com

"Marcus Edwards" <marcus.edwards@digitalsteps.com> wrote in message
news:bq4kuf$r9o$1@eclipse.org...
> As AspectJ/AJDT are not working under the latest M5 release of Eclipse,
I'm
> shifting to getting the compilation working using Ant tasks.

I've got it working by including fork="true" in the iajc task call. For what
it's worth, the updated build script now
looks like this:

--- 8< --- build.xml

<?xml version="1.0"?>
<project name="scratch" default="compile" basedir=".">
<taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties ">
<classpath>
<pathelement location="${aspectj-home}/aspectjtools.jar"/>
</classpath>
</taskdef>

<path id="classpath">
<pathelement location="${aspectj-home}/aspectjrt.jar"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>

<target name="compile" depends="check-properties">
<mkdir dir="${dest}"/>
<iajc
destdir="${dest}"
fork="true"
sourceroots="${src}">
<!-- classpath entries -->
<classpath refid="classpath"/>
</iajc>
</target>

<target name="check-properties">
<fail unless="aspectj-home" message="Property 'aspectj-home' must be
defined"/>
<echo>Using aspectj-home=${aspectj-home}</echo>
<echo>Using src=${src}</echo>
<echo>Using dest=${dest}</echo>
</target>
</project>
Previous Topic:Help: using Ant tasks under 3.0 M5
Next Topic:Java version of compiled code?
Goto Forum:
  


Current Time: Tue Mar 19 09:12:04 GMT 2024

Powered by FUDForum. Page generated in 0.02105 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top