ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Casey Daniell <CDani...@realm.com>
Subject RE: Renaming files in a fileset??
Date Thu, 10 Mar 2005 17:14:32 GMT
Jacob,
Nice. Your Mapper and Regex worked like a charm.

Dominique/Matt thanks for pointing out the Mapper function, I had forgotten
using that.

Casey


-----Original Message-----
From: Jacob Kjome []
Sent: Wednesday, March 09, 2005 4:48 PM
To: Ant Users List
Subject: Re: Renaming files in a fileset??



I'm not going to guarantee that this works.  I worked on this a while back
and
commented it out because I went another route, but wanted to keep this
around
for reference.  The Regexp might be able to be written better as well.  Try
it
and see if it works for you.  Let me know if it does.

<copy todir="${deploy.dest}/lib" overwrite="yes">
    <fileset refid="compile.libs"/>
    <fileset refid="runtime.libs"/>
    <mapper type="regexp" from="^(\w+(\-*\w*)*)(\-+([0-9]?.?)*)*(.jar)$$"
to="\1\5"/>
</copy>


Jake

Quoting Casey Daniell <>:

> Is there any good way to automatically rename files in a fileset?
>
> Situation, I have many different products that I support, instead of
> including specific libraries in the build script I include a reference to
> the files which is resolved in a properties file. This allows me to easily
> vary different versions of a particular library, without manually changing
> build script(s) every time. We have one product that is spread
> across 5 CVS modules this allows one property file change to affect all
CVS
> modules.
>
> I would like to be able to rename the libraries from log4j-1.2.8.jar to
> log4j.jar, when I copy the file contained in a fileset to the distro
point.
> Is there any easy way to do this? (Basically just strip out the number
part
> of the library name.)
>
> Casey
>
> Current snippets of code:
>    <!-- These libraries are required to compile and run production code
-->
>    <fileset id="compile.libs" dir="${libs.home}">
>       <include name="${commons-cli}"/>
>       <include name="${commons-codec}"/>
>       <include name="${commons-lang}"/>
>       <include name="${commons-logging}"/>
>    	  <include name="${log4j}"/>
>    	  <include name="${realmutil}"/>
>       <include name="${realm-commons}"/>
>    	  <include name="${xbean}"/>
>    </fileset>
>
>    <!-- These libraries are only required to run production code
>         Note that they are NOT required to compile production code -->
>    <fileset id="runtime.libs" dir="${libs.home}">
>       <include name="${activation}"/>
>       <include name="${jtds}"/>
>       <include name="${log4j}"/>
>       <include name="${mail}"/>
>       <include name="${ojdbc14}"/>
>       <include name="${xercesImpl}"/>
>       <include name="${xalan}"/>
>    </fileset>
>
> ...
> ...
> ...
>    <target name="compile" depends="init" description="Compile Java
sources">
>       <javac srcdir="${src.home}"
>              destdir="${build.classes}"
>              debug="${compile.debug}"
>              deprecation="${compile.deprecation}"
>              source="${compile.source}"
>              optimize="${compile.optimize}"
>              classpathref="compile.classpath"/>
>    </target>
> ...
> ...
> ...
>       <copy todir="${deploy.dest}/lib" overwrite="yes">
>          <fileset refid="compile.libs"/>
>          <fileset refid="runtime.libs"/>
>       </copy>
>
>
> Casey B. Daniell
> Realm Business Solutions, Inc.
> 13727 Noel Rd. Suite 800
> Dallas, TX 75240
> cdaniell@realm.com <mailto:cdaniell@realm.com>
> O:(469) 791-1065
> H:(972) 980-4156
> C:(512) 589-3667
>
>
> Register Now!
> FUSION 2005 User Conference
> June 1 - 3
> San Diego, CA
> For more information or to register, visit
> www.realm.com/company/fusion.html
<http://www.realm.com/company/fusion.html>
>
>
>
> NOTICE: This communication contains information which is confidential to
> Realm Business Solutions, Inc. or its subsidiary ("Realm"). If you are not
> the intended recipient of this communication, please delete and destroy
all
> copies. If you are the intended recipient of this communication, you
should
> not copy, disclose or distribute this communication without Realm's
> authority. Any views expressed in this communication are those of the
> individual sender, except where the sender specifically states them to be
> Realm's views. Except as required by law, Realm does not represent,
warrant
> or guarantee that the integrity of this communication has been maintained
> nor that the communication is free of errors, harmful code, interception
or
> interference.
>




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

Register Now! 
FUSION 2005 User Conference 
June 1 - 3 
San Diego, CA 
For more information or to register, visit 
www.realm.com/company/fusion.html <http://www.realm.com/company/fusion.html>



NOTICE: This communication contains information which is confidential to
Realm Business Solutions, Inc. or its subsidiary ("Realm"). If you are not
the intended recipient of this communication, please delete and destroy all
copies. If you are the intended recipient of this communication, you should
not copy, disclose or distribute this communication without Realm's
authority. Any views expressed in this communication are those of the
individual sender, except where the sender specifically states them to be
Realm's views. Except as required by law, Realm does not represent, warrant
or guarantee that the integrity of this communication has been maintained
nor that the communication is free of errors, harmful code, interception or
interference.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message