vmassol     2004/06/12 07:15:14

  Modified:    abbot    plugin.jelly
  Log:
  Binary --> Ascii
  
  Revision  Changes    Path
  1.2       +365 -365  maven-plugins/abbot/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/abbot/plugin.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.jelly      12 Jun 2004 14:09:36 -0000      1.1
  +++ plugin.jelly      12 Jun 2004 14:15:14 -0000      1.2
  @@ -1,365 +1,365 @@
  -<?xml version="1.0"?>

  -

  -<!--

  -/* ====================================================================

  - *   Copyright 2004 The Apache Software Foundation.

  - *

  - *   Licensed under the Apache License, Version 2.0 (the "License");

  - *   you may not use this file except in compliance with the License.

  - *   You may obtain a copy of the License at

  - *

  - *       http://www.apache.org/licenses/LICENSE-2.0

  - *

  - *   Unless required by applicable law or agreed to in writing, software

  - *   distributed under the License is distributed on an "AS IS" BASIS,

  - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  - *   See the License for the specific language governing permissions and

  - *   limitations under the License.

  - * ====================================================================

  - */

  --->

  - 

  -<!--

  -   ========================================================================

  -     Abbot plugin. Abbot is a GUI testing framework for AWT/Swing 

  -     applications.

  -   ========================================================================

  --->

  -

  -<project

  -  xmlns:j="jelly:core"

  -  xmlns:m="jelly:maven"

  -  xmlns:x="jelly:xml"

  -  xmlns:u="jelly:util"

  -  xmlns:ant="jelly:ant"

  -  xmlns:doc="doc"

  -  xmlns:define="jelly:define"

  -  xmlns:jsl="jelly:jsl">

  -

  -  <!--

  -     ========================================================================

  -       Default goal. Execute the Abbot tests.

  -     ========================================================================

  -  -->

  -  <goal name="abbot" prereqs="abbot:test" description="Run the abbot tests"/>

  -  

  -

  -  <!--

  -     ========================================================================

  -       Execute the Abbot tests by running the application locally.

  -     ========================================================================

  -  -->

  -  <goal name="abbot:test" 

  -    
prereqs="abbot:check-env,abbot:prepare-filesystem,abbot:prepare-resources,java:compile,java:jar-resources"

  -    description="Run the abbot tests">

  -  

  -     <!-- Needed to define junit task -->

  -    <taskdef name="junit"

  -        classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">

  -      <classpath>

  -        <pathelement location="${plugin.getDependencyPath('junit:junit')}"/>

  -      </classpath>

  -    </taskdef>

  -    

  -    <!-- Just let JUnit execute the tests --> 

  -    <!-- IMPORTANT: We must fork the JUnit tests. Otherwise there are classpath

  -         problems (the version of xerces in the Maven root CL seems to be the 

  -         cause). -->

  -

  -    <junit printSummary="${maven.abbot.printSummary}"

  -        failureProperty="maven.test.failure" fork="true">

  -        

  -      <!-- Sys properties -->

  -      <setProperty name="dir" value="${maven.abbot.dir}" />

  -      <sysproperty key="maven.abbot.src.dir" value="${maven.abbot.src.dir}"/>

  -      <sysproperty key="basedir" value="${basedir}"/>

  -      <u:tokenize var="listOfProperties" delim=" 
">${maven.abbot.sysproperties}</u:tokenize>

  -      <j:forEach var="someProperty" items="${listOfProperties}">

  -        <sysproperty key="${someProperty}" 
