You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Lance Robertson <la...@jda.com> on 2004/01/27 18:35:08 UTC

Putting XMLBeans into an existing Ant Build

Hi all,
 
I've been tasked with inserting the xmlbeans stuff into our current build.
I'm by no means an ant wizard, I'm hardly even dangerous. I've been told to
ask if XMLBeans provides a taskdef for the scomp program that has to run.
I've looked through the docs but didn't really see much other than
xmlbeantask.html which didn't seem to do what I wanted. I need to have the
scomp run to produce the java file which will be compiled later in the ant
build. Does anyone know if this is provided or do I do a generic java task
with something like http://ant.apache.org/manual/CoreTasks/java.html
<http://ant.apache.org/manual/CoreTasks/java.html>  ? 
 
Thank in advance
 
Lance

RE: Putting XMLBeans into an existing Ant Build

Posted by "Yogesh L. Simmhan" <ys...@cs.indiana.edu>.
This is what I do to get the schema compiled and built from within the ant build
script.
[...]
  <!-- which schema file to build xml objects from -->
  <property name="simple_schema_file"
value="src/java/samples/simple/xsd/SimpleTypesSchema.xsd"/>
  <!-- additional configuration properties (like java package name for generated
src) for the schema -->
  <property name="simple_schema_config_file"
value="src/java/samples/simple/xsd/SimpleTypesSchema.xsdconfig"/>
  <!-- location of the xmlbean jar file -->
  <property name="xbeans.jar" value="lib/xbeans/xbean-v1.jar"/>
  <!-- schema type system name. this is appended to schema.system to get the -->
  <!-- package name for schema information files -->
  <property name="simple_schema_type_system" value="simple.types.schema"/>
  <!-- directory to which the java source files are generated. -->
  <!-- Subdirectories will be created from this location according to package
name -->
  <property name="simple_schema_src_dir" value="src/java/samples"/>
  <!-- directory to which the compiled java files and schema information files
will be copied -->
  <!-- Subdirectories will be created from this location according to package
name -->
  <property name="simple_schema_class_dir" value="build/samples"/>

  <target name="build-simple-types">
    <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean"
             classpath="${xbeans.jar}"/>
    <xmlbean download="true"
             srcgendir="${simple_schema_src_dir}"
         srconly="false"
             typesystemname="${simple_schema_type_system}"
         classpath="${xbeans.jar}"
         classgendir="${simple_schema_class_dir}">

      <fileset dir="." includes="${simple_schema_config_file}"/>
      <fileset dir="." includes="${simple_schema_file}"/>
    </xmlbean>
  </target>
[...]

--Yogesh
________________________________________
From: Lance Robertson [mailto:lance.robertson@jda.com] 
Sent: Tuesday, January 27, 2004 12:35 PM
To: 'xmlbeans-user@xml.apache.org'
Subject: Putting XMLBeans into an existing Ant Build

Hi all,
 
I've been tasked with inserting the xmlbeans stuff into our current build. I'm
by no means an ant wizard, I'm hardly even dangerous. I've been told to ask if
XMLBeans provides a taskdef for the scomp program that has to run. I've looked
through the docs but didn't really see much other than xmlbeantask.html which
didn't seem to do what I wanted. I need to have the scomp run to produce the
java file which will be compiled later in the ant build. Does anyone know if
this is provided or do I do a generic java task with something like
http://ant.apache.org/manual/CoreTasks/java.html ? 
 
Thank in advance
 
Lance


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Putting XMLBeans into an existing Ant Build

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
    <target name="xmlbeans">
        <property name="xmlbeans_compiler" value="org.apache.xmlbeans.impl.tool.SchemaCompiler"/>
        <echo message="Generating code for ${schema.file}..." />
        <java classname="${xmlbeans_compiler}" classpathref="classpath" fork="true" failonerror="true">
            <jvmarg value="-ea" />
            <arg line="-src ${generated.dir} -quiet -srconly ${schema.dir}/${schema.file}" />
        </java>
    </target>

This is for XMLBeans 1.0 from Apache CVS.  I assume something very similar 
would work for other versions.  I mostly stole it from an XMLBeans 
example in the CVS tree.  It write out source code, and then a normal 
javac task compiles it later.

Aaron

