ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Patternsets, Filesets, and Mapper
Date Thu, 28 Feb 2002 05:08:46 GMT
--- wrote:
> No, my patternset was like:
> <patternset id="packages">
>   <include name="com.mycompany.util.class1"/>
>   <include name=""/>
>   <!-- about 40 more package names -->
> </patternset>

Okay, this is where I get confused. Is com.mycompany.util.class1 actually
a package name -- or is it the name of a class within the
com.mycompany.util package?

[From your other reply]
> I mean, if you can provide me the correct way to do it with the current
> codebase, great --

Well, assuming the above question's answer is the "or", the following
build.xml file should give you, from a fileset of .java source filenames,
a comma-separated list of the same set of files with .class suffixes (with
the path changed to be in a build/classes dir) and a comma-separated list
of the same set of files in the dot-notation you show above (note: it does
require 1.5alpha for the <replaceregexp> task, but I believe that is what
you're using, right?):
<project name="malachi" default="genLists">

  <fileset dir="src" id="srcfiles">
    <include name="com/mycompany/util/"/>
    <include name="com/mycompany/io/"/>

  <target name="genLists" depends="setClassList,setPkgList">
    <echo message="classfiles = ${classfiles}"/>
    <echo message="pkglist = ${pkglist}"/>

  <target name="setClassList">
    <delete file=""/>
    <pathconvert pathsep="," property="classes" refid="srcfiles">
      <map from="${basedir}${file.separator}src"
    <propertyfile file="">
      <entry key="classfiles" value="${classes}"/>
    <replace file="">
      <replacefilter token=".java" value=".class"/>
    <property file=""/>

  <target name="setPkgList">
    <delete file=""/>
    <pathconvert pathsep="," dirsep="." property="pkgs" refid="srcfiles">
      <map from="${basedir}" to=""/>
    <propertyfile file="">
      <entry key="pkglist" value="${pkgs}"/>
    <replace file="">
      <replacefilter token=".src." value=""/>
    <replaceregexp file=""
    <property file=""/>




Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!

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

View raw message