3

How to change the default location of the generated packages in xtext?

For example: src-gen package and xtend-gen.

Inside these packages there are various sub packages are generated.So how one can change the default generation location.

1 Answers1

5

How to modify src-gen location

Open GenerateDSL.mwe2:

  • Add the following in Generator component:

    component = Generator {
        srcGenPath = "/src-other"
        ...
    }
    
  • Modify existing directory cleaners:

    component = DirectoryCleaner {
        directory = "${runtimeProject}/src-other"
    }
    component = DirectoryCleaner {
        directory = "${runtimeProject}.ui/src-other"
    }
    component = DirectoryCleaner {
        directory = "${runtimeProject}.tests/src-other"
    }
    

.


How to modify xtend-gen location

Open Eclipse Preferences then go to Xtend -> Compiler page.

You can change default Directory in section "Output folder for generated Java files" enter image description here

Fabien Fleureau
  • 693
  • 5
  • 14