Bug 48075 - [DCR] Make API for compiling in memory public
Summary: [DCR] Make API for compiling in memory public
Status: RESOLVED DUPLICATE of bug 81471
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-04 11:02 EST by Daniel Hirscher CLA
Modified: 2005-09-20 06:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Hirscher CLA 2003-12-04 11:02:58 EST
Compiling hundrets of resources in memory is fast.
Writing them first to a filesystem is slow.
Unfortuneately to use the compiler for in-memory compiling requires the use of
internal packages.
Comment 1 Philipe Mulet CLA 2003-12-08 07:03:30 EST
Compiling in-memory is using lots of memory... and not fairly robust. Though we 
could offer to provide support to compile using working copies... would this do 
the trick for you ? Or what exactly would you need to do this ?

The compiler internals are not public yet, and we will likely wait until JSR-
199 is resolved to provide some official compiler APIs, which hopefully should 
offer what you are looking for.
Comment 2 Daniel Hirscher CLA 2003-12-08 08:32:19 EST
We have to compile hundrets, sometimes about 1000 classes. We generate source
code in memory. To be fast, we like to compile in memory and write only one jar
to the file system, containing everything.
We implement org.eclipse.jdt.internal.compiler.env.ICompilationUnit in the
generated files. Then we call compiler.compile(ICompilationUnit[]) like in the
batch compiler Main class.

We checked IWorkingCopy, but could not get the link to the compiler. Maybe we
missed something. So, if there is another way to compile in memory, please point
us to it.
Comment 3 Philipe Mulet CLA 2003-12-08 09:07:33 EST
There is nothing available at the moment, but the closest notion of in-memory 
compilation unit is a working copy. Though as you noticed, these cannot be fed 
to the compiler directly.

Looks like you are requesting a compiler only story, nothing to do with the 
Java builder.
Comment 4 Philipe Mulet CLA 2003-12-08 09:12:01 EST
Will wait until JSR-199 is resolved. For now the internal story is your best 
take.
Comment 5 Jerome Lanneluc CLA 2005-09-20 06:55:33 EDT
Reopening to mark as dup of bug 81471
Comment 6 Jerome Lanneluc CLA 2005-09-20 06:55:57 EDT

*** This bug has been marked as a duplicate of 81471 ***