Bug 46347

Summary: -inpath instead of -injars so directories can be passed in.
Product: [Tools] AspectJ Reporter: Andrew Clement <aclement>
Component: CompilerAssignee: Andrew Clement <aclement>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: wes
Version: 1.1.1   
Target Milestone: 1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for ajbrowser module.
none
Supercedes the previous patch - this contains all the patches in one attachment. none

Description Andrew Clement CLA 2003-11-10 10:39:47 EST
To utilise the binary weaving capability of aspectj, it is currently necessary 
to jar up the class files that you want to weave into and pass the jar in on 
the -injars option to the compiler.  This can be awkward and makes ANT scripts 
and IDE integration more difficult that it needs to be.

It would be nice to replace the -injars option with a -inpath option that 
could cope with either jar files or directories (having a format very 
like 'classpath').  I'll attach the implementation to this bug report in a 
second :)
Comment 1 Andrew Clement CLA 2003-11-10 10:53:17 EST
Created attachment 6711 [details]
Patch for ajbrowser module.
Comment 2 Andrew Clement CLA 2003-11-10 10:57:38 EST
Created attachment 6712 [details]
Supercedes the previous patch - this contains all the patches in one attachment.

There are several changes across aspectj, this zip contains the patches for the
various modules *plus* some testdata for the new ajde testcase.
Comment 3 Charlie Harvey CLA 2004-02-09 14:56:33 EST
Will -inpath also include .properties and .xml and .dtd files?
That is something a bit awkward as well, that my aspected jar
cannot have any non-java files in it.
Comment 4 Andrew Clement CLA 2004-02-26 04:32:20 EST
I want to clear this defect off my list, so lets pull together all the 
strands....

Comments from Wes on 15th Decemeber 2003:
=================
Outstanding -inpath tasks mostly done:
  - Documentation
     - devguide updated
     - added to changes.html
     - ant doc updated
  - Verified (but not tested) the ANT task enhancements
  - Upgraded the harness for inpath testing

For tests, the compiler's files attribute now interprets
   - source files as unflagged args
   - zip/jar files as injars, and
   - readable directories as inpath

We still should test the ant support, provide a flag
for all injars entries to be put on the inpath, and do
more harness tests than the one in ajcHarnessTests.xml.
Oh, and test inpath.

Are resources supposed to be copied from inpath directories?

Wes
=====================

Comment 5 Andrew Clement CLA 2004-02-26 05:27:49 EST
Just trying to page this back into my brain.  The code to look at when 
examining the resource copying policy applied to inpath starts in:
BcelWeaver.addJarFile()
Comment 6 Andrew Clement CLA 2004-02-26 06:35:22 EST
Bug fixed.

To confirm how it works.  With the changes I have just committed - resources 
are not being copied across.  They are not copied for 'javac' so they are not 
being copied for 'ajc'.  If you need to copy them across in something like a 
build system, you have the choice between:

- In ANT, follow the call to the AJC task with a call to the COPY task.

- Package up your directories into jars and pass them in jar form to ajc on 
inpath - that will copy them through to the output.