Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351816

Summary: JavaProjectBasedBuilderParticipant: Enable generation into different project
Product: [Modeling] TMF Reporter: Karsten Thoms <karsten.thoms>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Karsten Thoms CLA 2011-07-12 07:00:00 EDT
The build() method of JavaProjectBasedBuilderParticipant assumes that model and generated code resist in the same project. This might be different depending on project requirements, where models should be maintained in a seperate project. The target project must be derivable from the built (model) project somehow.

I would like to have a mapping method to calculate the target project from the BuildContext. By default, it returns the built project.

protected IProject getTargetProject (IBuildContext context) {
  return context.getBuiltProject());
}

public void build(IBuildContext context, IProgressMonitor monitor) throws CoreException {
   final IProject targetProject = getTargetProject(context);
   IJavaProject javaProject = JavaCore.create(targetProject);
   ...
Comment 1 Sven Efftinge CLA 2012-11-22 07:40:21 EST
This is beyond the scope of the default implementation. You can always come up with a special implementation for special requirements.