File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
gradle/plugin/src/main/java/org/hibernate/tool/gradle Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ public class Extension {
1212 public String revengFile = null ;
1313 public Boolean generateAnnotations = true ;
1414 public Boolean useGenerics = true ;
15-
15+ public String templatePath = null ;
16+
1617 public Extension (Project project ) {}
1718
1819}
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ void doWork() {
2121 File outputFolder = getOutputFolder ();
2222 hbmExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
2323 hbmExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
24+ String templatePath = getExtension ().templatePath ;
25+ if (templatePath != null ) {
26+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
27+ hbmExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
28+ }
2429 getLogger ().lifecycle ("Starting DAO export to directory: " + outputFolder + "..." );
2530 hbmExporter .start ();
2631 getLogger ().lifecycle ("DAO export finished" );
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ void doWork() {
2121 File outputFolder = getOutputFolder ();
2222 hbmExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
2323 hbmExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
24+ String templatePath = getExtension ().templatePath ;
25+ if (templatePath != null ) {
26+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
27+ hbmExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
28+ }
2429 getLogger ().lifecycle ("Starting HBM export to directory: " + outputFolder + "..." );
2530 hbmExporter .start ();
2631 getLogger ().lifecycle ("HBM export finished" );
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ void doWork() {
2323 File outputFolder = getOutputFolder ();
2424 pojoExporter .getProperties ().put (ExporterConstants .METADATA_DESCRIPTOR , createJdbcDescriptor ());
2525 pojoExporter .getProperties ().put (ExporterConstants .DESTINATION_FOLDER , outputFolder );
26+ String templatePath = getExtension ().templatePath ;
27+ if (templatePath != null ) {
28+ getLogger ().lifecycle ("Setting template path to: " + templatePath );
29+ pojoExporter .getProperties ().put (ExporterConstants .TEMPLATE_PATH , new String [] { templatePath });
30+ }
2631 getLogger ().lifecycle ("Starting Java export to directory: " + outputFolder + "..." );
2732 pojoExporter .start ();
2833 getLogger ().lifecycle ("Java export finished" );
You can’t perform that action at this time.
0 commit comments