You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2005/06/10 02:08:55 UTC

svn commit: r189864 - in /forrest/trunk/main: forrest.build.xml fresh-site/forrest.properties targets/plugins.xml var/pluginlist2fetch.xsl

Author: rgardler
Date: Thu Jun  9 17:08:55 2005
New Revision: 189864

URL: http://svn.apache.org/viewcvs?rev=189864&view=rev
Log:
Add ability to specify a versioned plugin in forrest.properties. If the requested version is not available or none is specified then an unversioned plugin will be used, this version will be the latest published bersion and may be an in-development version.

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

Modified: forrest/trunk/main/forrest.build.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/forrest.build.xml?rev=189864&r1=189863&r2=189864&view=diff
==============================================================================
--- forrest/trunk/main/forrest.build.xml (original)
+++ forrest/trunk/main/forrest.build.xml Thu Jun  9 17:08:55 2005
@@ -29,7 +29,7 @@
 
   <property environment="env" />
   <property name="forrest.home"               location="${env.FORREST_HOME}" />
-  <property name="forrest.version"            value="0.7-dev"/>
+  <property name="forrest.version"            value="0.7"/>
 
   <property name="forrest.lib-dir"            location="${forrest.home}/lib"/>
   <property name="forrest.core.lib-dir"       location="${forrest.lib-dir}/core"/>

Modified: forrest/trunk/main/fresh-site/forrest.properties
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/fresh-site/forrest.properties?rev=189864&r1=189863&r2=189864&view=diff
==============================================================================
--- forrest/trunk/main/fresh-site/forrest.properties (original)
+++ forrest/trunk/main/fresh-site/forrest.properties Thu Jun  9 17:08:55 2005
@@ -115,6 +115,11 @@
 
 # The names of plugins that are required to build the project
 # comma separated list (no spaces)
+# You can request a specific version by appending "-VERSION" to the end of
+# the plugin name. If you exclude a version number the latest released version
+# will be used, however, be aware that this may be a development version. In
+# a production environment it is recomended that you specify a known working 
+# version.
 # Run "forrest available-plugins" for a list of plug-ins currently available
 project.required.plugins=org.apache.forrest.plugin.output.pdf
 

Modified: forrest/trunk/main/targets/plugins.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/targets/plugins.xml?rev=189864&r1=189863&r2=189864&view=diff
==============================================================================
--- forrest/trunk/main/targets/plugins.xml (original)
+++ forrest/trunk/main/targets/plugins.xml Thu Jun  9 17:08:55 2005
@@ -39,57 +39,48 @@
     <property name="plugin.unavailable" value="true"/>
   </target>  
   
-  <target name="check-plugin">   
+  <target name="check-plugin">  
     <condition property="plugin.unavailable">
       <and>
         <not>
-          <available type="dir" file="${forrest.plugins-dir}/${plugin.name}"/>
+          <available type="dir" file="${forrest.plugins-dir}/${versioned.name}"/>
         </not>
         <not>
-          <available type="file" file="${forrest.plugins-dir}/${plugin.name}.zip"/>
+          <available type="file" file="${forrest.plugins-dir}/${versioned.name}.zip"/>
         </not>
       </and>
     </condition>
+    <if>
+      <isset property="plugin.unavailable"/>
+      <then>
+        <echo>${versioned.name} is not available in the build dir</echo>
+      </then>
+      <else>
+        <echo>${versioned.name} is available in the build dir</echo>
+      </else>
+    </if>
   </target>  
             
   <target name="unpack-plugin"
            if="plugin.unavailable"
           depends="init-props">
      <if>
-       <available file="${forrest.plugins-dir}/${plugin.name}.zip"/>
+       <available file="${forrest.plugins-dir}/${versioned.name}.zip"/>
        <then>
