forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject svn commit: rev 37080 - in forrest/trunk/src: core core/targets java/org/apache/forrest/conf
Date Thu, 26 Aug 2004 13:35:04 GMT
Author: brondsem
Date: Thu Aug 26 06:35:03 2004
New Revision: 37080

Modified:
   forrest/trunk/src/core/forrest.build.xml
   forrest/trunk/src/core/targets/context.xml
   forrest/trunk/src/core/targets/site.xml
   forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java
Log:
command-line system properties to forrest get passed on to cocoon, like it used to before
copyless

Modified: forrest/trunk/src/core/forrest.build.xml
==============================================================================
--- forrest/trunk/src/core/forrest.build.xml	(original)
+++ forrest/trunk/src/core/forrest.build.xml	Thu Aug 26 06:35:03 2004
@@ -387,6 +387,10 @@
        <jvmarg
          value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.endorsed.lib-dir}"/>
        <arg line="${content-dir}/jettyconf.xml" />
+       <syspropertyset>
+         <propertyref prefix="forrest."/>
+         <propertyref prefix="project."/>
+       </syspropertyset>
     </java>
   </target>
   
@@ -405,6 +409,10 @@
        <jvmarg
          value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.endorsed.lib-dir}"/>
        <arg line="${forrest.home}/context/jettyconf.xml" />
+       <syspropertyset>
+         <propertyref prefix="forrest."/>
+         <propertyref prefix="project."/>
+       </syspropertyset>
     </java>
   </target>  
 

Modified: forrest/trunk/src/core/targets/context.xml
==============================================================================
--- forrest/trunk/src/core/targets/context.xml	(original)
+++ forrest/trunk/src/core/targets/context.xml	Thu Aug 26 06:35:03 2004
@@ -158,6 +158,10 @@
         <classpath>
           <path refid="forrest.cp"/>
         </classpath>
+        <syspropertyset>
+          <propertyref prefix="forrest."/>
+          <propertyref prefix="project."/>
+        </syspropertyset>
       </java>
 </target>
 

Modified: forrest/trunk/src/core/targets/site.xml
==============================================================================
--- forrest/trunk/src/core/targets/site.xml	(original)
+++ forrest/trunk/src/core/targets/site.xml	Thu Aug 26 06:35:03 2004
@@ -55,6 +55,10 @@
         <classpath>
           <path refid="forrest.cp"/>
         </classpath>
+        <syspropertyset>
+          <propertyref prefix="forrest."/>
+          <propertyref prefix="project."/>
+        </syspropertyset>
       </java> 
 
       <sequential>

Modified: forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java
==============================================================================
--- forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java	(original)
+++ forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java	Thu Aug 26 06:35:03
2004
@@ -18,6 +18,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
+import java.util.Enumeration;
 import java.util.Map;
 
 import org.apache.avalon.framework.activity.Initializable;
@@ -119,9 +120,25 @@
         filteringProperties = loadAntPropertiesFromURI(filteringProperties,
                         defaultRorrestPropertiesStringURI);
 
+        loadSystemProperties(filteringProperties);
         ForrestConfUtils.aliasSkinProperties(filteringProperties);
         if (debugging())
             debug("Loaded project forrest.properties:" + filteringProperties);
+    }
+
+     /**
+     * Override any properties for which a system property exists
+     */
+    private void loadSystemProperties(AntProperties props) {
+        for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
+            String propName = (String)e.nextElement();
+            String systemPropValue = System.getProperty(propName);
+            if (systemPropValue != null) {
+                // AntProperties.setProperty doesn't let you override, so we have to remove
the property then add it again
+                props.remove(propName);
+                props.setProperty(propName, systemPropValue);
+            }
+        }
     }
 
     /**

Mime
View raw message