db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1388679 - /db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
Date Fri, 21 Sep 2012 21:03:11 GMT
Author: tfischer
Date: Fri Sep 21 21:03:11 2012
New Revision: 1388679

URL: http://svn.apache.org/viewvc?rev=1388679&view=rev
Log:
TORQUE-223 Add possibility to set override package in maven plugin

Modified:
    db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java

Modified: db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java?rev=1388679&r1=1388678&r2=1388679&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
(original)
+++ db/torque/torque4/trunk/torque-maven-plugin/src/main/java/org/apache/torque/generator/maven/TorqueGeneratorMojo.java
Fri Sep 21 21:03:11 2012
@@ -343,6 +343,15 @@ public class TorqueGeneratorMojo extends
     private File overrideConfigDir;
 
     /**
+     * The config package of the project overriding the settings.
+     * If set, the settings of this directory are used as "child"
+     * and the "normal" settings are used as "parent".
+     *
+     * @parameter
+     */
+    private String overrideConfigPackage;
+
+    /**
      * The Loglevel to use in the generation process. Must be one of
      * trace, debug, info, warn or error.
      *
@@ -633,7 +642,25 @@ public class TorqueGeneratorMojo extends
             parentUnitDescriptor.setOverrideOptions(optionConfiguration);
             parentUnitDescriptor.setLoglevel(convertedLoglevel);
             parentUnitDescriptor.setDefaultOutputEncoding(encoding);
-            getLog().debug("child unit descriptor created");
+            getLog().debug("child unit descriptor created from directory");
+            unitDescriptor = parentUnitDescriptor;
+        }
+        else if (overrideConfigPackage != null)
+        {
+            CustomProjectPaths childProjectPaths
+                = new CustomProjectPaths(projectPaths);
+            childProjectPaths.setConfigurationPackage(overrideConfigPackage);
+
+            UnitDescriptor parentUnitDescriptor = new UnitDescriptor(
+                    Packaging.CLASSPATH,
+                    childProjectPaths,
+                    new DefaultTorqueGeneratorPaths());
+            parentUnitDescriptor.setInheritsFrom(unitDescriptor);
+            parentUnitDescriptor.setOverrideSourceProvider(fileSourceProvider);
+            parentUnitDescriptor.setOverrideOptions(optionConfiguration);
+            parentUnitDescriptor.setLoglevel(convertedLoglevel);
+            parentUnitDescriptor.setDefaultOutputEncoding(encoding);
+            getLog().debug("child unit descriptor created from package");
             unitDescriptor = parentUnitDescriptor;
         }
         unitDescriptors.add(unitDescriptor);



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message