File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
gradle/plugin/src/main/java/org/hibernate/tool/gradle Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ public class Extension {
2929 public String revengFile = null ;
3030 public Boolean generateAnnotations = true ;
3131 public Boolean useGenerics = true ;
32+ public String templatePath = null ;
3233
3334 public Extension (Project project ) {}
3435
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ void doWork() {
3838 File outputFolder = getOutputFolder ();
3939 hbmExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
4040 hbmExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
41+ String templatePath = getExtension ().templatePath ;
42+ if (templatePath != null ) {
43+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
44+ hbmExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
45+ }
4146 getLogger ().lifecycle ("Starting DAO export to directory: " + outputFolder + "..." );
4247 hbmExporter .start ();
4348 getLogger ().lifecycle ("DAO export finished" );
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ void doWork() {
3838 File outputFolder = getOutputFolder ();
3939 hbmExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
4040 hbmExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
41+ String templatePath = getExtension ().templatePath ;
42+ if (templatePath != null ) {
43+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
44+ hbmExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
45+ }
4146 getLogger ().lifecycle ("Starting HBM export to directory: " + outputFolder + "..." );
4247 hbmExporter .start ();
4348 getLogger ().lifecycle ("HBM export finished" );
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ void doWork() {
4040 File outputFolder = getOutputFolder ();
4141 pojoExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
4242 pojoExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
43+ String templatePath = getExtension ().templatePath ;
44+ if (templatePath != null ) {
45+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
46+ pojoExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
47+ }
4348 getLogger ().lifecycle ("Starting Java export to directory: " + outputFolder + "..." );
4449 pojoExporter .start ();
4550 getLogger ().lifecycle ("Java export finished" );
You can’t perform that action at this time.
0 commit comments