value="${context.getVariable(someProperty)}"/>

  -      </j:forEach>

  -        

  -      <!-- JVM args -->

  -      <u:tokenize var="listOfJvmArgs" delim=" ">${maven.abbot.jvmargs}</u:tokenize>

  -      <j:forEach var="somejvmarg" items="${listOfJvmArgs}">

  -        <jvmarg value="${somejvmarg}"/>

  -      </j:forEach>

  -        

  -      <!-- File format of test reports are defined here -->

  -      <formatter type="xml"/>

  -      <formatter type="${maven.abbot.format}" usefile="${maven.abbot.usefile}"/>

  -                                              

  -      <!-- Classpath -->

  -      <classpath>

  -        <pathelement location="${plugin.dir}"/>

  -        <pathelement location="${maven.build.dest}"/>

  -        <pathelement location="${maven.test.dest}"/>

  -        <j:forEach var="dep" items="${plugin.getDependencies()}">

  -          <j:if test="${dep.getProperty('abbot.webstart')}">

  -                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>

  -                   </j:if>

  -                             </j:forEach>

  -                             <j:forEach var="lib" items="${pom.dependencies}">

  -                               <j:set var="libFullName" value="${lib.getId()}" />

  -          <j:set var="jarPath" 
value="${maven.repo.local}/${lib.artifactDirectory}/${lib.getType()}s/${lib.getArtifact()}"
 />

  -          <pathelement path="${jarPath}"/>

  -                             </j:forEach>

  -      </classpath>

  -        

  -      <test name="${maven.abbot.include}" todir="${maven.abbot.reports.dir}"/>

  -        

  -   </junit>

  -   

  -   <!-- Junit exit status is stored in maven.test.failure. Whenever it is true

  -        (and ignore flag is not) we must stop the build process -->

  -   <j:if test="${maven.test.failure}">

  -     <j:if test="${context.getVariable('maven.test.failure.ignore') != null}">

  -       <fail message="There were test failures"/>

  -     </j:if>

  -   </j:if>

  - 

  -  </goal> 

  -  

  -  <!--

  -     ========================================================================

  -       Launch tests on a webstart application

  -     ========================================================================

  -  -->   

  -  <goal name="abbot:test-webstart" 
prereqs="abbot:check-webstart-env,abbot:prepare-filesystem"

  -      description="Launch tests on a webstart application">

  -           

  -     <!-- First we get the remote jnlp -->

  -     <get src="${maven.abbot.remotejnlp}"

  -        dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>

  -     

  -    <!-- We make a jar with compiled main class -->

  -    <!-- TODO: create this as part of the plugin creation and not as part of

  -         its execution -->

  -     <jar destfile="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}" 

  -         basedir="${plugin.dir}" includes="**/*.class"/>

  -    

  -    <!-- Iterating through dependencies, and signing them if they're not up-to-date 
-->

  -    <j:if test="${context.getVariable('maven.abbot.sign')}">

  -      

  -      <j:forEach var="dep" items="${plugin.getDependencies()}">

  -        <j:if test="${dep.getProperty('abbot.webstart')}">   

  -          

  -          <j:set var="filename" value="${dep.GroupId}-${dep.ArtifactId}"/>

  -          <j:set var="varname" value="abbot.signing.notrequired.${dep.id}"/>    

  -          

  -          <!-- Checking whether or not the dependency has to be signed -->

  -          <uptodate property="${varname}"

  -                srcfile="${plugin.getDependencyPath(dep.Id)}"

  -                targetfile="${maven.abbot.dest.dir}/${filename}.jar"/>

  -          

  -          <!-- Keeping this debug trace a while to ensure that the up-to-date 
feature is working properly -->

  -          <echo level="debug">${dep.id} is uptodate ? 
