Topic
  • No replies
SystemAdmin
SystemAdmin
11979 Posts

Pinned topic Using ANT how to use EMF XSD2Java to generate Java classes from XML schema

‏2008-02-22T08:55:36Z |
Hello,
I am trying to automate generation of Java classes from XML Schema in the same way , RAD does where you can right click and say Generate Java.

I have posted my code here...I do not know what are the meanings of each attribute in the task and when I ran below script , RSA gets hanged or does nothing...
<path id="DomainModelproject.classpath.id">
<fileset dir="C:\Program Files\IBM\SDP70\configuration\org.eclipse.osgi\bundles\559\1\.cp\ant_tasks\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70\configuration\org.eclipse.osgi\bundles\1467\1\.cp\ant_tasks\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70\runtimes\base_v61\plugins\">
<include name="*/.jar"/>
</fileset>
<fileset dir="C:\Program Files\IBM\SDP70Shared\plugins\">
<include name="**/org.eclipse.xsd.ecore.importer_2.2.0.v200609210005.jar"/>
<include name="**/org.eclipse.emf.importer_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.codegen_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.common_2.2.1.v200609210005.jar"/>
<include name="**/org.eclipse.emf.converter_2.2.1.v200609210005.jar"/>

</fileset>
</path>
<taskdef name="RSAGenerateJava" classname="org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask">
<classpath refid="DomainModelproject.classpath.id"/>
</taskdef>
<target name="CreateJarDomainModelProject">
<RSAGenerateJava
model="c:/delete/addressType.xsd"
genModel="c:/delete/lib.genmodel"
>
<arg line="-packages http://www.example.eclipse.org/Library"/>
</RSAGenerateJava>
</target>