From 4896e42323baf60743b5f6f4162819603705950c Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Fri, 13 Dec 2002 21:58:23 +0000 Subject: [PATCH] Initial fix for description problems. If the original ProjectHelperImpl will be used, things will work as before. If not - Description will look into each target and do whatever it is supposed to do. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273668 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/types/Description.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/main/org/apache/tools/ant/types/Description.java b/src/main/org/apache/tools/ant/types/Description.java index b2bcad1e2..a141a344d 100644 --- a/src/main/org/apache/tools/ant/types/Description.java +++ b/src/main/org/apache/tools/ant/types/Description.java @@ -54,6 +54,12 @@ package org.apache.tools.ant.types; +import org.apache.tools.ant.*; +import org.apache.tools.ant.helper.ProjectHelperImpl; + +import java.util.Hashtable; +import java.util.Enumeration; +import java.util.Vector; /** @@ -77,6 +83,13 @@ public class Description extends DataType { * Adds descriptive text to the project. */ public void addText(String text) { + + ProjectHelper ph=ProjectHelper.getProjectHelper(); + if( ! ( ph instanceof ProjectHelperImpl )) { + // New behavior for delayed task creation. Description + // will be evaluated in Project.getDescription() + return; + } String currentDescription = getProject().getDescription(); if (currentDescription == null) { getProject().setDescription(text); @@ -84,4 +97,47 @@ public class Description extends DataType { getProject().setDescription(currentDescription + text); } } + + public static String getDescription(Project project) { + StringBuffer description=new StringBuffer(); + Vector targets=(Vector)project.getReference( "ant.targets"); + for( int i=0; i