${context.getVariable(varname) == true}</echo>

  -          

  -          <!-- Signing the dependancy only if it is not up-to-date or forced-->

  -          <j:if test="${(context.getVariable(varname) != true)}">

  -            

  -            <!-- Unsigning -->

  -            <zip destfile="${maven.abbot.dest.dir}/${filename}.jar">

  -              <zipfileset src="${plugin.getDependencyPath(dep.id)}"

  -                  excludes="**/*.SF **/*.RSA **/*.DSA"/>

  -            </zip> 

  -            

  -            <!-- Signing -->

  -            <signjar jar="${maven.abbot.dest.dir}/${filename}.jar" 

  -               keystore="${maven.abbot.sign.keystore}"

  -               alias="${maven.abbot.sign.alias}" 

  -               storepass="${maven.abbot.sign.storepass}"/>

  -          </j:if>

  -          

  -        </j:if>

  -      </j:forEach>

  -      <!-- Jar containing abbot main class is signed -->

  -      <signjar jar="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}" 

  -        keystore="${maven.abbot.sign.keystore}"

  -        alias="${maven.abbot.sign.alias}" 

  -        storepass="${maven.abbot.sign.storepass}"/>

  -     </j:if>

  -             

  -     

  -    <!-- Jnlp is modified so that local abbot libraries are referenced -->

  -    <doc:jsl

  -        input="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"

  -        output="${maven.abbot.webstart.jnlp.modified}"

  -        outputDirectory="${maven.abbot.dest.dir}"

  -        stylesheet="${plugin.resources}/jnlp.jsl"

  -        outputMode="xml"

  -        prettyPrint="true"/>

  -     

  -     <!-- Java webstart is launched on local modified jnlp -->

  -     <java classname="com.sun.javaws.Main" fork="true" failonerror="true">

  -      <classpath>

  -        <pathelement location="${env.JAVAWS_HOME}/javaws-l10n.jar"/>

  -        <pathelement location="${env.JAVAWS_HOME}/javaws.jar"/>

  -      </classpath>

  -      <jvmarg value="-Djnlpx.home=${env.JAVAWS_HOME}"/>

  -       <jvmarg value="-Djnlpx.heapsize=NULL,NULL"/>

  -       <jvmarg value="-Djnlpx.jvm=${env.JAVA_HOME}/bin/javaw.exe"/>

  -       <jvmarg 
value="-Djnlpx.deployment.system.home=${maven.abbot.javaws.systemhome}"/>

  -       <jvmarg value="-Djnlpx.deployment.user.home=${maven.abbot.javaws.userhome}"/>

  -       <jvmarg value="-Djava.security.policy=${env.JAVAWS_HOME}/javaws.policy"/>

  -       <jvmarg value="-DtrustProxy=true"/>

  -       <arg value="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.modified}"/>

  -     </java>

  -

  -  </goal>

  -  

  -  

  -  <!--

  -     ========================================================================

  -       Launch Abbot costello editor

  -     ========================================================================

  -  --> 

  -  <goal name="abbot:editor"  prereqs="abbot:check-env,abbot:prepare-filesystem" 

  -                     description="Launch Abbot costello editor">

  -     

  -     <!-- Launching abbot editor with abbot and jnlp dependencies as classpath --> 

  -    <java classname="abbot.editor.ScriptEditor" fork="true">

  -      <classpath>

  -             <!-- Abbot editor dependencies -->

  -        <j:forEach var="dep" items="${plugin.getDependencies()}">

  -                     <j:if test="${dep.getProperty('abbot.editor')}">

  -                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>

  -                   </j:if>

  -                             </j:forEach>

  -        <path refid="maven.dependency.classpath"/>

  -      </classpath>

  -     </java>

  -  

  -  </goal>

  - 

  -  

  -  <!--

  -     ========================================================================

  -       Launch Abbot costello editor on a webstart application

  -     ========================================================================

  -  --> 

  -  <goal name="abbot:editor-webstart"

  -      prereqs="abbot:check-webstart-env,abbot:prepare-filesystem" 

  -      description="Launch Abbot costello editor on a webstart application">

  -                     

  -    <!-- First we get the remote jnlp -->

  -     <get src="${maven.abbot.remotejnlp}"

  -        dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>      
         

  -                     

  -     <!-- Parsing jnlp file in order to copy all dependencies into local directory 
-->

  -     <u:file var="inputFile" 
