| Summary: | [DCR] Make API for compiling in memory public | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Daniel Hirscher <devel> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 2.1.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Daniel Hirscher
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. 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. 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. Will wait until JSR-199 is resolved. For now the internal story is your best take. |