Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Binary weaving of a package structure

The -d is meant to parallel what happens for -d with javac.  However this gets complicated because we allow binary weaving where the inputs are .class files (and also we allow source files to be compiled when they are not in a directory structure mirroring their package definition... but let's not go there).

Having the current directory as the output location is the default behaviour (part of what '-d .' means), but building the package structure is not.  I have no good answer as to why.  I also see that something like ajc ..\ behaves differently to javac ..\ - in that the former case puts the output in your current dir and javac puts it alongside  However, we are more complex than javac because we allow .class files as input and produce new .class files.  In the case of 'ajc -inpath X' I wouldn't want us to take as input the .class files from X and overwrite them in X with the woven version (at least that's what I'd assume).  Personally I always use -d for specifying where files go (when using both javac and ajc) and never rely on where i am in the filesystem.

This was all setup in the dim and distant past before I was working on it, we can revisit it if you like but it wouldn't be top priority...


2008/8/6 David Mohr <dmohr@xxxxxxxxxx>
Ah, that's what I missed! Thanks a lot for the hint Andy, it's working fine now.

Can I ask why '-d .' is not the default behavior? Also the Development
Guide I think is not very clear about what -d does. I read over the
options before, but since it was already placing the class files in
the current directory, I did not try to specify that explicitly.


On Wed, Aug 6, 2008 at 1:01 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
> Add -d to specify a destination?
> -d .
> Andy.
> 2008/8/6 David Mohr <dmohr@xxxxxxxxxx>
>> Hi,
>> I might be overlooking something in the docs, but ajc behaves funny
>> when I try to binary weave a whole package structure. Let's say I have
>> a layout like:
>> ---snip---
>> aspects/
>>   InstrumentFoo.aj
>>   InstrumentFoo.class
>> prog1/
>>   com/
>>      foo/
>>         a/
>>            X.class
>>         b/
>>            Y.class
>> prog1.aj/
>> ---snap---
>> If I'm in prog1.aj/ and execute something like "ajc -aspectpath
>> ../aspects -classpath ../prog1 -inpath ../prog1", I end up with both
>> X.class and Y.class in prog1.aj/, without the whole package directory
>> structure that is present in prog1. Why are the directories not
>> created? And what is the right way to binary weave a whole java
>> program?
>> Thanks,
>> ~David
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
aspectj-users mailing list

Back to the top