ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Correct configuration for reading a list into a Java class
Date Sun, 02 Dec 2012 15:14:45 GMT

it looks as if the fileset/includes is *too wide in scope* and needs to be tightened a bit
to specify one file at a time for pathconvert to operate on
<fileset dir="${gora.avsc.dir}" id="gora.avsc.files">
   <include name="**/*.avsc"/>
<pathconvert property="avrofiles" refid="gora.avsc.files"/> should be tightened a bit
to include just the /home/lewismc/ASF/2.x/src/gora/webpage.asvc
<fileset dir="/home/lewismc/ASF/2.x/src/gora" id="gora.asvc.files1">
 <include name="**/webpage.avsc"/> </fileset>
<pathconvert property="avrofiles" refid="gora.avsc.files1"/>
same goes with second file
<fileset dir="/home/lewismc/ASF/2.x/src/gora" id="gora.asvc.files2">
 <include name="**/host.avsc"/> </fileset>
<pathconvert property="avrofiles" refid="gora.avsc.files2"/>
pathconvert example that most closely emulates your task

<fileset dir="${src.dir}" id="src.files">
<include name="**/*.java"/>
<pathconvert pathsep="," property="javafiles" refid="src.files"/>

This example takes the set of files determined by the fileset (all files 
ending in .java), joins them together separated by commas, and places 
the resulting list into the property javafiles. 
The directory separator 
is not specified, so it defaults to the appropriate character for the current 
leads me to believe that pathconvert task in this iteration is unable to distingush one directory
from another
what would happen if you specify attribute <pathconvert dirsep=":" property="avrofiles"

Sean Connery: ..Spanner please..
Catherine Zeta Jones: what is a spanner
Sean Connery: wrench> Date: Sat, 1 Dec 2012 21:32:28 +0000
> Subject: Re: Correct configuration for reading a list into a Java class
> From:
> To:
> Hi Martin,
> On Sat, Dec 1, 2012 at 6:34 PM, Martin Gainty <> wrote:
> >
> > it appears that a upstream entity is concatenating 2 folder names (instead of one)
into your dir attribute ${gora.avsc.dir}  so when ${gora.avsc.dir} is referenced during a
file readan IO error occurs
> I understand exactly what you are saying.
> I found this thread
> Which looked horribly convoluted, so I simplified the code a bit.
>  <fileset dir="${gora.avsc.dir}" id="gora.avsc.files">
>   <include name="**/*.avsc"/>
>  </fileset>
>  <pathconvert property="avrofiles" refid="gora.avsc.files"/>
>  <target name="generate-gora-src"
>   description="--> generate the Java files from the Gora schema(s) in
> src/gora/*.avsc">
>   <java classname="org.apache.gora.compiler.GoraCompiler" fork="true">
>    <classpath refid="classpath"/>
>    <arg value="${avrofiles}"/>
>    <arg value="${src.dir}"/>
>   </java>
>  </target>
> This gives the following output
> generate-gora-src:
>      [java] 12/12/01 20:42:45 INFO compiler.GoraCompiler: Compiling
> /home/lewismc/ASF/2.x/src/gora/webpage.avsc:/home/lewismc/ASF/2.x/src/gora/host.avsc
> to ./src/java
>      [java] Exception in thread "main"
> /home/lewismc/ASF/2.x/src/gora/webpage.avsc:/home/lewismc/ASF/2.x/src/gora/host.avsc
> (No such file or directory)
> So again it looks like its concatenating the string. I'm maybe
> thinking however that this has to do with the Java class that I'm
> invoking. I'm questioning how it reads in multiple files before
> compiling. I think this is where the problem is.
> I'll keep hacking, then call back with the good news... when I get some :0)
> Thanks for your suggestions to date. I've certainly learned more about
> Ant today.
> Lewis
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message