-       <unzip dest="${forrest.plugins-dir}/${plugin.name}">
-         <fileset dir="${forrest.plugins-dir}/">
-            <include name="${plugin.name}.zip"/>
-          </fileset>
-       </unzip>       
-       <delete>
-          <fileset dir="${forrest.plugins-dir}/">
-            <include name="${plugin.name}.zip"/>
-          </fileset>
-       </delete>
-
-       <!-- add to the entity catalog -->
-       <copy file="${forrest.core}/var/initial_catalog.xcat"
-         tofile="${forrest.plugins-dir}/catalog.xcat"
-         overwrite="false"/>
-       <if>
-         <available file="${forrest.plugins-dir}/${plugin.name}/resources/schema/catalog.xcat"/>
-         <then>
-           <xslt in="${forrest.plugins-dir}/catalog.xcat"
-               out="${forrest.plugins-dir}/catalog.xcat.new"
-               style="${forrest.core}/var/catalogMountSnippet.xsl"
-               force="true">
-             <param name="plugin-catalog-path"
-               expression="${forrest.plugins-dir}/${plugin.name}/resources/schema/catalog.xcat"/>
-           </xslt>
-           <move file="${forrest.plugins-dir}/catalog.xcat.new" 
-             tofile="${forrest.plugins-dir}/catalog.xcat"/>
-         </then>
-       </if>
-     </then>
-     <else>
-       <echo>
+         <antcall target="extract-plugin">
+           <param name="plugin" value="${versioned.name}"/>
+         </antcall>
+       </then>
+       <else>
+         <if>
+           <available file="${forrest.plugins-dir}/${plugin.name}.zip"/>
+           <then>
+             <antcall target="extract-plugin">
+               <param name="plugin" value="${plugin.name}"/>
+             </antcall>
+           </then>
+           <else>
+             <echo>
 ERROR
 =====
        
@@ -104,34 +95,114 @@
 forrest.plugins.descriptors property in the forrest.properties file
 and ensure that the locations indicated by that value are accessible
 (note there should be no spaces in this property).
-       </echo>
-       <fail message="Unable to install required plugins. See error messages above for more detail."/>
-     </else>
+             </echo>
+             <fail message="Unable to install required plugins. See error messages above for more detail."/>
+           </else>
+         </if>
+       </else>
    </if>
   </target>  
   
+  <target name="extract-plugin">
+   <unzip dest="${forrest.plugins-dir}/${plugin}">
+     <fileset dir="${forrest.plugins-dir}/">
+        <include name="${plugin}.zip"/>
+      </fileset>
+   </unzip>       
+   <delete>
+      <fileset dir="${forrest.plugins-dir}/">
+        <include name="${plugin}.zip"/>
+      </fileset>
+   </delete>
+
+   <!-- add to the entity catalog -->
+   <copy file="${forrest.core}/var/initial_catalog.xcat"
+     tofile="${forrest.plugins-dir}/catalog.xcat"
+     overwrite="false"/>
+   <if>
+     <available file="${forrest.plugins-dir}/${plugin}/resources/schema/catalog.xcat"/>
+     <then>
+       <xslt in="${forrest.plugins-dir}/catalog.xcat"
+           out="${forrest.plugins-dir}/catalog.xcat.new"
+           style="${forrest.core}/var/catalogMountSnippet.xsl"
+           force="true">
+         <param name="plugin-catalog-path"
+           expression="${forrest.plugins-dir}/${plugin}/resources/schema/catalog.xcat"/>
+       </xslt>
+       <move file="${forrest.plugins-dir}/catalog.xcat.new" 
+         tofile="${forrest.plugins-dir}/catalog.xcat"/>
+     </then>
+   </if>
+  </target>
+  
   <target name="configure-plugin" 
-    unless="plugin.unavailable"
-    depends="check-plugin-type, configure-input-plugin, configure-output-plugin, configure-internal-plugin"/>
-    
-  <target name="check-plugin-type" 
     unless="plugin.unavailable">
