ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lewis John Mcgibbney <>
Subject Correct configuration for reading a list into a Java class
Date Sat, 01 Dec 2012 16:25:54 GMT
Hi All,

I've done a fiar bit of digging on this one on user@ archives and
there have been various threads on the topic. I understand that the
solution to reading in multiple files an executing them with the java
element is a custom solution. The problem is pretty simple. I have a
directory of avro schemas which I would like to pass to a GoraCompiler
class to be compiled.

So far I've got

 <!-- ====================================================== -->
 <!-- Generate the Java files from the GORA schemas          -->
 <!-- Will call this automatically later                     -->
 <!-- ====================================================== -->
 <!-- map for the gora .avsc files contained in ./src/gora/
      so they can be passed as a list to the GoraCompiler
      via the generate-gora-src target                -->
 <fileset dir="${gora.avsc.dir}" id="gora.avsc.files">
  <include name="*.avsc"/>
 <pathconvert property="goraavscfiles" refid="gora.avsc.files">
  <map from="${goraavscdir}" to=""/>

 <target name="generate-gora-src"
  description="> generate the Java files from the Gora schema(s) in
  <java classname="org.apache.gora.compiler.GoraCompiler" fork="true">
   <classpath refid="classpath"/>
   <arg value="${goraavscfiles}"/>
   <arg value="${src.dir}"/>

When I execute I get

     [java] 12/12/01 16:22:09 INFO compiler.GoraCompiler: Compiling
schema file: /home/lewismc/ASF/2.x/src/gora/host.avsc:/home/lewismc/ASF/2.x/src/gora/webpage.avsc
to: ./src/java
     [java] Exception in thread "main"
(No such file or directory)
     [java] 	at Method)
     [java] 	at<init>(
     [java] 	at
     [java] 	at org.apache.avro.Schema.parse(
     [java] 	at
     [java] 	at
     [java] Java Result: 1

Total time: 6 seconds

If someone could please help me to understand how to separate the
files into the required File [] list then that would be great. I
should make it clear that I've discovered pathconvert's pathsep
attribute but it still seems to be a string being passed as oppose to
a separated list of files.
I should also note that making the target accept a single explicit
file works perfectly, so I know my configuration is in the way I'm
constructing the mappings.

Thanks very much in advance



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

View raw message