Generated code in different projects?

33 views
Skip to first unread message

Anton Hughes

unread,
May 12, 2015, 5:14:42 PM5/12/15
to sculptor...@googlegroups.com
Hi

We are currently creating a project and making extensive use of Sculptor. We have several custom cartridges, and will likely create more - and are also intending to give some of these back to the community.

Currently, all of these cartridges generate code in the same project. However, as we have many rest services, we would like, for example, the domain models to generate in their own project, so that the resulting jar can be used by clients of the rest service.

This pattern is ideally required for all of our cartridges - that we would like them to all read from the same sculptor file, but generate code in their own project - not all generating in one project.

Is this possible?

Thanks

Torsten Juergeleit

unread,
May 13, 2015, 5:29:32 AM5/13/15
to sculptor...@googlegroups.com, kurr...@gmail.com
We are currently creating a project and making extensive use of Sculptor. We have several custom cartridges, and will likely create more - and are also intending to give some of these back to the community.

Great. In a different thread we started to discuss about ways to share cartridges provided by the community.


Currently, all of these cartridges generate code in the same project. However, as we have many rest services, we would like, for example, the domain models to generate in their own project, so that the resulting jar can be used by clients of the rest service.

This pattern is ideally required for all of our cartridges - that we would like them to all read from the same sculptor file, but generate code in their own project - not all generating in one project.

Is this possible?

Sculptor supports splitting a domain model into separate Maven modules and referencing the shared model files from within other Maven modules as class path resources. You have to make sure that the generator only creates code which is intended for this module (via "generate.module.xyz=false").

If you are interested only in the code generated by your custom cartridges then you have to set the "generate.*" properties accordingly or the cartridge has to override the generators central template RootTmp.root().

/Torsten
 

In the referencing Maven modules sculptor-generator.properties you can activate the corresponding cartridge(s).
Reply all
Reply to author
Forward
0 new messages