-    <available property="input-plugin" file="${forrest.plugins-dir}/${plugin.name}/input.xmap"/>
-    <available property="output-plugin" file="${forrest.plugins-dir}/${plugin.name}/output.xmap"/>
-    <available property="internal-plugin" file="${forrest.plugins-dir}/${plugin.name}/internal.xmap"/>
+    <if>
+      <available file="${forrest.plugins-dir}/${versioned.name}"/>
+      <then>
+        <if>
+          <available property="input-plugin" file="${forrest.plugins-dir}/${versioned.name}/input.xmap"/>
+          <then>
+            <antcall target="configure-input-plugin">
+              <param name="plugin" value="${versioned.name}"/>
+            </antcall>
+          </then>
+        </if>
+        <if>
+          <available property="output-plugin" file="${forrest.plugins-dir}/${versioned.name}/output.xmap"/>
+          <then>
+            <antcall target="configure-output-plugin">
+              <param name="plugin" value="${versioned.name}"/>
+            </antcall>
+          </then>
+        </if>
+        <if>
+          <available property="internal-plugin" file="${forrest.plugins-dir}/${versioned.name}/internal.xmap"/>
+          <then>
+            <antcall target="configure-internal-plugin">
+              <param name="plugin" value="${versioned.name}"/>
+            </antcall>
+          </then>
+        </if>
+      </then>
+      <else>
+        <if>
+          <available property="input-plugin" file="${forrest.plugins-dir}/${plugin.name}/input.xmap"/>
+          <then>
+            <antcall target="configure-input-plugin">
+              <param name="plugin" value="${plugin.name}"/>
+            </antcall>
+          </then>
+        </if>
+        <if>
+          <available property="output-plugin" file="${forrest.plugins-dir}/${plugin.name}/output.xmap"/>
+          <then>
+            <antcall target="configure-output-plugin">
+              <param name="plugin" value="${plugin.name}"/>
+            </antcall>
+          </then>
+        </if>
+        <if>
+          <available property="internal-plugin" file="${forrest.plugins-dir}/${plugin.name}/internal.xmap"/>
+          <then>
+            <antcall target="configure-internal-plugin">
+              <param name="plugin" value="${plugin.name}"/>
+            </antcall>
+          </then>
+        </if>
+      </else>
+    </if>
   </target>
   
-  <target name="configure-input-plugin"
-    if="input-plugin"
-    unless="plugin.unavailable">
+  <target name="configure-input-plugin">
      <!-- add the snippet to plugins/input.xmap that will mount the plugin
           specific input.xmap -->
-     <echo>Mounting input plugin: ${plugin.name}</echo>
+     <echo>Mounting input plugin: ${plugin}</echo>
      <xslt in="${project.temp-dir}/input.xmap"
        out="${project.temp-dir}/input.xmap.new"
        style="${forrest.core}/var/pluginMountSnippet.xsl"
        force="true">
-           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-name" expression="${plugin}"/>  
            <param name="plugin-type" expression="input"/>  
      </xslt>
      <move file="${project.temp-dir}/input.xmap.new" 
@@ -140,41 +211,37 @@
        out="${project.temp-dir}/resources.xmap.new"
        style="${forrest.core}/var/pluginMountSnippet.xsl"
        force="true">
-           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-name" expression="${plugin}"/>  
            <param name="plugin-type" expression="resources"/>  
      </xslt>
      <move file="${project.temp-dir}/resources.xmap.new" 
        tofile="${project.temp-dir}/resources.xmap"/>
   </target>
   
-  <target name="configure-output-plugin"
-    if="output-plugin"
-    unless="plugin.unavailable">
+  <target name="configure-output-plugin">
      <!-- add the snippet to plugins/output.xmap that will mount the plugin
           specific input.xmap -->
-     <echo>Mounting output plugin: ${plugin.name}</echo>
+     <echo>Mounting output plugin: ${plugin}</echo>
      <xslt in="${project.temp-dir}/output.xmap"
        out="${project.temp-dir}/output.xmap.new"
        style="${forrest.core}/var/pluginMountSnippet.xsl"
        force="true">
-           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-name" expression="${plugin}"/>  
            <param name="plugin-type" expression="output"/>  
      </xslt>
      <move file="${project.temp-dir}/output.xmap.new" 
        tofile="${project.temp-dir}/output.xmap"/>
   </target>
   
-  <target name="configure-internal-plugin"
-    if="internal-plugin"
-    unless="plugin.unavailable">
+  <target name="configure-internal-plugin">
      <!-- add the snippet to plugins/internal.xmap that will mount the plugin
           specific input.xmap -->
-     <echo>Mounting internals plugin: ${plugin-name}</echo>
+     <echo>Mounting internal plugin: ${plugin}</echo>
      <xslt in="${project.temp-dir}/internal.xmap"
        out="${project.temp-dir}/internal.xmap.new"
        style="${forrest.core}/var/pluginMountSnippet.xsl"
        force="true">
-           <param name="plugin-name" expression="${plugin.name}"/>  
+           <param name="plugin-name" expression="${plugin}"/>  
            <param name="plugin-type" expression="internal"/>  
      </xslt>
      <move file="${project.temp-dir}/internal.xmap.new" 
@@ -189,7 +256,7 @@
     <var name="plugin-counter" value="1"/>
     <for list="${forrest.plugins.descriptors}" param="url">
       <sequential>
