You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/07/05 11:33:30 UTC
DO NOT REPLY [Bug 42814] New: - changed under 1.7.0
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42814>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42814
Summary: <zipfileset> changed under 1.7.0
Product: Ant
Version: 1.7.0
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: dev@ant.apache.org
ReportedBy: oliver@puppycrawl.com
The build.xml file below demonstrates a bug in ANT 1.7.0 that does not exist in
ANT 1.6.5. I am using <zipfileset> to determine the name of an included file in
a JAR file. This does not work under ANT 1.7.0.
IMPORTANT! The file "impl-bar.jar" must also exist in the same directory and
have a file called "config/bar/spring-inc-bar.xml" within it. E.g.
prompt% jar -tf impl-bar.jar
config/bar/
config/bar/spring-inc-bar.xml
To test it, just run "ant".
Under ANT 1.6.5 I get:
Buildfile: build.xml
go:
[echo] Running test...
[echo] ...passed (must be ANT-1.6+)
BUILD SUCCESSFUL
Total time: 0 seconds
Under ANT 1.7.0 I get:
Buildfile: build.xml
go:
[echo] Running test...
BUILD FAILED
C:\oliver\work\ant-bug\build.xml:9: ...failed, got 'impl-bar.jar' instead of
'config/bar/spring-inc-bar.xml'
Total time: 0 seconds
The build.xml follows:
============================================================================
<project name="fileset-bug" default="go">
<target name="go">
<echo>Running test...</echo>
<zipfileset id="the.fileset"
src="impl-bar.jar"
includes="config/*/spring-inc-*.xml"
/>
<property name="theincs" refid="the.fileset" />
<fail message="...failed, got '${theincs}' instead of
'config/bar/spring-inc-bar.xml'">
<condition>
<not>
<equals arg1="${theincs}" arg2="config/bar/spring-inc-bar.xml"/>
</not>
</condition>
</fail>
<echo>...passed (must be ANT-1.6+)</echo>
</target>
</project>
============================================================================
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
DO NOT REPLY [Bug 42814] - changed under 1.7.0
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42814>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42814
paulk@asert.com.au changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |paulk@asert.com.au
------- Additional Comments From paulk@asert.com.au 2007-07-29 01:22 -------
A workaround. Replace:
<property name="theincs" refid="the.fileset" />
with:
<groovy>
properties.theincs = project.references['the.fileset'].iterator().next().name
</groovy>
or equivalent using your scripting language of choice using the script task.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
DO NOT REPLY [Bug 42814] - changed under 1.7.0
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42814>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42814
------- Additional Comments From oliver@puppycrawl.com 2007-07-29 21:07 -------
The problem I am solving in my main build.xml file it so locate all the Spring
configuration files in a set of JAR files and populate a ANT property with these
names. This is used then to set a value in a application configuration file (via
a <filterset>) which is used to initialise the system.
Thanks to Paul's suggestion, below is what I ended up doing with Groovy that
works under ANT 1.6.5 and 1.7.0.
I'll leave it up to you if you want to close out this bug.
=======================================================
<groovy>
import java.util.jar.JarFile;
theincs = ""
def libdir = new File("${properties['local.target']}/lib")
libdir.listFiles().grep(~/.*(dao|service)-.*jar$/).each() { it ->
new JarFile(it).entries().each() { entry ->
if (entry.name ==~ /^com\/kazgroup\/courtlink\/.*\/spring-inc-.*.xml$/) {
theincs = theincs + " " + entry.name
}
}
}
properties["all-spring-incs"] = theincs
</groovy>
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
DO NOT REPLY [Bug 42814] - changed under 1.7.0
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42814>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42814
------- Additional Comments From stevel@apache.org 2007-07-05 07:49 -------
I see, you think the toString value of zipfileset has appeared to change. (you
can evaluate this with ${toString:the.fileset}
The answer is yes, it probably has changed as part of the migration to
resources; we tried to give every resource a meaningful toString value, and
perhaps here it doesnt include as much as before.
Question is, is there a better way to achieve what you are trying to do in the
new world, given that the toString() value of all the built in datatypes is not
something that's ever been viewed as part of the api to keep stable (no tests, etc).
what does your main build file look like?
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org