db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r917533 - in /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf: control/Controller.java source/FileSourcesImpl.java source/Sources.java
Date Mon, 01 Mar 2010 13:59:34 GMT
Author: tfischer
Date: Mon Mar  1 13:59:34 2010
New Revision: 917533

URL: http://svn.apache.org/viewvc?rev=917533&view=rev
Log:
allow an overrideFileset where the basedir is not set

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/control/Controller.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/FileSourcesImpl.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/Sources.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/control/Controller.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/control/Controller.java?rev=917533&r1=917532&r2=917533&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/control/Controller.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/control/Controller.java
Mon Mar  1 13:59:34 2010
@@ -36,6 +36,7 @@
 import org.apache.torque.gf.configuration.controller.GeneratorReference;
 import org.apache.torque.gf.configuration.controller.Output;
 import org.apache.torque.gf.configuration.generator.GeneratorConfiguration;
+import org.apache.torque.gf.file.Fileset;
 import org.apache.torque.gf.generator.Generator;
 import org.apache.torque.gf.generator.GeneratorException;
 import org.apache.torque.gf.source.Source;
@@ -115,10 +116,16 @@
                 }
 
                 Sources sources = output.getSources();
-                if (unitConfiguration.getOverrideSourceFileset() != null)
+                Fileset overrideSourceFileset
+                        = unitConfiguration.getOverrideSourceFileset();
+                if (overrideSourceFileset != null)
                 {
-                    sources.setSourceFileset(
-                            unitConfiguration.getOverrideSourceFileset());
+                    File oldBasepath = sources.getSourceFileset().getBasedir();
+                    if (overrideSourceFileset.getBasedir() == null)
+                    {
+                        overrideSourceFileset.setBasedir(oldBasepath);
+                    }
+                    sources.setSourceFileset(overrideSourceFileset);
                 }
                 sources.init();
                 if (!sources.hasNext())

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/FileSourcesImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/FileSourcesImpl.java?rev=917533&r1=917532&r2=917533&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/FileSourcesImpl.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/FileSourcesImpl.java
Mon Mar  1 13:59:34 2010
@@ -50,7 +50,7 @@
      */
     private SourceType type;
 
-    /** The fileset defining the source files. */
+    /** The fileset defining the source files, not null. */
     private Fileset sourceFileset;
 
     /** The paths of all contained Files. */
@@ -60,7 +60,7 @@
     private Iterator<File> pathIt;
 
     /**
-     * All known configuration handlers.
+     * All known configuration handlers, not null.
      */
     private ConfigurationHandlers configurationHandlers;
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/Sources.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/Sources.java?rev=917533&r1=917532&r2=917533&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/Sources.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/source/Sources.java
Mon Mar  1 13:59:34 2010
@@ -33,6 +33,13 @@
 public interface Sources extends Iterator<Source>
 {
     /**
+     * Returns the fileset which determines the source files to read.
+     *
+     * @return the source fileset, not null.
+     */
+    Fileset getSourceFileset();
+    
+    /**
      * Sets the fileset which determines the source files to read.
      *
      * @param sourceFileset the new source fileset, not null.



---------------------------------------------------------------------
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