ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Galbraith" <pgalbra...@trigoncanada.com>
Subject Problems using containsregexp selector
Date Fri, 30 Jul 2004 15:09:03 GMT
I put together a simple ant script to watch the containsregexp selector
at work, and I'm seeing some bizarre results.  This could be problems in
ant-contrib, or brain damage on my part, or who knows what.  If anyone
can explain the results to me, I'd appreciate it.

Basically, I just unpacked the rt.jar from my JDK and then tried to
print out the names of all class files that match the regex
"ClassLoader".  Seems simple enough to me.  I'm using ant 1.6.2 running
under sun jvm 1.4.2_05.

Here's my ant script (including ant-contrib-1.0b1 task):

<project default="regex">
    <taskdef resource="net/sf/antcontrib/antlib.xml"/>
    <target name="unpack">
	<unjar src="jre/lib/rt.jar" dest="rt"/>
    </target>
    <target name="regex" depends="unpack">
	<foreach target="print" param="fn">
	    <path>
		<fileset dir="rt">
		    <containsregexp expression="ClassLoader"/>
		</fileset>
	    </path>
	</foreach>
    </target>
    <target name="print">
	<echo message="${fn}"/>
    </target>
</project>

I would have expected a list of classes matching "ClassLoader" to be
echoed to the console, but instead I get results like (truncated, but
you should see my reason for confusion...) the output below.  Can anyone
explain this?

----------

unpack:
    [unjar] Expanding: C:\j2sdk1.4.2_05\jre\lib\rt.jar into
C:\j2sdk1.4.2_05\rt

regex:

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\Activation\ServerMain.clas
s

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\Activation\ServerManagerIm
pl.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\Interceptors\PIORB.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\Interceptors\RequestInfoIm
pl.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\POA\POAORB.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\POA\ServantCachePOAClientS
C.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\corba\ClientDelegate.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\corba\ORB.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\CDRInputStream_1_0.cl
ass

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\CDROutputStream_1_0.c
lass

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\messages\LocateReplyM
essage_1_2.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\messages\ReplyMessage
_1_0.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\messages\ReplyMessage
_1_1.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\iiop\messages\ReplyMessage
_1_2.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\io\ValueHandlerImpl$Stream
Factory.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\javax\rmi\CORBA\Util.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\orbutil\ORBClassLoader.cla
ss

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\orbutil\ORBUtility.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\orbutil\RepositoryId_1_3.c
lass

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\orbutil\RepositoryId_1_3_1
.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\JDKBridge.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\JDKClassLoader$1.clas
s

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\JDKClassLoader$JDKCla
ssLoaderCache$CacheKey.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\JDKClassLoader$JDKCla
ssLoaderCache.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\JDKClassLoader.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\RepositoryId.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\corba\se\internal\util\Utility.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\java\swing\plaf\gtk\GTKStyle$GTKLazyValue.cl
ass

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\java\swing\plaf\gtk\SynthInternalFrameTitleP
ane.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\jndi\ldap\Obj$LoaderInputStream.class

print:
     [echo] C:\j2sdk1.4.2_05\rt\com\sun\jndi\ldap\Obj.class

print:
     [echo] C:\j2sdk1.4.2_05\rt\com\sun\jndi\ldap\VersionHelper.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\jndi\ldap\VersionHelper12$1.class

print:
     [echo] C:\j2sdk1.4.2_05\rt\com\sun\jndi\ldap\VersionHelper12.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\media\sound\DefaultSecurity.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\FactoryEnumeration.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\ResourceManager.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\VersionHelper.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\VersionHelper12$5.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\VersionHelper12$6.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\naming\internal\VersionHelper12.class

print:
     [echo] C:\j2sdk1.4.2_05\rt\com\sun\security\auth\PolicyFile.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\security\auth\SubjectCodeSource$2.class

print:
     [echo]
C:\j2sdk1.4.2_05\rt\com\sun\security\auth\SubjectCodeSource.class


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message