ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Lucas <j...@stonecottage.com>
Subject [PATCH] Re: other tokens
Date Thu, 18 Jan 2001 01:20:28 GMT
Jon Stevens wrote:
> 
> on 1/17/01 4:48 PM, "Josh Lucas" <josh@stonecottage.com> wrote:
> 
> [good points understood and deleted]
> 
> > At any rate, I adjusted Project, ProjectHelper and Target to handle this
> > and I can send the patches if wanted.
> >
> > josh
> 
> please.
> 

here ya go...

Index: Project.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.50
diff -u -r1.50 Project.java
--- Project.java        2001/01/03 14:18:27     1.50
+++ Project.java        2001/01/18 00:56:04
@@ -90,8 +90,8 @@
     public static final String JAVA_1_2 = "1.2";
     public static final String JAVA_1_3 = "1.3";
 
-    public static final String TOKEN_START = "@";
-    public static final String TOKEN_END = "@";
+    private String TOKEN_START;
+    private String TOKEN_END;
 
     private String name;
 
@@ -1026,6 +1026,11 @@
 
     public Hashtable getReferences() {
         return references;
+    }
+
+    public void setToken(String token) {
+        TOKEN_START=token;
+        TOKEN_END=token;
     }
 
     protected void fireBuildStarted() {
Index: ProjectHelper.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
retrieving revision 1.45
diff -u -r1.45 ProjectHelper.java
--- ProjectHelper.java  2001/01/16 13:36:38     1.45
+++ ProjectHelper.java  2001/01/18 00:56:04
@@ -352,6 +352,7 @@
             String unlessCond = null;
             String id = null;
             String description = null;
+            String token = null;
 
             for (int i = 0; i < attrs.getLength(); i++) {
                 String key = attrs.getName(i);
@@ -369,6 +370,8 @@
                     id = value;
                 } else if (key.equals("description")) {
                     description = value;
+                } else if (key.equals("token")) {
+                    token = value;
                 } else {
                     throw new SAXParseException("Unexpected attribute
\"" + key + "\"", locator);
                 }
@@ -383,6 +386,11 @@
             target.setIf(ifCond);
             target.setUnless(unlessCond);
             target.setDescription(description);
+            if (token == null) {
+                target.setToken("@");
+            }
+            else
+                target.setToken(token);
             project.addTarget(name, target);
 
             if (id != null && !id.equals(""))
Index: Target.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.15
diff -u -r1.15 Target.java
--- Target.java 2001/01/03 14:18:27     1.15
+++ Target.java 2001/01/18 00:56:04
@@ -71,6 +71,7 @@
     private Vector tasks = new Vector(5);
     private Project project;
     private String description = null;
+    private String token = null;
 
     public void setProject(Project project) {
         this.project = project;
@@ -80,6 +81,14 @@
         return project;
     }
 
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
     public void setDepends(String depS) {
         if (depS.length() > 0) {
             StringTokenizer tok =
@@ -143,6 +152,7 @@
 
     public void execute() throws BuildException {
         if (testIfCondition() && testUnlessCondition()) {
+            project.setToken(token);
             Enumeration enum = tasks.elements();
             while (enum.hasMoreElements()) {
                 Task task = (Task) enum.nextElement();

Mime
View raw message