You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by co...@apache.org on 2002/02/03 13:52:58 UTC

cvs commit: jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service DataService.java

conor       02/02/03 04:52:58

  Modified:    proposal/mutant build.xml
               proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
                        ExecutionDataService.java ExecutionFrame.java
               proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant
                        Project.java
               proposal/mutant/src/java/common/org/apache/ant/common/service
                        DataService.java
  Log:
  Implement get all properties
  Don't try to build non-existent IO library (Sorry Gump)
  
  Revision  Changes    Path
  1.9       +18 -4     jakarta-ant/proposal/mutant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- build.xml	2 Feb 2002 15:05:56 -0000	1.8
  +++ build.xml	3 Feb 2002 12:52:58 -0000	1.9
  @@ -128,9 +128,6 @@
   
     <target name="antlibs" depends="common">
       <antcall target="build-lib" inheritall="false">
  -      <param name="libset" value="io"/>
  -    </antcall>
  -    <antcall target="build-lib" inheritall="false">
         <param name="libset" value="system"/>
       </antcall>
     </target>
  @@ -171,7 +168,24 @@
                   parampattern="[a-z].*"
                   staticpattern="[a-z].*"
                   ignoreCastWhitespace="true">
  -      <fileset dir="${java.dir}" includes="**/*.java"/>
  +      <fileset dir="${java.dir}">
  +        <include name="**/*.java"/>
  +        <exclude name="**/org/apache/tools/ant/Task.java"/>
  +        <exclude name="**/org/apache/tools/ant/ProjectComponent.java"/>
  +        <exclude name="**/org/apache/tools/ant/types/DataType.java"/>
  +      </fileset>
  +    </checkstyle>
  +    <checkstyle maxlinelen="80"
  +                memberpattern="[a-z].*"
  +                parampattern="[a-z].*"
  +                staticpattern="[a-z].*"
  +                allowProtected="true"
  +                ignoreCastWhitespace="true">
  +      <fileset dir="${java.dir}">
  +        <include name="**/org/apache/tools/ant/Task.java"/>
  +        <include name="**/org/apache/tools/ant/ProjectComponent.java"/>
  +        <include name="**/org/apache/tools/ant/types/DataType.java"/>
  +      </fileset>
       </checkstyle>
     </target>
     
  
  
  
  1.2       +10 -0     jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionDataService.java
  
  Index: ExecutionDataService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionDataService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- ExecutionDataService.java	2 Feb 2002 14:50:31 -0000	1.1
  +++ ExecutionDataService.java	3 Feb 2002 12:52:58 -0000	1.2
  @@ -208,5 +208,15 @@
           return sb.toString();
       }
   
  +    /**
  +     * Get all the properties from the frame and any references frames. This
  +     * is an expensive operation since it must clone all of the property
  +     * stores in all frames
  +     *
  +     * @return a Map containing the frames properties indexed by their full name.
  +     */
  +    public Map getAllProperties() {
  +        return frame.getAllProperties();
  +    }         
   }
   
  
  
  
  1.4       +28 -1     jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionFrame.java
  
  Index: ExecutionFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionFrame.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- ExecutionFrame.java	2 Feb 2002 14:50:31 -0000	1.3
  +++ ExecutionFrame.java	3 Feb 2002 12:52:58 -0000	1.4
  @@ -274,6 +274,33 @@
        */
       public Project getProject() {
           return project;
  +    }
  +
  +
  +    /**
  +     * Get all the properties from the frame and any references frames. This
  +     * is an expensive operation since it must clone all of the property
  +     * stores in all frames
  +     *
  +     * @return a Map containing the frames properties indexed by their full name.
  +     */
  +    public Map getAllProperties() {
  +        Map allProperties = new HashMap(dataValues);
  +        Iterator i = referencedFrames.keySet().iterator(); 
  +        while (i.hasNext()) {
  +            String refName = (String)i.next();
  +            ExecutionFrame refFrame = getReferencedFrame(refName);
  +            Map refProperties = refFrame.getAllProperties();
  +            Iterator j = refProperties.keySet().iterator();
  +            while (j.hasNext()) {
  +                String name = (String)j.next();
  +                Object value = refProperties.get(name);
  +                allProperties.put(refName + Project.REF_DELIMITER + name,
  +                    value);
  +            }
  +        }
  +        
  +        return allProperties;
       }
   
       /**
  
  
  
  1.2       +47 -0     jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- Project.java	2 Feb 2002 14:50:32 -0000	1.1
  +++ Project.java	3 Feb 2002 12:52:58 -0000	1.2
  @@ -54,6 +54,9 @@
   package org.apache.tools.ant;
   import java.io.File;
   import java.io.IOException;
  +import java.util.Hashtable;
  +import java.util.Map;
  +import java.util.Iterator;
   import org.apache.ant.common.antlib.AntContext;
   import org.apache.ant.common.service.DataService;
   import org.apache.ant.common.service.FileService;
  @@ -617,6 +620,50 @@
           } catch (ExecutionException e) {
               throw new BuildException(e);
           }
  +    }
  +    
  +    /**
  +     * get a copy of the property hashtable
  +     * @return the hashtable containing all properties, user included
  +     */
  +    public Hashtable getProperties() {
  +        Map properties = dataService.getAllProperties();
  +        Hashtable result = new Hashtable();
  +        for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
  +            String name = (String)i.next();
  +            Object value = properties.get(name);
  +            if (value instanceof String) {
  +                result.put(name, value);
  +            }
  +        }
  +        
  +        return result;
  +    }
  +
  +    /**
  +     * get a copy of the property hashtable
  +     * @return the hashtable containing all properties, user included
  +     */
  +    public Hashtable getUserProperties() {
  +        return getProperties();
  +    }
  +    
  +    /**
  +     * Get all references in the project
  +     * @return the hashtable containing all references
  +     */
  +    public Hashtable getReferences() {
  +        Map properties = dataService.getAllProperties();
  +        Hashtable result = new Hashtable();
  +        for (Iterator i = properties.keySet().iterator(); i.hasNext();) {
  +            String name = (String)i.next();
  +            Object value = properties.get(name);
  +            if (!(value instanceof String)) {
  +                result.put(name, value);
  +            }
  +        }
  +        
  +        return result;
       }
   }
   
  
  
  
  1.2       +9 -0      jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java
  
  Index: DataService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- DataService.java	2 Feb 2002 14:50:33 -0000	1.1
  +++ DataService.java	3 Feb 2002 12:52:58 -0000	1.2
  @@ -128,5 +128,14 @@
       String replacePropertyRefs(String value, Map replacementValues)
            throws ExecutionException;
   
  +    /**
  +     * Get all the properties from the frame and any references frames. This
  +     * is an expensive operation since it must clone all of the property
  +     * stores in all frames
  +     *
  +     * @return a Map containing the frames properties indexed by their full name.
  +     */
  +    Map getAllProperties();         
  +         
   }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>