name="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>

  -     <x:parse var="parsedfile" xml="${inputFile}"/>          

  -     <x:set var="codebasename" select="string($parsedfile/jnlp/@codebase)"/>

  -     <x:forEach var="jar" select="$parsedfile/jnlp/resources/jar">

  -      <x:set var="jarname" select="string($jar/@href)"/>

  -      <get src="${codebasename}/${jarname}" usetimestamp="true"

  -          dest="${maven.abbot.dest.dir}/${jarname}"/>

  -     </x:forEach>

  -     

  -     <!-- Launching abbot editor with abbot and jnlp dependencies as classpath --> 

  -    <java classname="abbot.editor.ScriptEditor" fork="true">

  -      <classpath>

  -             <!-- Abbot editor dependencies -->

  -        <j:forEach var="dep" items="${plugin.getDependencies()}">

  -                     <j:if test="${dep.getProperty('abbot.editor')}">

  -                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>

  -                   </j:if>

  -                             </j:forEach>

  -                             

  -                             <!-- Remote application dependencies -->

  -                             <x:forEach var="jar" 
select="$parsedfile/jnlp/resources/jar">

  -                                     <x:set var="jarname" 
select="string($jar/@href)"/>

  -                                     <pathelement 
path="${maven.abbot.dest.dir}/${jarname}"/>

  -                             </x:forEach>

  -      </classpath>

  -     </java>

  -  

  -  </goal>

  -  

  -  <!--

  -     ========================================================================

  -       Copy test resources to test directory (internal goal)

  -     ========================================================================

  -  -->

  -  <goal name="abbot:prepare-resources" prereqs="abbot:prepare-filesystem">

  -

  -    <j:if test="${pom.build.unitTest != null}">

  -      <j:if test="${!pom.build.unitTest.resources.isEmpty()}">

  -        <m:copy-resources

  -            resources="${pom.build.unitTest.resources}"

  -            todir="${maven.test.dest}"/>

  -      </j:if>

  -    </j:if>

  -    

  -  </goal>

  -  

  -  <!--

  -     ========================================================================

  -       Create needed directories (internal goal)

  -     ========================================================================

  -  -->  

  -  <goal name="abbot:prepare-filesystem">

  -

  -     <mkdir dir="${maven.test.dest}"/>

  -    <mkdir dir="${maven.abbot.reports.dir}"/>

  -    <mkdir dir="${maven.abbot.dest.dir}"/>

  -

  -  </goal>  

  -

  -  <!--

  -     ========================================================================

  -       Checking environment (internal goal)

  -     ========================================================================

  -  -->    

  -  <goal name="abbot:check-env">

  -

  -    <j:if test="${context.getVariable('java.awt.headless') == true}">

  -      <fail message="Abbot plugin cannot be used in awt headless environment"/>

  -    </j:if>

  -

  -  </goal>

  -  

  -  <!--

  -     ========================================================================

  -       Checking webstart environment (internal goal)

  -     ========================================================================

  -  -->    

  -  <goal name="abbot:check-webstart-env" prereqs="abbot:check-env">

  -

  -    <property environment="env"/>    

  -

  -    <j:if test="${context.getVariable('env.JAVAWS_HOME') == null}">

  -      <fail>Mandatory environment variable JAVAWS_HOME must be set</fail>

  -    </j:if>

  -   

  -    <j:if test="${context.getVariable('maven.abbot.sign') == false}">

  -      <fail>In the current version the Abbot plugin only works when signing 
