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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top