Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] problem eith specifying jars in classpath than specifying classes directory path in ajc command

Thanks for your help Andy. It worked fine.


Andy Clement wrote:
> 
> I'm not sure what you are doing differently to me, but this works fine:
> 
> src1\A.java
> class A {}
> 
> src2\X.aj
> aspect X {
>   before():staticinitialization(A) {}
> }
> 
> javac src1\A.java -d .
> jar -cvMf A.jar A.class
> erase A.class
> ajc -classpath A.jar;c:\aspectj1.5.3\lib\aspectjrt.jar -sourceroots src2
> -d .
> 
> And then my current directory looks like this:
> 
> A.jar
> src1
> src2
> X.class
> 
> No woven A.class anywhere.
> 
> On 13/08/07, sandesh g <sandeshgujare@xxxxxxxxx> wrote:
>>  Hi All, I have kept java classes in one directory & aspects in another
>> directory under src. I compile java classes first then compile .aj files
>> using ajc. If I provide compiled java classes in classpath of ajc then it
>> does not weave(compile time weaving) in compiled java classes(that is
>> what I
>> desire since I m doing load time weaving) it creates only .class files
>> for
>> aspects. But when I include .jar file for compiled java classes in
>> classpath
>> of ajc, it weaves the java class files as well(compile time weaving).
>> consider the following: my src in
>> \aspectj\src\aspects\com\perf\PrintPerf.aj &
>> \aspectj\src\java\com\perf\Worker.java classes in
>> \aspectj\build\classes\com\perf\PrintPerf.class,
>> Worker.class First I do javac: javac -d ..\build\classes
>> ..\src\java\com\perf\*.java to compile java classes then ajc -d
>> ..\build\classes -classpath
>> %ASPECTJ_HOME%\lib\aspectjrt.jar;..\build\classes
>> -sourceroots ..\src\aspects -outxmlfile META-INF\aop.xml It works well.
>> It
>> does not weave the Worker.class at compile time. But if I put
>> Worker.class
>> in some jar file and put it in classpath of ajc instead of
>> ..\build\classes,
>> it weaves the Worker.java at compile time. How to avoid this problem?? Is
>> there any plan to support jars in classpath of ajc or is there any other
>> configuration? Pls help. Thanks, sandesh
>> ________________________________
>>  View this message in context: problem eith specifying jars in classpath
>> than specifying classes directory path in ajc command
>>  Sent from the AspectJ - dev mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> aspectj-dev mailing list
>> aspectj-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>>
>>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-eith-specifying-jars-in-classpath-than-specifying-classes-directory-path-in-ajc-command-tf4260512.html#a12139536
Sent from the AspectJ - dev mailing list archive at Nabble.com.



Back to the top