Frage

Here is an example of some of my xtend code:

for(e: resource.allContents.toIterable.filter(typeof(Entity))) {
                    fsa.generateFile(e.name.toFirstUpper + ".java",
                    e.compileEntity)
                    }


def compileEntity(Entity e) '''
    package blahblah

    public class «e.name.toFirstUpper» {
        [My code]
    }
    '''

This outputs multiple java classes in different files. Is it possible to output them into a package or folder? This would allow me to specify the source code file structure rather than outputting tons of classes to the root of the 'src-gen' folder.

War es hilfreich?

Lösung

fsa.generateFile accepts a path where you just pass a plain file name. That will do the trick.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top