jars</fail>

  -    </j:if>

  -    

  -    <j:if test="${context.getVariable('maven.abbot.remotejnlp') == null}">

  -      <fail>Mandatory variable maven.abbot.remotejnlp is missing."</fail>

  -    </j:if>

  -    

  -    <j:if test="${context.getVariable('maven.abbot.javaws.systemhome') == null}">

  -      <fail>Mandatory variable maven.abbot.javaws.systemhome is missing"</fail>

  -    </j:if>

  -    

  -    <j:if test="${context.getVariable('maven.abbot.javaws.userhome') == null}">

  -      <fail>Mandatory variable maven.abbot.javaws.userhome is missing</fail>

  -    </j:if>

  -

  -  </goal>

  -

  -  <!--

  -     ========================================================================

  -       Dependency handle so that other plugins can load this plugin and its

  -       properties. This is especially useful if another plugin needs to 

  -       modify one property of the Abbot plugin.

  -     ========================================================================

  -  -->    

  -  <define:taglib uri="abbot">

  -    <define:tag name="dependency-handle">

  -      <!-- Use this tag to allow this plugin to be loaded into another -->

  -    </define:tag>

  -  </define:taglib>

  -  

  -</project>

  +<?xml version="1.0"?>
  +
  +<!--
  +/* ====================================================================
  + *   Copyright 2004 The Apache Software Foundation.
  + *
  + *   Licensed under the Apache License, Version 2.0 (the "License");
  + *   you may not use this file except in compliance with the License.
  + *   You may obtain a copy of the License at
  + *
  + *       http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *   Unless required by applicable law or agreed to in writing, software
  + *   distributed under the License is distributed on an "AS IS" BASIS,
  + *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *   See the License for the specific language governing permissions and
  + *   limitations under the License.
  + * ====================================================================
  + */
  +-->
  + 
  +<!--
  +   ========================================================================
  +     Abbot plugin. Abbot is a GUI testing framework for AWT/Swing 
  +     applications.
  +   ========================================================================
  +-->
  +
  +<project
  +  xmlns:j="jelly:core"
  +  xmlns:m="jelly:maven"
  +  xmlns:x="jelly:xml"
  +  xmlns:u="jelly:util"
  +  xmlns:ant="jelly:ant"
  +  xmlns:doc="doc"
  +  xmlns:define="jelly:define"
  +  xmlns:jsl="jelly:jsl">
  +
  +  <!--
  +     ========================================================================
  +       Default goal. Execute the Abbot tests.
  +     ========================================================================
  +  -->
  +  <goal name="abbot" prereqs="abbot:test" description="Run the abbot tests"/>
  +  
  +
  +  <!--
  +     ========================================================================
  +       Execute the Abbot tests by running the application locally.
  +     ========================================================================
  +  -->
  +  <goal name="abbot:test" 
  +    
prereqs="abbot:check-env,abbot:prepare-filesystem,abbot:prepare-resources,java:compile,java:jar-resources"
  +    description="Run the abbot tests">
  +  
  +     <!-- Needed to define junit task -->
  +    <taskdef name="junit"
  +        classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
  +      <classpath>
  +        <pathelement location="${plugin.getDependencyPath('junit:junit')}"/>
  +      </classpath>
  +    </taskdef>
  +    
  +    <!-- Just let JUnit execute the tests --> 
  +    <!-- IMPORTANT: We must fork the JUnit tests. Otherwise there are classpath
  +         problems (the version of xerces in the Maven root CL seems to be the 
  +         cause). -->
  +
  +    <junit printSummary="${maven.abbot.printSummary}"
  +        failureProperty="maven.test.failure" fork="true">
  +        
  +      <!-- Sys properties -->
  +      <setProperty name="dir" value="${maven.abbot.dir}" />
  +      <sysproperty key="maven.abbot.src.dir" value="${maven.abbot.src.dir}"/>
  +      <sysproperty key="basedir" value="${basedir}"/>
  +      <u:tokenize var="listOfProperties" delim=" 
">${maven.abbot.sysproperties}</u:tokenize>
  +      <j:forEach var="someProperty" items="${listOfProperties}">
  +        <sysproperty key="${someProperty}" 
value="${context.getVariable(someProperty)}"/>
  +      </j:forEach>
  +        
  +      <!-- JVM args -->
  +      <u:tokenize var="listOfJvmArgs" delim=" ">${maven.abbot.jvmargs}</u:tokenize>
  +      <j:forEach var="somejvmarg" items="${listOfJvmArgs}">
  +        <jvmarg value="${somejvmarg}"/>
  +      </j:forEach>
  +        
  +      <!-- File format of test reports are defined here -->
  +      <formatter type="xml"/>
  +      <formatter type="${maven.abbot.format}" usefile="${maven.abbot.usefile}"/>
  +                                              
  +      <!-- Classpath -->
  +      <classpath>
  +        <pathelement location="${plugin.dir}"/>
  +        <pathelement location="${maven.build.dest}"/>
  +        <pathelement location="${maven.test.dest}"/>
  +        <j:forEach var="dep" items="${plugin.getDependencies()}">
  +          <j:if test="${dep.getProperty('abbot.webstart')}">
  +                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
  +                   </j:if>
  +                             </j:forEach>
  +                             <j:forEach var="lib" items="${pom.dependencies}">
  +                               <j:set var="libFullName" value="${lib.getId()}" />
  +          <j:set var="jarPath" 
