Author: rgardler
Date: Wed Dec 14 12:03:34 2005
New Revision: 356840
URL: http://svn.apache.org/viewcvs?rev=356840&view=rev
Log:
A "half way" solution to using plugins in place. Note that if you modify your
plugin code you will still need to do "ant local-deploy" to see the changes.
This patch only ensures that the plugin is installed on the first run.
(partial solution for FOR-388)
Modified:
forrest/trunk/main/forrest.build.xml
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=356840&r1=356839&r2=356840&view=diff
==============================================================================
--- forrest/trunk/main/forrest.build.xml (original)
+++ forrest/trunk/main/forrest.build.xml Wed Dec 14 12:03:34 2005
@@ -45,6 +45,9 @@
<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"/>
Modified: forrest/trunk/main/targets/plugins.xml
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/targets/plugins.xml?rev=356840&r1=356839&r2=356840&view=diff
==============================================================================
--- forrest/trunk/main/targets/plugins.xml (original)
+++ forrest/trunk/main/targets/plugins.xml Wed Dec 14 12:03:34 2005
@@ -80,7 +80,10 @@
</antcall>
</then>
<else>
- <echo>
+ <if>
+ <not><available
file="${forrest.plugins-dir}/${plugin.name}"/></not>
+ <then>
+ <echo>
ERROR
=====
@@ -103,8 +106,10 @@
Note that once the plugins have been installed, they will not need
to be installed again unless you delete them or wish to upgrade them.
- </echo>
- <fail message="Unable to install required plugins. See error
messages above for more detail."/>
+ </echo>
+ <fail message="Unable to install required plugins. See error
messages above for more detail."/>
+ </then>
+ </if>
</else>
</if>
</else>
@@ -331,7 +336,9 @@
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="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="forrest-version" expression="${forrest.version}"/>
</xslt>
<ant antfile="${project.temp-dir}/pluginlist2fetchbuild.xml"/>
Modified: forrest/trunk/main/var/pluginlist2fetch.xsl
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/var/pluginlist2fetch.xsl?rev=356840&r1=356839&r2=356840&view=diff
==============================================================================
--- forrest/trunk/main/var/pluginlist2fetch.xsl (original)
+++ forrest/trunk/main/var/pluginlist2fetch.xsl Wed Dec 14 12:03:34 2005
@@ -21,6 +21,8 @@
<xsl:param name="plugin-name" />
<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">
@@ -43,16 +45,56 @@
</xsl:if>
</target>
- <target name="fetch-unversioned-plugin"
unless="versioned-plugin.present">
+ <target name="fetch-unversioned-plugin"
+ unless="versioned-plugin.present">
<echo>Versioned plugin unavailable, trying to get versionless
plugin...</echo>
- <get verbose="true" usetimestamp="true" ignoreerrors="true">
- <xsl:attribute name="src"><xsl:value-of select="[EMAIL
PROTECTED]/@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>
+
+ <echo>Looking in local plugins src...</echo>
+ <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-src-dir"/><xsl:value-of select="$plugin-name" /></xsl:attribute>
+ </fileset>
+ </copy>
+ <available property="plugin.src.present" type="dir">
+ <xsl:attribute name="file"><xsl:value-of
select="$plugin-dir"/><xsl:value-of select="$plugin-name" /></xsl:attribute>
+ </available>
+
+ <if>
+ <not><isset property="plugin.src.present"/></not>
+ <then>
+ <echo>Unable to find plugin src in trunk.</echo>
+ <echo>Looking in local whiteboard plugins src...</echo>
+ <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>
+ <available property="whiteboard.plugin.src.present"
type="dir">
+ <xsl:attribute name="file"><xsl:value-of
select="$plugin-dir"/><xsl:value-of select="$plugin-name" /></xsl:attribute>
+ </available>
+ </then>
+ </if>
+
+ <if>
+ <and>
+ <not><isset property="plugin.src.present"/></not>
+ <not><isset property="whiteboard.plugin.src.present"/></not>
+ </and>
+ <then>
+ <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="[EMAIL
PROTECTED]/@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>
+ </if>
</target>
<target name="final-check">
- <available property="desired.plugin.present">
+ <available property="desired.plugin.zip.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>
@@ -62,14 +104,15 @@
</xsl:otherwise>
</xsl:choose>
</available>
+
<if>
- <isset property="desired.plugin.present"/>
+ <isset property="desired.plugin.zip.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 property="unversioned.plugin.present" type="dir">
+ <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
@@ -91,8 +134,6 @@
<xsl:value-of select="[EMAIL PROTECTED]/@url"/> and
extract it into
<xsl:value-of select="$plugin-dir"/><xsl:value-of select="$plugin-name"
/></fail>
- <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>