ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/condition TypeFound.java
Date Fri, 20 May 2005 16:44:27 GMT
Exactly what I was in the process of doing for the
InstanceOf ResourceSelector!  :)

-Matt

--- peterreilly@apache.org wrote:
> peterreilly    2005/05/20 09:33:15
> 
>   Modified:    docs/manual/CoreTasks conditions.html
>               
> src/main/org/apache/tools/ant/taskdefs/condition
>                         TypeFound.java
>   Log:
>   add uri attribute to typefound type
>   
>   Revision  Changes    Path
>   1.39      +8 -1     
> ant/docs/manual/CoreTasks/conditions.html
>   
>   Index: conditions.html
>  
>
===================================================================
>   RCS file:
>
/home/cvs/ant/docs/manual/CoreTasks/conditions.html,v
>   retrieving revision 1.38
>   retrieving revision 1.39
>   diff -u -r1.38 -r1.39
>   --- conditions.html	16 May 2005 14:57:09 -0000
> 1.38
>   +++ conditions.html	20 May 2005 16:33:15 -0000
> 1.39
>   @@ -425,6 +425,13 @@
>        <td valign="top">name of the type</td>
>        <td valign="top" align="center">Yes</td>
>      </tr>
>   +  <tr>
>   +    <td valign="top">uri</td>
>   +    <td valign="top">
>   +      The uri that this type lives in.
>   +    </td>
>   +    <td valign="top" align="center">No</td>
>   +  </tr>
>    </table>
>    
>      <p>
>   @@ -433,7 +440,7 @@
>      <blockquote>
>      <pre>
>        &lt;typefound name="junit"/&gt;
>   -    &lt;typefound
>
name="antlib:org.apache.maven.artifact.ant:artifact"/&gt;
>   +    &lt;typefound
> uri="antlib:org.apache.maven.artifact.ant"
> name="artifact"/&gt;
>      </pre></blockquote>
>    
>    <h4>scriptcondition</h4>
>   
>   
>   
>   1.7       +14 -2    
>
ant/src/main/org/apache/tools/ant/taskdefs/condition/TypeFound.java
>   
>   Index: TypeFound.java
>  
>
===================================================================
>   RCS file:
>
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/TypeFound.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- TypeFound.java	9 Mar 2004 16:48:13 -0000	1.6
>   +++ TypeFound.java	20 May 2005 16:33:15 -0000	1.7
>   @@ -1,5 +1,5 @@
>    /*
>   - * Copyright  2004 The Apache Software Foundation
>   + * Copyright  2004-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.
>   @@ -20,6 +20,7 @@
>    import org.apache.tools.ant.BuildException;
>    import org.apache.tools.ant.ComponentHelper;
>    import org.apache.tools.ant.ProjectComponent;
>   +import org.apache.tools.ant.ProjectHelper;
>    import org.apache.tools.ant.AntTypeDefinition;
>    
>    /**
>   @@ -30,6 +31,7 @@
>    public class TypeFound extends ProjectComponent
> implements Condition {
>    
>        private String name;
>   +    private String uri;
>    
>        /**
>         * the task or other type to look for
>   @@ -40,6 +42,15 @@
>        }
>    
>        /**
>   +     * The URI for this definition.
>   +     * @param uri the namespace URI. If this is
> not set, use the
>   +     *            default namespace.
>   +     */
>   +    public void setURI(String uri) {
>   +        this.uri = uri;
>   +    }
>   +
>   +    /**
>         * test for a task or other ant type existing
> in the current project
>         * @param typename the name of the type
>         * @return true if the typename exists
>   @@ -48,7 +59,8 @@
>    
>            ComponentHelper helper =
>               
> ComponentHelper.getComponentHelper(getProject());
>   -        AntTypeDefinition def =
> helper.getDefinition(typename);
>   +        AntTypeDefinition def =
> helper.getDefinition(
>   +            ProjectHelper.genComponentName(uri,
> typename));
>            if (def == null) {
>                return false;
>            }
>   
>   
>   
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message