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"/>
</fileset>
<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"/>
</fileset>
<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
platform.
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" refid="gora.avsc.files"/>
http://ant.apache.org/manual/Tasks/pathconvert.html
HTH
Martin
______________________________________________
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: [email protected]
> To: [email protected]
>
> Hi Martin,
> On Sat, Dec 1, 2012 at 6:34 PM, Martin Gainty <[email protected]> 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
> http://www.mail-archive.com/[email protected]/msg28390.html
> 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" java.io.FileNotFoundException:
> /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: [email protected]
> For additional commands, e-mail: [email protected]
>