value="${maven.repo.local}/${lib.artifactDirectory}/${lib.getType()}s/${lib.getArtifact()}"
 />
  +          <pathelement path="${jarPath}"/>
  +                             </j:forEach>
  +      </classpath>
  +        
  +      <test name="${maven.abbot.include}" todir="${maven.abbot.reports.dir}"/>
  +        
  +   </junit>
  +   
  +   <!-- Junit exit status is stored in maven.test.failure. Whenever it is true
  +        (and ignore flag is not) we must stop the build process -->
  +   <j:if test="${maven.test.failure}">
  +     <j:if test="${context.getVariable('maven.test.failure.ignore') != null}">
  +       <fail message="There were test failures"/>
  +     </j:if>
  +   </j:if>
  + 
  +  </goal> 
  +  
  +  <!--
  +     ========================================================================
  +       Launch tests on a webstart application
  +     ========================================================================
  +  -->   
  +  <goal name="abbot:test-webstart" 
prereqs="abbot:check-webstart-env,abbot:prepare-filesystem"
  +      description="Launch tests on a webstart application">
  +           
  +     <!-- First we get the remote jnlp -->
  +     <get src="${maven.abbot.remotejnlp}"
  +        dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>
  +     
  +    <!-- We make a jar with compiled main class -->
  +    <!-- TODO: create this as part of the plugin creation and not as part of
  +         its execution -->
  +     <jar destfile="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}" 
  +         basedir="${plugin.dir}" includes="**/*.class"/>
  +    
  +    <!-- Iterating through dependencies, and signing them if they're not up-to-date 
-->
  +    <j:if test="${context.getVariable('maven.abbot.sign')}">
  +      
  +      <j:forEach var="dep" items="${plugin.getDependencies()}">
  +        <j:if test="${dep.getProperty('abbot.webstart')}">   
  +          
  +          <j:set var="filename" value="${dep.GroupId}-${dep.ArtifactId}"/>
  +          <j:set var="varname" value="abbot.signing.notrequired.${dep.id}"/>    
  +          
  +          <!-- Checking whether or not the dependency has to be signed -->
  +          <uptodate property="${varname}"
  +                srcfile="${plugin.getDependencyPath(dep.Id)}"
  +                targetfile="${maven.abbot.dest.dir}/${filename}.jar"/>
  +          
  +          <!-- Keeping this debug trace a while to ensure that the up-to-date 
feature is working properly -->
  +          <echo level="debug">${dep.id} is uptodate ? 
${context.getVariable(varname) == true}</echo>
  +          
  +          <!-- Signing the dependancy only if it is not up-to-date or forced-->
  +          <j:if test="${(context.getVariable(varname) != true)}">
  +            
  +            <!-- Unsigning -->
  +            <zip destfile="${maven.abbot.dest.dir}/${filename}.jar">
  +              <zipfileset src="${plugin.getDependencyPath(dep.id)}"
  +                  excludes="**/*.SF **/*.RSA **/*.DSA"/>
  +            </zip> 
  +            
  +            <!-- Signing -->
  +            <signjar jar="${maven.abbot.dest.dir}/${filename}.jar" 
  +               keystore="${maven.abbot.sign.keystore}"
  +               alias="${maven.abbot.sign.alias}" 
  +               storepass="${maven.abbot.sign.storepass}"/>
  +          </j:if>
  +          
  +        </j:if>
  +      </j:forEach>
  +      <!-- Jar containing abbot main class is signed -->
  +      <signjar jar="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}" 
  +        keystore="${maven.abbot.sign.keystore}"
  +        alias="${maven.abbot.sign.alias}" 
  +        storepass="${maven.abbot.sign.storepass}"/>
  +     </j:if>
  +             
  +     
  +    <!-- Jnlp is modified so that local abbot libraries are referenced -->
  +    <doc:jsl
  +        input="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"
  +        output="${maven.abbot.webstart.jnlp.modified}"
  +        outputDirectory="${maven.abbot.dest.dir}"
  +        stylesheet="${plugin.resources}/jnlp.jsl"
  +        outputMode="xml"
  +        prettyPrint="true"/>
  +     
  +     <!-- Java webstart is launched on local modified jnlp -->
  +     <java classname="com.sun.javaws.Main" fork="true" failonerror="true">
  +      <classpath>
  +        <pathelement location="${env.JAVAWS_HOME}/javaws-l10n.jar"/>
  +        <pathelement location="${env.JAVAWS_HOME}/javaws.jar"/>
  +      </classpath>
  +      <jvmarg value="-Djnlpx.home=${env.JAVAWS_HOME}"/>
  +       <jvmarg value="-Djnlpx.heapsize=NULL,NULL"/>
  +       <jvmarg value="-Djnlpx.jvm=${env.JAVA_HOME}/bin/javaw.exe"/>
  +       <jvmarg 
