fsa.generateFile
accepts a path where you just pass a plain file name. That will do the trick.
xtend code generation file output (ordering files into packages)
-
10-03-2022 - |
Pergunta
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.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow