commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject [Jelly] Lessons from Gump part 3: Ant tags should set ant.file
Date Wed, 14 Apr 2004 14:49:53 GMT
Ant isn't in the very best shape for being embedded, it assumes it has
been invoked via the command line in various places.

One of the things that have changed between Ant 1.5.x and 1.6.0 is
that <ant> and friends now check whether they are part of a circular
invocation by comparing the current build file location with the one
of the file they are supposed to call.  This new code assumed that
ant.file has been set.

Actually, in the context of Jelly the value doesn't matter at all, so
you could set it to something arbitrary.  I've chosen to use the
String form of JellyContext#getCurrentURL in my patch, but you may
want to use something different.

A patch like the appended patch is necessary to make Jelly work with
Ant 1.6.0 and 1.6.1 - Ant 1.6.2 (no release scheduled yet) will work
with Jelly as it is.

Stefan

Index: src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/jelly/jelly-tags/ant/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java,v
retrieving revision 1.29
diff -u -r1.29 AntTagLibrary.java
--- src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java	25 Feb 2004 01:23:59 -0000
1.29
+++ src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java	14 Apr 2004 14:49:10 -0000
@@ -134,6 +134,8 @@
         
         project.init();
         project.getBaseDir();
+        project.setProperty("ant.file", 
+                            context.getCurrentURL().toExternalForm());
 
         return project;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message