ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant ProjectHelper.java
Date Mon, 28 Feb 2000 14:10:47 GMT
rubys       00/02/28 06:10:47

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
  Log:
  Remove special processing for init.
  
  Tested with the latest versions of:
    jakarta-ant
    jakarta-tomcat
    jakarta-tools
    jakarta-watchdog
    xml-xerces
    xml-xalan
    xml-cocoon
  
  Revision  Changes    Path
  1.7       +14 -50    jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProjectHelper.java	2000/02/23 21:11:16	1.6
  +++ ProjectHelper.java	2000/02/28 14:10:46	1.7
  @@ -124,36 +124,9 @@
           //      configureTaskDefs(project, root);
   
           // set up the targets into the project
  -        init(project, root );
           configureTargets(project, root);
       }
   
  -    /** Read and execute init - all other targets will be loaded after ( to
  -     * make sure all properties are set ).
  -     *
  -     */
  -    private static void init(Project project, Element root)
  -        throws BuildException
  -    {
  -        // Hack - all tasks outside init target will be added to init
  -        // ( will be removed when / if build.xml will start using init )
  -        Target initTarget = new Target();
  -        initTarget.setProject(project);
  -        initTarget.setName( "init" );
  -        project.addTarget( "init", initTarget );
  -        configureTasks( project, initTarget, root );
  -
  -        NodeList list = root.getElementsByTagName("target");
  -        for (int i = 0; i < list.getLength(); i++) {
  -            Element element = (Element)list.item(i);
  -            String targetName = element.getAttribute("name");
  -
  -            if( targetName.equals("init") )
  -                configureTasks(project, initTarget, element);
  -        }
  -        initTarget.execute();
  -    }
  -
       private static void configureTargets(Project project, Element root)
           throws BuildException
       {
  @@ -171,10 +144,6 @@
                   throw new BuildException(msg);
               }
   
  -            // init is done already
  -            if( targetName.equals("init") )
  -                continue;
  -
               Target target = new Target();
               target.setName(targetName);
               target.setCondition(targetCond);
  @@ -212,26 +181,21 @@
                   Element element = (Element)node;
                   String taskType = element.getTagName();
   
  -                // special case - no target in a target.
  -                // hack to allow this method to set "init" target
  -                // using root element
  -                if( ! taskType.equals( "target" ) ) {
  -                    // XXX
  -                    // put in some sanity checking
  -
  -                    Task task = project.createTask(taskType);
  -
  -                    // get the attributes of this element and reflect them
  -                    // into the task
  -
  -                    NamedNodeMap nodeMap = element.getAttributes();
  -                    configure(project, task, nodeMap);
  -                    task.init();
  -                    task.setTarget(target);
  -                    target.addTask(task);
  +                // XXX
  +                // put in some sanity checking
   
  -                    processNestedProperties(project, task, element);
  -                }
  +                Task task = project.createTask(taskType);
  +
  +                // get the attributes of this element and reflect them
  +                // into the task
  +
  +                NamedNodeMap nodeMap = element.getAttributes();
  +                configure(project, task, nodeMap);
  +                task.init();
  +                task.setTarget(target);
  +                target.addTask(task);
  +
  +                processNestedProperties(project, task, element);
               }
           }
       }
  
  
  

Mime
View raw message