ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: fileset/dirset on dirs with regex
Date Thu, 14 Nov 2002 18:59:18 GMT
I see what you mean. I see 3 possible solutions, from better to worse:

1) Write a custom task. This is fun, and not too difficult. In your case
   all you have to do a take a <dirset> and <patternset> as arguments, and
   dynamically create the <jar> task inside your custom task, configuring
   it with the <dirset> and <patternset> info.

2) Same as above, but with a <script>. I really think it's doable!

3) Use the dreaded <foreach> with <jar update="true"/>.

I personally don't like #3, and would go with either #1 or #2. But that's
just me of course ;-) --DD

-----Original Message-----
From: Sebastien BLANC [mailto:Sebastien.Blanc@alcatel.com] 
Sent: Thursday, November 14, 2002 12:49 PM
To: Ant Users List
Subject: Re: fileset/dirset on dirs with regex

I'm already using this task combined with xdoclet for jar generation. my pb
is
more ant oriented:
here was I have to do curently. I'd like 2 find a clean way (mroe dynamic)
to do
it with ant.
seb.

   <target name="clt" depends="init">
        <property name="jar" value="/vobs/gemlegacy/EML/jlib/GemFwkEjb.jar"
/>
 <delete file="${jar}" />
 <jar update="false" jarfile="${jar}">
 <fileset dir="${top.dir}/pkg/ejb-jar-ems-ems"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-ems-link"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-ems-ne"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-ems-NeDirectory"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Cid"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Connection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-ConnectionManagement"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-CrossConnection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Database"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Defaults"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Domain"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Equipment"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Facility"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Partition"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-PerformanceMonitoring"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Protection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Security"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Session"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*SessionSession.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-SigTable"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-SWManagement"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Synchronization"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-System"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-TestAccess"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gem-Training"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-Base"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-CC"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-EMS"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-EquipmentOrHolder"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-Event"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-MaintenanceOperation"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-ManagedElement"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-PMData"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-ProtectionGroup"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-Route"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-SNC"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-Subnetwork"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-TerminationPoint"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-TopologicalLink"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-gm3-TrafficDescriptor"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-CommPorts"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Connection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-ConnectionManagement"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-CrossConnection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Defaults"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-entity"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Equipment"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Facility"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Partition"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-PerformanceMonitoring"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Protection"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Security"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-SigTable"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-SWManagement"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Synchronization"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-System"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-TestAccess"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 <fileset dir="${top.dir}/pkg/ejb-jar-tl1-Training"
  includes="**/*.class"
  excludes="**/*EJB.class, **/*CMP.class, **/*MDB.class, **/*Local.class,
**/*LocalHome.class, **/*Session.class" />
 </jar>
   </target>

Dominique Devienne wrote:

> Have you looked at the <ejbjar> task? I know nothing about it, but it
sounds
> like it might be designed for what you're trying to do!?!?!? --DD
>
> -----Original Message-----
> From: Sebastien BLANC [mailto:Sebastien.Blanc@alcatel.com]
> Sent: Wednesday, November 13, 2002 8:04 PM
> To: ant-user@jakarta.apache.org
> Subject: fileset/dirset on dirs with regex
>
> Hello !
> I'm trying to produce a jar from the following configuration:
> I want to jar all the classes under n directories, these directories can
> all be described by the following regex: ejb-jar-*.
> the problem is that I can't see how to compute this set of directories
> coz if I give a fileset ejb-jar-*/**/*.class to the jar task then I get
> ejb-jar in the package name and I don't want it.
> thank you for help.
> seb.

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


Mime
View raw message