eclipsepluginswizardxtextprojects

Xtext: DSL Wizard - Create a Java project, but not as a plug-in


I have this in my work flow

    fragment = ui.projectWizard.SimpleProjectWizardFragment2 {
        generate = true
    }

Which enables a DSL wizard, but the projects that are created with the wizard are plug-in projects.

If I add the following flag

pluginProject = false

The projects are not plug-in (which is good) but I can't add Java classes.

How can I make the wizard to create a project that supports both .dsl files and .java files without making it a plug-in project?

Thanks.


Solution

  • What about simply customizing the stuff created by the workflow ???

    class MyDslProjectCreatorCustom extends MyDslProjectCreator {
    
        override protected getBuilders() {
            #[XtextProjectHelper.BUILDER_ID, "org.eclipse.jdt.core.javabuilder"]
        }
    
        override protected getProjectNatures() {
            #[XtextProjectHelper.NATURE_ID, "org.eclipse.jdt.core.javanature"]
        }
    
    }
    

    and

    @FinalFieldsConstructor
    class MyDslUiModule extends AbstractMyDslUiModule {
    
        def Class<? extends ProjectFactory> bindProjectFactory() {
            JavaProjectFactory    
        }
    
        override bindIProjectCreator() {
            MyDslProjectCreatorCustom
        }
    
    }