mcconnell    2003/08/23 10:08:51

  Modified:    merlin/merlin-plugin plugin.jelly
  Log:
  Improved code structure (eliminated duplicate content).
  
  Revision  Changes    Path
  1.24      +22 -94    avalon-sandbox/merlin/merlin-plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-plugin/plugin.jelly,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- plugin.jelly      23 Aug 2003 09:35:46 -0000      1.23
  +++ plugin.jelly      23 Aug 2003 17:08:51 -0000      1.24
  @@ -10,99 +10,44 @@
   
     <define:taglib uri="merlin">
       <define:jellybean
  -      name="test"
  +      name="kernel"
         className="org.apache.avalon.merlin.tools.MerlinBean"
  -      method="doExecute"
  -      />
  +      method="doExecute"/>
     </define:taglib>
   
     <goal name="merlin:deploy" 
  -    description="Deployment of a jar file containing a block.xml directive and 
execution of all components associated with a launch on startup policy.">
  -
  -    <echo>Merlin block deployment.</echo>
  -    <echo>From jar: ${maven.build.dir}/${maven.final.name}.jar</echo>
  -
  -    <!--
  -    Assign a value to the merlin.system.dir variable.  If the 
  -    value has already been defined this will fail and the prior
  -    defintion will hold.
  -    -->
  -    <ant:property environment="env"/>
  -    <j:set var="merlin.system" value="${basedir}"/>
  -    <j:set var="merlin.system.dir" value="${merlin.system}"/>
  -    <util:file var="sys" name="${merlin.system.dir}"/>
  -    <j:if test="${sys.exists()}">
  -      <j:set var="merlin.system" value="${merlin.system.dir}"/>
  -    </j:if>
  -
  -    <!--
  -    Set the repository path.
  -    -->
  -    <j:set var="merlin.repository.local" value="${maven.home.local}"/>
  -    <j:set var="merlin.repository.local" value="${maven.home}"/>
  -
  -    <!--
  -    If a kernel configuration has been declared the use it otherwise
  -    we default to the merlin installation kernel definition.
  -    -->
  -    <j:set var="merlin.kernel" value="${maven.conf.dir}/kernel.xml"/>
  -    <j:set var="merlin.kernel.config" value="${merlin.kernel}"/>
  -    <util:file var="kernelFile" name="${merlin.kernel.config}"/>
  -    <j:if test="${kernelFile.exists()}">
  -      <j:set var="merlin.kernel" value="${merlin.kernel.config}"/>
  -    </j:if>
  -
  -    <!-- 
  -    Declare the default configuration path which will be overriden
  -    if an merlin.block.config property is set and exists.
  -    -->
  -    <j:set var="merlin.config" value="${maven.conf.dir}/config.xml"/>
  -    <j:set var="merlin.block.config" value="${merlin.config}"/>
  -    <util:file var="configFile" name="${merlin.block.config}"/>
  -    <j:if test="${configFile.exists()}">
  -      <j:set var="merlin.config" value="${merlin.block.config}"/>
  -    </j:if>
  -
  -    <j:if test="${context.getVariable('merlin.debug') == null}">
  -      <j:set var="merlin.debug" value="false"/>
  -    </j:if>
  -    <j:if test="${context.getVariable('merlin.debug') != null}">
  -      <j:if test="${context.getVariable('merlin.debug') == 'true'}">
  -        <j:set var="merlin.debug" value="true"/>
  -      </j:if>
  -      <j:if test="${context.getVariable('merlin.debug') != 'true'}">
  -        <j:set var="merlin.debug" value="false"/>
  -      </j:if>
  +      description="Deployment from ${maven.build.dir}/${maven.final.name}.jar">
  +    <j:set var="merlin.target" value="${merlin.target}"/>
  +    <j:set var="merlin.target" value="${maven.build.dir}/${maven.final.name}.jar"/>
  +    <util:file var="target" name="${merlin.target}"/>
  +    <j:if test="${target.exists()}">
  +       <attainGoal name="merlin:execute"/>
       </j:if>
  +  </goal>
   
  -    <j:set var="wait" value="${merlin.kernel.wait}"/>
  -    <j:if test="${wait == null}">
  -      <j:set var="wait" value="1000"/>
  +  <goal name="merlin:simulate" 
  +      description="Simulated deployment from ${maven.build.dir}/classes">
  +    <j:set var="merlin.target" value="${maven.build.dir}/classes"/>
  +    <util:file var="target" name="${merlin.target}"/>
  +    <j:if test="${target.exists()}">
  +       <attainGoal name="merlin:execute"/>
       </j:if>
  +  </goal>
   
  -    <!--
  -    Launch Merlin with the supplied system, kernel, target and config
  -    paths and internal debug priority.
  -    -->
  -    <merlin:test 
  +  <goal name="merlin:execute" prereqs="merlin:prepare-context">
  +    <merlin:kernel 
         system="${merlin.system}"
         kernel="${merlin.kernel}" 
         repository="${merlin.repository.local}/repository" 
  -      home="${basedir}" 
  -      target="${maven.build.dir}/${maven.final.name}.jar" 
  +      home="${basedir}"
  +      target="${merlin.target}" 
         config="${merlin.config}" 
         debug="${merlin.debug}" 
         info="${merlin.info}" 
  -      wait="${wait}" 
  -    />
  -
  +      wait="${wait}"/>
     </goal>
   
  -  <goal name="merlin:simulate" 
  -    description="Simulate the deployment of a block based on a supplied block.xml
  -    directive and a base directory contining classes are related artifacts.">
  -
  -    <echo>Merlin simulated deployment.</echo>
  +  <goal name="merlin:prepare-context">
   
       <!--
       Assign a value to the merlin.system.dir variable.  If the 
  @@ -161,23 +106,6 @@
       <j:if test="${wait == null}">
         <j:set var="wait" value="1000"/>
       </j:if>
  -
  -    <!--
  -    Launch Merlin with the supplied system, kernel, target and config
  -    paths and internal debug priority.
  -    -->
  -    <merlin:test 
  -      system="${merlin.system}"
  -      kernel="${merlin.kernel}" 
  -      repository="${merlin.repository.local}/repository" 
  -      home="${basedir}" 
  -      target="${basedir}/target/classes" 
  -      config="${merlin.config}" 
  -      debug="${merlin.debug}" 
  -      info="${merlin.info}" 
  -      wait="${wait}" 
  -    />
  -
     </goal>
   
   </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to