-        <echo>fetching descriptor: @{url}</echo>
+        <echo>Fetching plugins descriptor: @{url}</echo>
         <get src="@{url}" 
            dest="${project.temp-dir}/plugins-${plugin-counter}.xml"
            verbose="true" usetimestamp="true" ignoreerrors="true"/>
@@ -205,14 +272,14 @@
         <if>
           <available file="${project.temp-dir}/plugins-${plugin-counter}.xml"/>
           <then>
-            <echo>Plugin list loaded.</echo>
+            <echo>Plugin list loaded from @{url}.</echo>
           </then>
           <else>
             <echo>
             WARNING
             =======
             
-            Unable to load plugin list number ${plugin-counter}. 
+            Unable to load plugin list number ${plugin-counter} from @{url}. 
             Any plugins identified in this plugin list cannot be installed 
             automatially, see further errors below.</echo>
           </else>
@@ -235,6 +302,7 @@
           style="${forrest.core}/var/pluginlist2fetch.xsl"
           force="true">
           <param name="plugin-name" expression="${plugin.name}"/>  
+          <param name="plugin-version" expression="${plugin.version}"/>  
           <param name="plugin-dir" expression="${forrest.plugins-dir}/"/>      
           <param name="forrest-version" expression="${forrest.version}"/>   
        </xslt>  
@@ -266,11 +334,29 @@
       <for list="${project.required.plugins}" param="name">
       <sequential>
         <echo>Installing plugin: @{name}</echo>
+        <propertyregex property="plugin.name"
+              override="true"
+              input="@{name}"
+              regexp="(.*)-(.*)"
+              select="\1"
+              casesensitive="false" 
+              defaultvalue="@{name}"/>
+        <propertyregex property="plugin.version"
+              override="true"
+              input="@{name}"
+              regexp="(.*)-(.*)"
+              select="\2"
+              casesensitive="false"
+              defaultvalue=""/>
         <antcall target="install-plugin">
-          <param name="plugin.name" value="@{name}"/>
+          <param name="plugin.name" value="${plugin.name}"/>
+          <param name="plugin.version" value="${plugin.version}"/>
+          <param name="versioned.name" value="@{name}"/>
         </antcall>
         <antcall target="configure-plugin">
-          <param name="plugin.name" value="@{name}"/>
+          <param name="plugin.name" value="${plugin.name}"/>
+          <param name="plugin.version" value="${plugin.version}"/>
+          <param name="versioned.name" value="@{name}"/>
         </antcall>
       </sequential>
     </for>

Modified: forrest/trunk/main/var/pluginlist2fetch.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/var/pluginlist2fetch.xsl?rev=189864&r1=189863&r2=189864&view=diff
==============================================================================
--- forrest/trunk/main/var/pluginlist2fetch.xsl (original)
+++ forrest/trunk/main/var/pluginlist2fetch.xsl Thu Jun  9 17:08:55 2005
@@ -19,6 +19,7 @@
    <xsl:output method="xml" indent="yes" />
 
    <xsl:param name="plugin-name" />
+   <xsl:param name="plugin-version" />
    <xsl:param name="plugin-dir"/>
    <xsl:param name="forrest-version" />
 
@@ -29,15 +30,17 @@
          <target name="fetchplugin" depends="fetch-versioned-plugin, fetch-unversioned-plugin, final-check"/>
 
          <target name="fetch-versioned-plugin">
-            <echo>Trying to get "<xsl:value-of select="$plugin-name" />" plugin version 
-                  <xsl:value-of select="$forrest-version" />...</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" />-<xsl:value-of select="$forrest-version" />.zip</xsl:attribute>
-               <xsl:attribute name="dest"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
-            </get>
-            <available property="versioned-plugin.present">
-               <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
-            </available>
+            <xsl:if test="$plugin-version">
+              <echo>Trying to get "<xsl:value-of select="$plugin-name" />" plugin, version <xsl:value-of select="$plugin-version" />
+for Forrest version <xsl:value-of select="$forrest-version" />...</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="$forrest-version" />/<xsl:value-of select="$plugin-name" />-<xsl:value-of select="$plugin-version" />.zip</xsl:attribute>
+                 <xsl:attribute name="dest"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />-<xsl:value-of select="$plugin-version" />.zip</xsl:attribute>
+              </get>
+              <available property="versioned-plugin.present">
+                 <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />-<xsl:value-of select="$plugin-version" />.zip</xsl:attribute>
+              </available>
+            </xsl:if>
          </target>
 
          <target name="fetch-unversioned-plugin" unless="versioned-plugin.present">
