ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs Property.java
Date Sun, 16 Dec 2001 04:21:29 GMT
donaldp     01/12/15 20:21:29

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Property.java
  Log:
  Ant2 properties are dynamic so need need for 2 phase parsing
  
  Revision  Changes    Path
  1.7       +3 -56     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Property.java	2001/12/16 02:05:41	1.6
  +++ Property.java	2001/12/16 04:21:29	1.7
  @@ -17,7 +17,6 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.AntClassLoader;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.ProjectHelper;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  @@ -197,7 +196,9 @@
       protected void addProperties( Properties props )
           throws TaskException
       {
  -        resolveAllProperties( props );
  +        //no longer needs as ant2 properties are completely dynamic
  +        //resolveAllProperties( props );
  +
           Enumeration e = props.keys();
           while( e.hasMoreElements() )
           {
  @@ -329,60 +330,6 @@
           catch( IOException ex )
           {
               throw new TaskException( "Error", ex );
  -        }
  -    }
  -
  -    private void resolveAllProperties( Properties props )
  -        throws TaskException
  -    {
  -        for( Enumeration e = props.keys(); e.hasMoreElements(); )
  -        {
  -            String name = (String)e.nextElement();
  -            String value = props.getProperty( name );
  -
  -            boolean resolved = false;
  -            while( !resolved )
  -            {
  -                Vector fragments = new Vector();
  -                Vector propertyRefs = new Vector();
  -                ProjectHelper.parsePropertyString( value, fragments, propertyRefs );
  -
  -                resolved = true;
  -                if( propertyRefs.size() != 0 )
  -                {
  -                    StringBuffer sb = new StringBuffer();
  -                    Enumeration i = fragments.elements();
  -                    Enumeration j = propertyRefs.elements();
  -                    while( i.hasMoreElements() )
  -                    {
  -                        String fragment = (String)i.nextElement();
  -                        if( fragment == null )
  -                        {
  -                            String propertyName = (String)j.nextElement();
  -                            if( propertyName.equals( name ) )
  -                            {
  -                                throw new TaskException( "Property " + name + " was circularly
defined." );
  -                            }
  -                            fragment = getProject().getProperty( propertyName );
  -                            if( fragment == null )
  -                            {
  -                                if( props.containsKey( propertyName ) )
  -                                {
  -                                    fragment = props.getProperty( propertyName );
  -                                    resolved = false;
  -                                }
  -                                else
  -                                {
  -                                    fragment = "${" + propertyName + "}";
  -                                }
  -                            }
  -                        }
  -                        sb.append( fragment );
  -                    }
  -                    value = sb.toString();
  -                    props.put( name, value );
  -                }
  -            }
           }
       }
   }
  
  
  

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


Mime
View raw message