Index: src/main/java/org/apache/maven/jelly/tags/maven/MavenTagLibrary.java =================================================================== --- src/main/java/org/apache/maven/jelly/tags/maven/MavenTagLibrary.java (revision 169336) +++ src/main/java/org/apache/maven/jelly/tags/maven/MavenTagLibrary.java (working copy) @@ -25,7 +25,7 @@ * @author Jason van Zyl * @author Brett Porter * @author Vincent Massol - * @version $Id: MavenTagLibrary.java,v 1.1 2004/11/06 22:31:56 brett Exp $ + * @version $Id$ */ public class MavenTagLibrary extends BaseTagLibrary { @@ -37,6 +37,7 @@ { registerTag( "snapshot", SnapshotSignature.class ); registerTag( "addPath", AddPathTag.class ); + registerTag( "getPath", GetPathTag.class ); registerTag( "maven", MavenTag.class ); registerTag( "pom", PomTag.class ); registerTag( "reactor", ReactorTag.class ); Index: src/main/java/org/apache/maven/jelly/tags/maven/GetPathTag.java =================================================================== --- src/main/java/org/apache/maven/jelly/tags/maven/GetPathTag.java (revision 0) +++ src/main/java/org/apache/maven/jelly/tags/maven/GetPathTag.java (revision 0) @@ -0,0 +1,110 @@ +package org.apache.maven.jelly.tags.maven; + +/* ==================================================================== + * Copyright 2005 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. + * ==================================================================== + */ + +import org.apache.commons.jelly.JellyTagException; +import org.apache.commons.jelly.XMLOutput; +import org.apache.commons.jelly.tags.ant.AntTagLibrary; +import org.apache.maven.MavenUtils; +import org.apache.maven.jelly.tags.BaseTagSupport; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.types.Path; + +/** + * This class returns the Ant path associated with a given id. + * + * @author Felipe Leme + * @version $Id: $ + */ +public class GetPathTag + extends BaseTagSupport +{ + /** the id of the path we're getting. */ + private String id; + + /** name of the variable where the path will be stored */ + private String var; + + /** + * Perform the tag processing. Look up the path by {@link #id} and store it + * on the variable named by the {@link #var} atribute. + * + * @param output used to write output + * @throws JellyTagException when anything goes wrong. + */ + public void doTag( XMLOutput output ) + throws JellyTagException + { + Project project = AntTagLibrary.getProject( getContext() ); + + if ( project == null ) + { + throw new JellyTagException( "cannot find ant project" ); + } + + checkAttribute( getId(), "id" ); + checkAttribute( getVar(), "var" ); + + Path path = (Path) project.getReferences().get( getId() ); + System.out.println(">>>>>> PATH: " + path ); + getContext().setVariable( var, path ); + + } + + /** + * Setter for the id property + * + * @param pathId the reference id of the path in the ant project that will be + * appended to + */ + public void setId( String pathId ) + { + id = pathId; + } + + /** + * Getter for the id property + * + * @return the reference id of the path in the ant project that will be + * appended to + */ + public String getId() + { + return id; + } + + /** + * Setter for the var property + * + * @return var name of the variable that will receive the path + */ + public void setVar( String var ) + { + this.var = var; + } + + /** + * Getter for the var property + * + * @return name of the variable that will receive the path + */ + public String getVar() + { + return this.var; + } +} Property changes on: src/main/java/org/apache/maven/jelly/tags/maven/GetPathTag.java ___________________________________________________________________ Name: svn:executable + *