commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz CallTargetTag.java PostTargetTag.java ProjectTag.java TargetTag.java WerkzTagSupport.java
Date Wed, 12 Jun 2002 04:32:28 GMT
werken      2002/06/11 21:32:28

  Modified:    jelly    build.xml project.xml
               jelly/src/java/org/apache/commons/jelly/tags/werkz
                        CallTargetTag.java PostTargetTag.java
                        ProjectTag.java TargetTag.java WerkzTagSupport.java
  Log:
  Jelly now references latest werkz.
  
  Attempted (but pretty much failed) to fix the demo.werkz target.
  Added demo.werkz2 target and a demo.werkz2.callback target
  which is a post-compile-callback.  This is exactly why maven-ng
  is needed.
  
  Revision  Changes    Path
  1.41      +28 -2     jakarta-commons-sandbox/jelly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/build.xml,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- build.xml	11 Jun 2002 21:41:11 -0000	1.40
  +++ build.xml	12 Jun 2002 04:32:27 -0000	1.41
  @@ -14,6 +14,14 @@
     <!-- Set default values for the build -->
     <property file="project.properties" />
     
  +  <path id="test.classpath">
  +    <pathelement path="${maven.build.dest}"/>
  +    <pathelement path="${basedir}"/>
  +    <path refid="maven.dependency.classpath"/>
  +    <pathelement location="${lib.repo}/xmlParserAPIs-2.0.0.jar"/>
  +    <pathelement location="${lib.repo}/xercesImpl-2.0.0.jar"/>
  +  </path>
  +
     <!-- maven:start -->
     
     <!-- ================================================================== -->
  @@ -181,13 +189,16 @@
   	</target>
   	
   	<target name="compile" depends="maven:compile, maven:jar-resources">
  -	
  +
  +        <path refid="test.classpath"/>
  +<!--	
   	  <path id="test.classpath">
   	    <pathelement path="${maven.build.dest}"/>
           <path refid="maven.dependency.classpath"/>
           <pathelement location="${lib.repo}/xmlParserAPIs-2.0.0.jar"/>
           <pathelement location="${lib.repo}/xercesImpl-2.0.0.jar"/>
   	  </path>
  +-->
   	  
         <taskdef
           name="jelly"
  @@ -324,7 +335,22 @@
   	
      </target>
   
  -   <target name="demo.werkz" depends="compile" 
  +   <target name="demo.werkz2">
  +     <property name="maven.core.callback.post-compile.buildFile" value="build.xml"/>
  +     <property name="maven.core.callback.post-compile.buildTarget" value="demo.werkz2.callback"/>
  +     <maven-ant antfile="${maven.home}/plugins/core/build.xml" target="compile"/>
  +   </target>
  +
  +   <target name="demo.werkz2.callback">
  +    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <arg value="src/test/org/apache/commons/jelly/werkz/example.jelly"/> 
  +      <arg value="compile"/> 
  +      <arg value="test"/> 
  +    </java>
  +   </target>
  +
  +   <target name="demo.werkz" depends="maven:compile" 
         description="Runs a Werkz sample">
       <java classname="org.apache.commons.jelly.Jelly" fork="yes">
         <classpath refid="test.classpath"/>
  
  
  
  1.13      +13 -1     jakarta-commons-sandbox/jelly/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/project.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- project.xml	11 Jun 2002 21:41:11 -0000	1.12
  +++ project.xml	12 Jun 2002 04:32:28 -0000	1.13
  @@ -61,7 +61,13 @@
         <name>Geir Magnusson Jr.</name>
         <id>geirm</id>
         <email>geirm@adeptra.com</email>
  -      <organization>Adeptra , Inc.</organization>
  +      <organization>Adeptra, Inc.</organization>
  +    </developer>
  +    <developer>
  +      <name>Bob McWhirter</name>
  +      <id>werken</id>
  +      <email>bob@eng.werken.com</email>
  +      <organization>The Werken Company</organization>
       </developer>
       
       <developer>
  @@ -77,6 +83,12 @@
     </developers>
   
     <dependencies>
  +<!--
  +    <dependency>
  +      <id>junit</id>
  +      <version>3.7</version>
  +    </dependency>
  +-->
       <dependency>
         <name>commons-logging</name>
         <type>required</type>
  
  
  
  1.2       +3 -1      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/CallTargetTag.java
  
  Index: CallTargetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/CallTargetTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CallTargetTag.java	11 Jun 2002 21:41:11 -0000	1.1
  +++ CallTargetTag.java	12 Jun 2002 04:32:28 -0000	1.2
  @@ -94,7 +94,9 @@
           log.debug( "Trying to invoke target: " + name );
           
           // attain the goal and throw up any exception to be caught by parent tags     
  
  -        getGoal(name).attain();
  +        // getGoal(name).attain();
  +
  +        getProject().attainGoal(name);
       }
   
       
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostTargetTag.java
  
  Index: PostTargetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostTargetTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PostTargetTag.java	11 Jun 2002 21:41:11 -0000	1.1
  +++ PostTargetTag.java	12 Jun 2002 04:32:28 -0000	1.2
  @@ -59,7 +59,7 @@
   package org.apache.commons.jelly.tags.werkz;
   
   import com.werken.werkz.Goal;
  -import com.werken.werkz.PreGoalCallback;
  +import com.werken.werkz.PostGoalCallback;
   
   import org.apache.commons.jelly.JellyException;
   import org.apache.commons.jelly.XMLOutput;
  @@ -90,8 +90,8 @@
       public void doTag(final XMLOutput output) throws Exception {
           
           getGoal(getName()).addPostGoalCallback(
  -            new PreGoalCallback() {
  -                public void firePreGoal(Goal goal) throws Exception {
  +            new PostGoalCallback() {
  +                public void firePostGoal(Goal goal) throws Exception {
                       // lets run the body
                       log.info( "Running post target: " + getName() );
                       getBody().run( context, output);                                  
     
  
  
  
  1.2       +4 -4      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/ProjectTag.java
  
  Index: ProjectTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/ProjectTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectTag.java	11 Jun 2002 21:41:11 -0000	1.1
  +++ ProjectTag.java	12 Jun 2002 04:32:28 -0000	1.2
  @@ -58,7 +58,7 @@
   
   package org.apache.commons.jelly.tags.werkz;
   
  -import com.werken.werkz.Werkz;
  +import com.werken.werkz.Project;
   
   import java.util.Iterator;
   import java.util.List;
  @@ -77,7 +77,7 @@
   public class ProjectTag extends TagSupport {
   
       /** the project */
  -    private Werkz project = new Werkz();
  +    private Project project = new Project();
           
       public ProjectTag() {
       }
  @@ -86,7 +86,7 @@
       /**
        * @return the project instance 
        */
  -    public Werkz getProject() {
  +    public Project getProject() {
           return project;
       }
       
  @@ -99,7 +99,7 @@
        * then run all the current targets
        */
       public void doTag(XMLOutput output) throws Exception {
  -        project.clear();
  +        // project.clear();
   
           context.setVariable( "org.apache.commons.jelly.werkz.Project", project );
           
  
  
  
  1.3       +0 -1      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/TargetTag.java
  
  Index: TargetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/TargetTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TargetTag.java	11 Jun 2002 22:59:22 -0000	1.2
  +++ TargetTag.java	12 Jun 2002 04:32:28 -0000	1.3
  @@ -59,7 +59,6 @@
   package org.apache.commons.jelly.tags.werkz;
   
   import com.werken.werkz.DefaultGoal;
  -import com.werken.werkz.Werkz;
   
   import java.util.Iterator;
   import java.util.List;
  
  
  
  1.2       +4 -4      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/WerkzTagSupport.java
  
  Index: WerkzTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/WerkzTagSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WerkzTagSupport.java	11 Jun 2002 21:41:11 -0000	1.1
  +++ WerkzTagSupport.java	12 Jun 2002 04:32:28 -0000	1.2
  @@ -59,7 +59,7 @@
   package org.apache.commons.jelly.tags.werkz;
   
   import com.werken.werkz.Goal;
  -import com.werken.werkz.Werkz;
  +import com.werken.werkz.Project;
   
   import org.apache.commons.jelly.JellyException;
   import org.apache.commons.jelly.TagSupport;
  @@ -84,7 +84,7 @@
        *  throws a JellyExceptoin if the goal could not be found
        */
       protected Goal getGoal(String name) throws JellyException {
  -        Werkz project = getProject();
  +        Project project = getProject();
           if ( project == null ) {
               throw new JellyException( "Must use this tag inside a <maven:project>
tag" );
           }
  @@ -98,12 +98,12 @@
       /**
        * @return the goal manager instance 
        */
  -    protected Werkz getProject() {
  +    protected Project getProject() {
           ProjectTag tag = (ProjectTag) findAncestorWithClass(ProjectTag.class);
           if ( tag != null) {
               return tag.getProject();
           }
  -        return (Werkz) context.getVariable( "org.apache.commons.jelly.werkz.Project" );
  +        return (Project) context.getVariable( "org.apache.commons.jelly.werkz.Project"
);
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message