Bug 146554 - [batch][compiler][options] Allow the batch compiler to output compiled files into multiple output folders
Summary: [batch][compiler][options] Allow the batch compiler to output compiled files ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-12 08:45 EDT by Maxime Daniel CLA
Modified: 2006-09-19 01:55 EDT (History)
1 user (show)

See Also:


Attachments
Patch + test cases (33.54 KB, patch)
2006-06-28 05:15 EDT, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2006-06-12 08:45:29 EDT
This bug is opened to track one specific suggestion made in bug 106953 (which is kept open on its side to track other aspects of the original request).

The topic here is to provide a way to optionally associate a specific output folders to each source folder when calling the batch compiler. One example scenario would be:
X.java in P1/src
Y.java in P2/src depends on X.java
compile Y.java, telling the compiler that Y.class should go to P2/bin while X.class should go to P1/bin.
As of 3.2, the user can only specify one output folder, which results into X.class and Y.class ending up into the same directory. In case no output folder is provided at all, then X.class would get into P1/src and Y.class would get into P2/src, which is not the desired result either.
Comment 1 Maxime Daniel CLA 2006-06-27 09:12:39 EDT
Suggested design would be that -sourcepath arguments could receive an optional output directory specification that would override the general output directory specification (if any).
For the sake of consistency, that specification would be a -d option, specified close to the affected entry, within square brackets.
One way to get the desired result for the above example would be the following:

ecj -sourcepath P1/src[-d P1/bin] -d P2/bin P2/src/Y.java

I would further assume that [-d none] is not supported.

To accomodate for access rules specification, this new option would be accepted either alone as shown above, or following a rules specification as follows:

ecj -sourcepath P1/src[~**/internal/*][-d P1/bin] -d P2/bin P2/src/Y.java
Comment 2 Maxime Daniel CLA 2006-06-28 05:15:29 EDT
Created attachment 45452 [details]
Patch + test cases
Comment 3 Maxime Daniel CLA 2006-07-04 03:42:53 EDT
Discussed with Philippe who asked that:
- [-d none] be supported as well (the desired effect being that the binaries
  compiled from the affected source entries would not get written to disk at 
  all);
- all parameters and options carrying source entries that are currently used to
  generate binaries and to write them to the disk be given the opportunity
  to carry local [-d ...] specifications as well; this includes jar and zip   
  files within -sourcepath options, files and directories passed as parameters,
  and all items of -classpath and -bootclasspath options.
Comment 4 Maxime Daniel CLA 2006-09-01 03:54:37 EDT
Released for 3.3 M2.

Verifier please consider using the new -d option with ecj. Usage examples are available in BatchCompilerTest (range 65 to 106).

Will attach patch of changes relative to HEAD of 20060901. The bulk of the changes have been to slightly extend the command line analysis and to drive the expected destination path through to their target (batch) CompilationUnit-s, through other classes (especially ClasspathLocation tree) when needed.
Comment 5 Frederic Fusier CLA 2006-09-19 01:55:37 EDT
Verified for 3.3 M2 with ecj.jar built from I20060918-0010.