forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdupoiri...@apache.org
Subject svn commit: r388497 - in /forrest/trunk/main: forrest.build.xml targets/plugins.xml var/pluginlist2fetch.xsl webapp/default-forrest.properties
Date Fri, 24 Mar 2006 12:04:46 GMT
Author: cdupoirieux
Date: Fri Mar 24 04:04:37 2006
New Revision: 388497

URL: http://svn.apache.org/viewcvs?rev=388497&view=rev
Log:
(FOR-388 - Add the ability to define a list of plugins src locations to local-deploy them)

- Add of the project.required.plugins.src properties
  (default ${forrest.home}/plugins,${forrest.home}/whiteboard/plugins)
  to let a project define other source plugins locations.
  (default-forrest.properties)
- Update the fetch-unversioned-plugin target in order to look for the plugin in the different
locations
  specified in the new property and local-deploy it if found. Else, try to get it from downloading
site.
  (pluginlist2fetch.xsl)
- Suppress the forrest.plugins.src and forrest.plugins.whiteboard.src variables declaration
  (forrest.build.xml)
- Change the fetch-plugin target in order to use the new property in parameter of pluginlist2fetch.xsl.

Modified:
    forrest/trunk/main/forrest.build.xml
    forrest/trunk/main/targets/plugins.xml
    forrest/trunk/main/var/pluginlist2fetch.xsl
    forrest/trunk/main/webapp/default-forrest.properties

Modified: forrest/trunk/main/forrest.build.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/forrest.build.xml?rev=388497&r1=388496&r2=388497&view=diff
==============================================================================
--- forrest/trunk/main/forrest.build.xml (original)
+++ forrest/trunk/main/forrest.build.xml Fri Mar 24 04:04:37 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2006 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,9 +45,6 @@
   <property name="forrest.core"               location="${forrest.home}/main"/>
   <property name="forrest.core.webapp"        location="${forrest.core}/webapp"/>
   
-  <property name="forrest.plugins.src"            location="${forrest.home}/plugins"/>
-  <property name="forrest.plugins.whiteboard.src" location="${forrest.home}/whiteboard/plugins"/>
-  
   <import file="targets/validate.xml"/>
   <import file="targets/webapp.xml"/>
   <import file="targets/site.xml"/>
@@ -105,6 +102,7 @@
     <property name="build.plugins-dir"     value="build/plugins"/>
     <property name="forrest.skins-dir"     location="${forrest.core.webapp}/skins"/>
     <property name="forrest.plugins-dir"   location="${forrest.home}/${build.plugins-dir}"/>
+
     <!-- views -->
     <property name="project.view-defaultView" value="common.fv"/>
     <!-- If the user wants to build i18n in diferent locations this is one way to implemented
it--> 

Modified: forrest/trunk/main/targets/plugins.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/targets/plugins.xml?rev=388497&r1=388496&r2=388497&view=diff
==============================================================================
--- forrest/trunk/main/targets/plugins.xml (original)
+++ forrest/trunk/main/targets/plugins.xml Fri Mar 24 04:04:37 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  Copyright 2002-2006 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -353,8 +353,7 @@
           <param name="plugin-name" expression="${plugin.name}"/>  
           <param name="plugin-version" expression="${plugin.version}"/>  
           <param name="plugin-dir" expression="${forrest.plugins-dir}/"/>  
-          <param name="plugin-src-dir" expression="${forrest.plugins.src}/"/>  
-          <param name="plugin-whiteboard-src-dir" expression="${forrest.plugins.whiteboard.src}/"/>
     
+          <param name="plugin-src-dir" expression="${project.required.plugins.src}"/>
           <param name="forrest-version" expression="${forrest.version}"/>   
        </xslt>  
        <ant antfile="${project.temp-dir}/pluginlist2fetchbuild.xml"/> 
@@ -389,7 +388,11 @@
 
       <for list="${project.required.plugins}" param="name">
       <sequential>
-        <echo>Installing plugin: @{name}</echo>
+        <echo>
+      --------------------------------------------------------------
+      Installing plugin: @{name}
+      --------------------------------------------------------------
+       </echo>
         <propertyregex property="plugin.name"
               override="true"
               input="@{name}"

Modified: forrest/trunk/main/var/pluginlist2fetch.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/var/pluginlist2fetch.xsl?rev=388497&r1=388496&r2=388497&view=diff
==============================================================================
--- forrest/trunk/main/var/pluginlist2fetch.xsl (original)
+++ forrest/trunk/main/var/pluginlist2fetch.xsl Fri Mar 24 04:04:37 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  Copyright 2002-2006 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,6 @@
    <xsl:param name="plugin-version" />
    <xsl:param name="plugin-dir"/>
    <xsl:param name="plugin-src-dir"/>
-   <xsl:param name="plugin-whiteboard-src-dir"/>
    <xsl:param name="forrest-version" />
 
    <xsl:template match="plugins">
@@ -45,48 +44,46 @@
             </xsl:if>
          </target>
 
-         <target name="fetch-unversioned-plugin" 
+         <target name="fetch-unversioned-plugin"
            unless="versioned-plugin.present">
             <echo>Versioned plugin unavailable, trying to get versionless plugin...</echo>