@@ -49,12 +52,30 @@
          </target>
 
          <target name="final-check">
-            <available property="plugin.present">
-               <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
+            <available property="desired.plugin.present">
+              <xsl:choose>
+                <xsl:when test="$plugin-version">
+                  <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />-<xsl:value-of select="$plugin-version" />.zip</xsl:attribute>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
+                </xsl:otherwise>
+              </xsl:choose>
             </available>
-            <fail unless="plugin.present">
+            <if>
+              <isset property="desired.plugin.present"/>
+              <then>
+                <echo><xsl:value-of select="$plugin-name" /> downloaded, ready to install</echo>
+              </then>
+              <else>
+                <available property="unversioned.plugin.present">
+                  <xsl:attribute name="file"><xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" />.zip</xsl:attribute>
+                </available>
+                <fail unless="unversioned.plugin.present">
   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:
 
@@ -70,7 +91,10 @@
   <xsl:value-of select="plugin[@name=$plugin-name]/@url"/> and
   extract it into
   <xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name" /></fail>
-            <echo>Plugin "<xsl:value-of select="$plugin-name" />" correctly installed.</echo>
+                <echo>Desired version (<xsl:value-of select="$plugin-version" />) of <xsl:value-of select="$plugin-name" /> unavailable,
+  downloaded unversioned instead, ready to install</echo>
+              </else>
+            </if>
          </target>
       </project>
          </xsl:when>



Re: svn commit: r189864 - in /forrest/trunk/main: forrest.build.xml fresh-site/forrest.properties targets/plugins.xml var/pluginlist2fetch.xsl

Posted by Ross Gardler <rg...@apache.org>.
David Crossley wrote:
> Ross, this commit is not right. The property forrest.version is used
> at various places throughout the build. It needs to be "0.7-dev".
> During our etc/RELEASE_PROCESS.txt we tweak that to be "0.7", then
> tweak again after release to finally be "0.8-dev".

Yes, it was an accidental commit. I changed it locally to test the 
versioned plugin system and it was late when I committed the changes, 
couldn't be bothered waiting for the commit messages to come back so I 
didn't spot it till this morning. Sorry for the confusion.

(fixed now)

Ross


Re: svn commit: r189864 - in /forrest/trunk/main: forrest.build.xml fresh-site/forrest.properties targets/plugins.xml var/pluginlist2fetch.xsl

Posted by David Crossley <cr...@apache.org>.
Ross, this commit is not right. The property forrest.version is used
at various places throughout the build. It needs to be "0.7-dev".
During our etc/RELEASE_PROCESS.txt we tweak that to be "0.7", then
tweak again after release to finally be "0.8-dev".

Perhaps the plugin build system needs an additional property.

--David

> Author: rgardler
> Date: Thu Jun  9 17:08:55 2005
> New Revision: 189864
> 
> URL: http://svn.apache.org/viewcvs?rev=189864&view=rev
> Log:
> Add ability to specify a versioned plugin in forrest.properties. If the requested version is not available or none is specified then an unversioned plugin will be used, this version will be the latest published bersion and may be an in-development version.
> 
> Modified:
>     forrest/trunk/main/forrest.build.xml
>     forrest/trunk/main/fresh-site/forrest.properties
>     forrest/trunk/main/targets/plugins.xml
>     forrest/trunk/main/var/pluginlist2fetch.xsl
> 
> Modified: forrest/trunk/main/forrest.build.xml
> URL: http://svn.apache.org/viewcvs/forrest/trunk/main/forrest.build.xml?rev=189864&r1=189863&r2=189864&view=diff
> ==============================================================================
> --- forrest/trunk/main/forrest.build.xml (original)
> +++ forrest/trunk/main/forrest.build.xml Thu Jun  9 17:08:55 2005
> @@ -29,7 +29,7 @@
>  
>    <property environment="env" />
>    <property name="forrest.home"               location="${env.FORREST_HOME}" />
> -  <property name="forrest.version"            value="0.7-dev"/>
> +  <property name="forrest.version"            value="0.7"/>
>  
>    <property name="forrest.lib-dir"            location="${forrest.home}/lib"/>
>    <property name="forrest.core.lib-dir"       location="${forrest.lib-dir}/core"/>

[ snip ]