Bug 101983 - Allow separate output folders for separate source folders
Summary: Allow separate output folders for separate source folders
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M3   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.5.2   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 46665
  Show dependency tree
 
Reported: 2005-06-28 04:30 EDT by Sian January CLA
Modified: 2006-06-21 03:05 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sian January CLA 2005-06-28 04:30:15 EDT
In Eclipse the JDT compiler enables different source folders in the same 
project to be built into separate output folders.  The AJDT project has had 
several bugs raised requesting this feature for AspectJ projects.  This 
requires some compiler changes to be able to implement.
Comment 1 Matt Chapman CLA 2005-06-29 10:02:12 EDT
Upping the severity as lots of people are hitting this. I'm going to put a
temporary dialog in AJDT to warn people when this situation is detected
Comment 2 Adrian Colyer CLA 2005-10-28 08:26:34 EDT
we're not going to make 1.5.0 with this, but will try to get something for AJDT right afterwards.
Comment 3 Ron Bodkin CLA 2006-02-06 16:35:07 EST
This would also be a useful feature for tests with load-time weaving. Then you could define one set of production aspects in src/META-INF/aop.xml and just add some testing aspects to testsrc/META-INF/aop.xml, allowing separate maintenance. Of course even better for that use case would be automatically running load-time weaving with the generated list of aspects (which doesn't work for me in AJDT...)
Comment 4 Morten Christensen CLA 2006-03-31 12:17:02 EST
I need this feature as well.
Comment 5 Morten Christensen CLA 2006-03-31 12:21:53 EST
Funny, for some reason I can't vote for this bug because the link is not there (is this a bug in the bug report tool? :-))
Comment 6 Matt Chapman CLA 2006-03-31 12:30:30 EST
Re comment #5:
No, it's a feature :) See bug 119593 - voting has to be enabled per project, and the default now seems to be off. I had to request voting to be enabled for AJDT.
Comment 7 Andrew Clement CLA 2006-04-04 14:15:05 EDT
take a look for 1.5.2
Comment 8 Adrian Colyer CLA 2006-05-16 14:45:13 EDT
Matt, I've implemented initial support for this feature. ProjectProperties now has an additional method, getOutputLocationManager(). If this returns a non-null value, the location manager will be asked for output locations for compilation results and resources. You'll need to implement an OutputLocationManager:

public interface OutputLocationManager {

	File getOutputLocationForClass(String compilationUnitName);

	File getOutputLocationForResource(String resourceName);
	
}

See the javadoc comments in the interface in CVS for details. We can iterate on this if it doesn't quite fit your needs...

Comment 9 Matt Chapman CLA 2006-05-16 17:01:37 EDT
Sounds good, I'll pull it into AJDT and see if I can connect it with JDT's separate output folder settings.
Comment 10 Matt Chapman CLA 2006-05-18 10:45:25 EDT
Adrian, this is looking promising. Some minor comments:
 - We have to check for output folders each time you call getOutputLocationManager() as we don't know when they might change, so it would be more efficient if you only called it once each build, not twice.
 - The String arg to getOutputLocationForClass() seems to be the absolute file, which is fine, but wasn't obvious from the javadoc (fully qualified compilation unit name could be taken as e.g. com.foo.ClassName). So as this and the resourceName are really files, wouldn't be better for the arg to be a File instead of a String?
 - In AJDT we don't need to distinguish classes from other resources - so either the interface could be reduced to a single method, or we can just delegate one to the other in AJDT.
Comment 11 Adrian Colyer CLA 2006-05-19 04:00:35 EDT
ok great. I'll look into those today, get some test cases in place for generated closure classes etc. and then hopefully get this support finished off from the AspectJ side.
Comment 12 Adrian Colyer CLA 2006-05-19 08:10:02 EDT
work now completed and committed to CVS:
* getOutputLocationManager only called once
* parameter type changed to File
* but I left in the separate resource method - it's easy to delegate as you say

See org.aspectj.systemtest.incremental.tools.OutputLocationManagerTests for an example of a project that writes the contents on one source folder to "target/main/classes" and the contents of a second source folder to "target/test/classes".
Comment 13 Adrian Colyer CLA 2006-06-21 03:05:36 EDT
fixed as of May-19, forgot to close out the bug report at the time.