On Tue, 27 Jan 2004, Lance Robertson wrote:
> Hi all,
>  
> I've been tasked with inserting the xmlbeans stuff into our current build.
> I'm by no means an ant wizard, I'm hardly even dangerous. I've been told to
> ask if XMLBeans provides a taskdef for the scomp program that has to run.
> I've looked through the docs but didn't really see much other than
> xmlbeantask.html which didn't seem to do what I wanted. I need to have the
> scomp run to produce the java file which will be compiled later in the ant
> build. Does anyone know if this is provided or do I do a generic java task
> with something like http://ant.apache.org/manual/CoreTasks/java.html
> <http://ant.apache.org/manual/CoreTasks/java.html>  ? 
>  
> Thank in advance
>  
> Lance
> 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


RE: Putting XMLBeans into an existing Ant Build

Posted by "Yogesh L. Simmhan" <ys...@cs.indiana.edu>.
This is what I do to get the schema compiled and built from within the ant build
script.
[...]
  <!-- which schema file to build xml objects from -->
  <property name="simple_schema_file"
value="src/java/samples/simple/xsd/SimpleTypesSchema.xsd"/>
  <!-- additional configuration properties (like java package name for generated
src) for the schema -->
  <property name="simple_schema_config_file"
value="src/java/samples/simple/xsd/SimpleTypesSchema.xsdconfig"/>
  <!-- location of the xmlbean jar file -->
  <property name="xbeans.jar" value="lib/xbeans/xbean-v1.jar"/>
  <!-- schema type system name. this is appended to schema.system to get the -->
  <!-- package name for schema information files -->
  <property name="simple_schema_type_system" value="simple.types.schema"/>
  <!-- directory to which the java source files are generated. -->
  <!-- Subdirectories will be created from this location according to package
name -->
  <property name="simple_schema_src_dir" value="src/java/samples"/>
  <!-- directory to which the compiled java files and schema information files
will be copied -->
  <!-- Subdirectories will be created from this location according to package
name -->
  <property name="simple_schema_class_dir" value="build/samples"/>

  <target name="build-simple-types">
    <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean"
             classpath="${xbeans.jar}"/>
    <xmlbean download="true"
             srcgendir="${simple_schema_src_dir}"
         srconly="false"
             typesystemname="${simple_schema_type_system}"
         classpath="${xbeans.jar}"
         classgendir="${simple_schema_class_dir}">

      <fileset dir="." includes="${simple_schema_config_file}"/>
      <fileset dir="." includes="${simple_schema_file}"/>
    </xmlbean>
  </target>
[...]

--Yogesh
________________________________________
From: Lance Robertson [mailto:lance.robertson@jda.com] 
Sent: Tuesday, January 27, 2004 12:35 PM
To: 'xmlbeans-user@xml.apache.org'
Subject: Putting XMLBeans into an existing Ant Build

Hi all,
 
I've been tasked with inserting the xmlbeans stuff into our current build. I'm
by no means an ant wizard, I'm hardly even dangerous. I've been told to ask if
XMLBeans provides a taskdef for the scomp program that has to run. I've looked
through the docs but didn't really see much other than xmlbeantask.html which
didn't seem to do what I wanted. I need to have the scomp run to produce the
java file which will be compiled later in the ant build. Does anyone know if
this is provided or do I do a generic java task with something like
http://ant.apache.org/manual/CoreTasks/java.html ? 
 
Thank in advance
 
Lance


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Putting XMLBeans into an existing Ant Build

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
    <target name="xmlbeans">
        <property name="xmlbeans_compiler" value="org.apache.xmlbeans.impl.tool.SchemaCompiler"/>
        <echo message="Generating code for ${schema.file}..." />
        <java classname="${xmlbeans_compiler}" classpathref="classpath" fork="true" failonerror="true">
            <jvmarg value="-ea" />
            <arg line="-src ${generated.dir} -quiet -srconly ${schema.dir}/${schema.file}" />
        </java>
    </target>

This is for XMLBeans 1.0 from Apache CVS.  I assume something very similar 
would work for other versions.  I mostly stole it from an XMLBeans 
example in the CVS tree.  It write out source code, and then a normal 
javac task compiles it later.

Aaron

On Tue, 27 Jan 2004, Lance Robertson wrote:
> Hi all,
>  
> I've been tasked with inserting the xmlbeans stuff into our current build.
> I'm by no means an ant wizard, I'm hardly even dangerous. I've been told to
> ask if XMLBeans provides a taskdef for the scomp program that has to run.
> I've looked through the docs but didn't really see much other than
> xmlbeantask.html which didn't seem to do what I wanted. I need to have the
> scomp run to produce the java file which will be compiled later in the ant
> build. Does anyone know if this is provided or do I do a generic java task
> with something like http://ant.apache.org/manual/CoreTasks/java.html
> <http://ant.apache.org/manual/CoreTasks/java.html>  ? 
>  
> Thank in advance
>  
> Lance
> 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/