-            
-            <echo>Looking in local plugins src...</echo>
+            <trycatch property="plugin-found">
+              <try>
+                <for param="plugin-src-dir">
+                  <xsl:attribute name="list"><xsl:value-of select="$plugin-src-dir"
/></xsl:attribute>
+                  <sequential>
+                    <echo>Looking in local @{plugin-src-dir}</echo>
+                    <if>
+                      <available property="plugin.src.present" type="dir">
+                        <xsl:attribute name="file">@{plugin-src-dir}/<xsl:value-of
select="$plugin-name" /></xsl:attribute>
+                      </available>
+                      <then>
+                        <ant target="local-deploy">
+                          <xsl:attribute name="antfile">@{plugin-src-dir}/<xsl:value-of
select="$plugin-name" />/build.xml</xsl:attribute>
+                          <xsl:attribute name="dir">@{plugin-src-dir}/<xsl:value-of
select="$plugin-name" /></xsl:attribute>
+                        </ant>
+                        <fail/>
+                      </then>
+                    </if>
+                  </sequential>
+                </for>
+              </try>
+              <catch>
+                <echo>Plugin <xsl:value-of select="$plugin-name" /> deployed
!</echo>
+              </catch>
+            </trycatch>
             <if>
-              <available property="plugin.src.present" type="dir">
-                <xsl:attribute name="file"><xsl:value-of select="$plugin-src-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
-              </available>
+              <not>
+                <isset property="plugin-found"/>
+              </not>
               <then>
-                <ant target="local-deploy">
-                    <xsl:attribute name="antfile"><xsl:value-of select="$plugin-src-dir"/><xsl:value-of
select="$plugin-name" />/build.xml</xsl:attribute>
-                    <xsl:attribute name="dir"><xsl:value-of select="$plugin-src-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
-                </ant>
+                <echo>Tying to download from the distribution site ...</echo>
+                <get verbose="true" usetimestamp="true" ignoreerrors="true">
+                  <xsl:attribute name="src"><xsl:value-of select="plugin[@name=$plugin-name]/@url"
/>/<xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
+                  <xsl:attribute name="dest"><xsl:value-of select="$plugin-dir"/><xsl:value-of
select="$plugin-name" />.zip</xsl:attribute>
+                </get>
               </then>
-              <else>
-                  <echo>Unable to find plugin src in main plugins src dir.</echo>
-                  <echo>Looking in local whiteboard plugins src...</echo>
-                  <if>
-                    <available property="whiteboard.plugin.src.present" type="dir">
-                       <xsl:attribute name="file"><xsl:value-of select="$plugin-whiteboard-src-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
-                    </available>
-                    <then>
-                      <copy failonerror="false">
-                        <xsl:attribute name="todir"><xsl:value-of select="$plugin-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
-                        <fileset>
-                          <xsl:attribute name="dir"><xsl:value-of select="$plugin-whiteboard-src-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
-                        </fileset>
-                      </copy>
-                    </then>
-                    <else>     
-                      <echo>Unable to find plugin src in whiteboard.</echo>
-                      <echo>Downloaing from distribution site ...</echo>
-                      <get verbose="true" usetimestamp="true" ignoreerrors="true">
-                         <xsl:attribute name="src"><xsl:value-of select="plugin[@name=$plugin-name]/@url"
/>/<xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
-                         <xsl:attribute name="dest"><xsl:value-of select="$plugin-dir"/><xsl:value-of
select="$plugin-name" />.zip</xsl:attribute>
-                      </get>
-                    </else>
-                  </if>
-              </else>
             </if>
-	           
          </target>
 
          <target name="final-check">
@@ -100,7 +97,7 @@
                 </xsl:otherwise>
               </xsl:choose>
             </available>
-            
+
             <if>
               <isset property="desired.plugin.zip.present"/>
               <then>
@@ -111,21 +108,21 @@
                   <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of
select="$plugin-name" /></xsl:attribute>
                 </available>
                 <fail unless="unversioned.plugin.present">
-  Unable to download the 
+  Unable to download the
   "<xsl:value-of select="$plugin-name" />" plugin
   <xsl:if test="$plugin-version">version <xsl:value-of select="$plugin-version"/></xsl:if>
   or an equivalent unversioned plugin
   from <xsl:value-of select="plugin[@name=$plugin-name]/@url" />
   There are a number of possible causes for this:
 
-  One possible problem is that you do not have write access to 
-  FORREST_HOME, in which case ask your system admin to install the 
+  One possible problem is that you do not have write access to
+  FORREST_HOME, in which case ask your system admin to install the
   required Forrest plugin as described below.
-              
-  A further possibility is that Forrest may be unable to connect to 
-  the plugin distribution server. Again the solution is to manually 
+
+  A further possibility is that Forrest may be unable to connect to
+  the plugin distribution server. Again the solution is to manually
   install the plugin.
-  
+
   To manually install a plugin, download the plugin zip file from
   <xsl:value-of select="plugin[@name=$plugin-name]/@url"/> and
   extract it into
@@ -145,6 +142,6 @@
 
    <xsl:template match="plugin">
    </xsl:template>
-   
+
 </xsl:stylesheet>
 

Modified: forrest/trunk/main/webapp/default-forrest.properties
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/default-forrest.properties?rev=388497&r1=388496&r2=388497&view=diff
==============================================================================
--- forrest/trunk/main/webapp/default-forrest.properties (original)
+++ forrest/trunk/main/webapp/default-forrest.properties Fri Mar 24 04:04:37 2006
@@ -1,4 +1,4 @@
-# Copyright 2002-2005 The Apache Software Foundation or its licensors,
+# Copyright 2002-2006 The Apache Software Foundation or its licensors,
 # as applicable.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -156,6 +156,10 @@
 # comma separated list (no spaces)
 # Run "forrest available-plugins" for a list of plug-ins currently available
 project.required.plugins=org.apache.forrest.plugin.output.pdf
+
+# The names of src directories where project should find required plugins src
+# comma separated list (no spaces)
+project.required.plugins.src=${forrest.home}/plugins,${forrest.home}/whiteboard/plugins
 
 # Views v1 Configuration
 project.view.internal.plugin=org.apache.forrest.plugin.internal.view



Mime
View raw message