value="-Djnlpx.deployment.system.home=${maven.abbot.javaws.systemhome}"/>
  +       <jvmarg value="-Djnlpx.deployment.user.home=${maven.abbot.javaws.userhome}"/>
  +       <jvmarg value="-Djava.security.policy=${env.JAVAWS_HOME}/javaws.policy"/>
  +       <jvmarg value="-DtrustProxy=true"/>
  +       <arg value="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.modified}"/>
  +     </java>
  +
  +  </goal>
  +  
  +  
  +  <!--
  +     ========================================================================
  +       Launch Abbot costello editor
  +     ========================================================================
  +  --> 
  +  <goal name="abbot:editor"  prereqs="abbot:check-env,abbot:prepare-filesystem" 
  +                     description="Launch Abbot costello editor">
  +     
  +     <!-- Launching abbot editor with abbot and jnlp dependencies as classpath --> 
  +    <java classname="abbot.editor.ScriptEditor" fork="true">
  +      <classpath>
  +             <!-- Abbot editor dependencies -->
  +        <j:forEach var="dep" items="${plugin.getDependencies()}">
  +                     <j:if test="${dep.getProperty('abbot.editor')}">
  +                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
  +                   </j:if>
  +                             </j:forEach>
  +        <path refid="maven.dependency.classpath"/>
  +      </classpath>
  +     </java>
  +  
  +  </goal>
  + 
  +  
  +  <!--
  +     ========================================================================
  +       Launch Abbot costello editor on a webstart application
  +     ========================================================================
  +  --> 
  +  <goal name="abbot:editor-webstart"
  +      prereqs="abbot:check-webstart-env,abbot:prepare-filesystem" 
  +      description="Launch Abbot costello editor on a webstart application">
  +                     
  +    <!-- First we get the remote jnlp -->
  +     <get src="${maven.abbot.remotejnlp}"
  +        dest="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>      
         
  +                     
  +     <!-- Parsing jnlp file in order to copy all dependencies into local directory 
-->
  +     <u:file var="inputFile" 
name="${maven.abbot.dest.dir}/${maven.abbot.webstart.jnlp.original}"/>
  +     <x:parse var="parsedfile" xml="${inputFile}"/>          
  +     <x:set var="codebasename" select="string($parsedfile/jnlp/@codebase)"/>
  +     <x:forEach var="jar" select="$parsedfile/jnlp/resources/jar">
  +      <x:set var="jarname" select="string($jar/@href)"/>
  +      <get src="${codebasename}/${jarname}" usetimestamp="true"
  +          dest="${maven.abbot.dest.dir}/${jarname}"/>
  +     </x:forEach>
  +     
  +     <!-- Launching abbot editor with abbot and jnlp dependencies as classpath --> 
  +    <java classname="abbot.editor.ScriptEditor" fork="true">
  +      <classpath>
  +             <!-- Abbot editor dependencies -->
  +        <j:forEach var="dep" items="${plugin.getDependencies()}">
  +                     <j:if test="${dep.getProperty('abbot.editor')}">
  +                    <pathelement path="${plugin.getDependencyPath(dep.Id)}"/>
  +                   </j:if>
  +                             </j:forEach>
  +                             
  +                             <!-- Remote application dependencies -->
  +                             <x:forEach var="jar" 
