[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Problem with Introduction
|
1. You use aspectj 1.0.6 and I use aspectj 1.1 rc 1
2. You make introducion to the source file. I said that it works with
sources. It doesn't work with compiled classes.
But thanks,
Pawel
----- Original Message -----
From: "Jackson, Stephen" <Stephen.Jackson@xxxxxxxxxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Sent: Wednesday, April 02, 2003 4:33 PM
Subject: RE: [aspectj-users] Problem with Introduction
> I just used ajc command. I can give you pieces of my build.xml I created
> for the project I am working on...
>
> I am using aspectj ver 1.0.6.
>
> <!--------------------------------------------------------------->
> <property name="build.sysclasspath" value="ignore"/>
>
> <!-- Build Properties File-->
> <property file="build.properties"/>
> <property file="${user.home}/build.properties"/>
> <property name="build.properties" value="build.properties"/>
>
> <!--------------------------------------------------------------->
> <target name="init-tasks">
>
> <echo message="+-------------------------------------+"/>
> <echo message="| I N I T I A L I Z I N G T A S K S |"/>
> <echo message="+-------------------------------------+"/>
>
> <taskdef name="ajc"
> classname="org.aspectj.tools.ant.taskdefs.Ajc">
> <classpath refid="classpath"/>
> </taskdef>
>
> <taskdef name="ajdoc"
> classname="org.aspectj.tools.ant.taskdefs.Ajdoc">
> <classpath refid="classpath"/>
> </taskdef>
>
> </target>
> <!--------------------------------------------------------------->
>
> <!-- Build classpath -->
> <path id="classpath">
> <fileset dir="${lib.dir}">
> <include name="*.jar"/>
> </fileset>
> <pathelement path="${ant.classpath}"/>
> </path>
> <property name="original.classpath" refid="classpath"/>
>
> <path id="classpath-docs">
> <pathelement path="${original.classpath}"/>
> <pathelement location="${docs.tools}"/>
> </path>
> <!--------------------------------------------------------------->
> <!-- Cleaning -->
> <target name="clean">
> <echo message="+-----------------+"/>
> <echo message="| C L E A N I N G |"/>
> <echo message="+-----------------+"/>
>
> <delete dir="${aspect.src}"/>
> <delete dir="${build.dest}"/>
> <mkdir dir="../${final.name}"/>
> <delete file="${aspect.lst.file}"/>
> <mkdir dir="${build.dest}"/>
>
> </target>
> <!----------------------------------------------------------
> Script looks like the following
> find ../ -name "*.java" | egrep -v "./test|myjunk" >../build/aspect.lst
>
> ----->
> <!-- Aspect argfile -->
> <target name="arg-file">
> <echo message="+---------------------------------+"/>
> <echo message="| C R E A T I N G A R G F I L E |"/>
> <echo message="+---------------------------------+"/>
> <exec executable="${populate.lst.file}"/>
> </target>
> <!--------------------------------------------------------------->
> <!-- Project Compile -->
> <target name="ajc-compile"
> depends="build-classpaths,init-tasks,build-classpaths,clean,arg-file">
> <echo message="+-----------------------------------+"/>
> <echo message="| C O M P I L I N G P R O J E C T |"/>
> <echo message="| PREPROCESS: ${preprocess} |"/>
> <echo message="+-----------------------------------+"/>
>
> <ajc
> argfile="${aspect.lst.file}"
> workingdir="${aspect.src}"
> preprocess="${preprocess}"
> includes="*.java"
> destdir="${build.dest}">
> <classpath refid="classpath"/>
> </ajc>
>
> -----Original Message-----
> From: Pawel [mailto:_1234_@xxxxxxxxxxxx]
> Sent: Wednesday, April 02, 2003 12:59 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Problem with Introduction
>
>
> Could you attach the ant file you used to compile the example?
> Pawel
> ----- Original Message -----
> From: "Jackson, Stephen" <Stephen.Jackson@xxxxxxxxxxxxxxxx>
> To: <aspectj-users@xxxxxxxxxxx>
> Sent: Friday, March 28, 2003 4:20 PM
> Subject: RE: [aspectj-users] Problem with Introduction
>
>
> > I compiled the attached example and it works as expected.
> >
> > -----Original Message-----
> > From: Pawel [mailto:_1234_@xxxxxxxxxxxx]
> > Sent: Thursday, March 27, 2003 5:44 PM
> > To: aspectj-users@xxxxxxxxxxx
> > Subject: Re: [aspectj-users] Problem with Introduction
> >
> >
> > I can't see you:( It doesn't work.
> > The aspect is compiled but it doesn't affect the class C. I think that
all
> > paths are set correctly. All sources belong to a default package so
there
> is
> > no need to import anything.
> > Pawel
> >
> >
> > ----- Original Message -----
> > From: "Jackson, Stephen" <Stephen.Jackson@xxxxxxxxxxxxxxxx>
> > To: <aspectj-users@xxxxxxxxxxx>
> > Sent: Thursday, March 27, 2003 10:08 PM
> > Subject: RE: [aspectj-users] Problem with Introduction
> >
> >
> > > Try this. Make sure your aspects imports the necessary classes or it
> will
> > > not be able to find them.
> > >
> > > public aspect A{
> > > declare parents : C implements I
> > > public interface I{}
> > > public String I.testThis = "You can see Me";
> > > }
> > >
> > > -----Original Message-----
> > > From: Pawel [mailto:_1234_@xxxxxxxxxxxx]
> > > Sent: Thursday, March 27, 2003 3:34 PM
> > > To: aspectj-users@xxxxxxxxxxx
> > > Subject: [aspectj-users] Problem with Introduction
> > >
> > >
> > > I use aspectj 1.1 rc1
> > > I have:
> > >
> > > in a directory java
> > >
> > > public class C
> > > {
> > > }
> > >
> > > public interface I
> > > {
> > > }
> > >
> > > and in a directory aspects
> > >
> > > public aspect A
> > > {
> > > declare parents: C implements I;
> > > }
> > >
> > > if i compile sources with:
> > >
> > > <iajc outjar="a.jar" classpath="${aspectjrt.jar}" verbose="off">
> > > <sourceRoots>
> > > <pathelement path="java" />
> > > <pathelement path="aspects" />
> > > </sourceRoots>
> > > </iajc>
> > >
> > > everything is ok but if i use (intoduction to a compiled class in a
> > > jar-file):
> > >
> > > <javac srcdir="java" destdir="classes" debug="on" optimize="off"
> > > deprecation="off" />
> > > <jar jarfile="c.jar" basedir="classes" />
> > > <iajc outjar="a.jar" injars="c.jar" classpath="${aspectjrt.jar}"
> > > verbose="off">
> > > <sourceRoots>
> > > <pathelement path="aspects" />
> > > </sourceRoots>
> > > </iajc>
> > >
> > > the class C doesn't implement the interface I.
> > >
> > > Is that a compiler bug or it is not possible to make introductions to
> > > compiled classes?
> > > Perhaps the ant script is wrong?
> > >
> > > Pawel
> > >
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >
> > >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>