Generate as a plug-in

Better integrate into SBT, but doesn't work yet.