select="$parsedfile/jnlp/resources/jar">
  +                                     <x:set var="jarname" 
select="string($jar/@href)"/>
  +                                     <pathelement 
path="${maven.abbot.dest.dir}/${jarname}"/>
  +                             </x:forEach>
  +      </classpath>
  +     </java>
  +  
  +  </goal>
  +  
  +  <!--
  +     ========================================================================
  +       Copy test resources to test directory (internal goal)
  +     ========================================================================
  +  -->
  +  <goal name="abbot:prepare-resources" prereqs="abbot:prepare-filesystem">
  +
  +    <j:if test="${pom.build.unitTest != null}">
  +      <j:if test="${!pom.build.unitTest.resources.isEmpty()}">
  +        <m:copy-resources
  +            resources="${pom.build.unitTest.resources}"
  +            todir="${maven.test.dest}"/>
  +      </j:if>
  +    </j:if>
  +    
  +  </goal>
  +  
  +  <!--
  +     ========================================================================
  +       Create needed directories (internal goal)
  +     ========================================================================
  +  -->  
  +  <goal name="abbot:prepare-filesystem">
  +
  +     <mkdir dir="${maven.test.dest}"/>
  +    <mkdir dir="${maven.abbot.reports.dir}"/>
  +    <mkdir dir="${maven.abbot.dest.dir}"/>
  +
  +  </goal>  
  +
  +  <!--
  +     ========================================================================
  +       Checking environment (internal goal)
  +     ========================================================================
  +  -->    
  +  <goal name="abbot:check-env">
  +
  +    <j:if test="${context.getVariable('java.awt.headless') == true}">
  +      <fail message="Abbot plugin cannot be used in awt headless environment"/>
  +    </j:if>
  +
  +  </goal>
  +  
  +  <!--
  +     ========================================================================
  +       Checking webstart environment (internal goal)
  +     ========================================================================
  +  -->    
  +  <goal name="abbot:check-webstart-env" prereqs="abbot:check-env">
  +
  +    <property environment="env"/>    
  +
  +    <j:if test="${context.getVariable('env.JAVAWS_HOME') == null}">
  +      <fail>Mandatory environment variable JAVAWS_HOME must be set</fail>
  +    </j:if>
  +   
  +    <j:if test="${context.getVariable('maven.abbot.sign') == false}">
  +      <fail>In the current version the Abbot plugin only works when signing 
jars</fail>
  +    </j:if>
  +    
  +    <j:if test="${context.getVariable('maven.abbot.remotejnlp') == null}">
  +      <fail>Mandatory variable maven.abbot.remotejnlp is missing."</fail>
  +    </j:if>
  +    
  +    <j:if test="${context.getVariable('maven.abbot.javaws.systemhome') == null}">
  +      <fail>Mandatory variable maven.abbot.javaws.systemhome is missing"</fail>
  +    </j:if>
  +    
  +    <j:if test="${context.getVariable('maven.abbot.javaws.userhome') == null}">
  +      <fail>Mandatory variable maven.abbot.javaws.userhome is missing</fail>
  +    </j:if>
  +
  +  </goal>
  +
  +  <!--
  +     ========================================================================
  +       Dependency handle so that other plugins can load this plugin and its
  +       properties. This is especially useful if another plugin needs to 
  +       modify one property of the Abbot plugin.
  +     ========================================================================
  +  -->    
  +  <define:taglib uri="abbot">
  +    <define:tag name="dependency-handle">
  +      <!-- Use this tag to allow this plugin to be loaded into another -->
  +    </define:tag>
  +  </define:taglib>
  +  
  +</project>
  
  
  

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

Reply via email to