ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Gill" <>
Subject RE: Substring / regex on a package name?
Date Wed, 13 Oct 2004 10:35:18 GMT
Thanks Ivan, that is great...

Re: the repackage - move certainly would be a start, but I was looking
for a repackage task that would recurse from a point (ie. '.') and move
all dirs/java sources/props files etc.. into a new package structure...

Ie. From com.oldapp to com.newapp ..

But also, I would want it to rename any paths in the files (ie.
Com/oldapp to com/newapp) and any package names / import statements...

I had to write something like this last week, it is not quite generic
enough to make it an offering as an optional task as yet... but I
wondered if there was anything else out there like this....  I saw a
rename packages task on somewhere but it did not seem to


-----Original Message-----
From: Ivan Ivanov [] 
Sent: 13 October 2004 10:22
To: Ant Users List
Subject: Re: Substring / regex on a package name?

> Hi,
> I have two questions:
> 1) I have a property called "com.myapp" within my
> build.xml file (or at
> least loaded in at runtime), and I want to strip off
> everything past the
> first dot (to get the base package name com)...
> Is that possible?

You can use ant-contrib[1] task PropertyRegex, an
example copied directly from[2] shows that it is
    <propertyregex property=""
              casesensitive="false" />
This will yield ABC.

Or you can using a scripting language (like
javascript) in ant to manipulate your string (but I am
not so good in it to provide sample).

> 2) Is there a rename packages ANT task?
There is a <move> task that can rename the packages
viewed as directories. Is this want you want>


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message