Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top