jjkingの日記: Ant で Castor を使う (全部コンパイル)
日記 by
jjking
<target name="compile_schema_all">
<path id="path.schema">
<fileset dir="." >
<include name="*.xsd"/>
</fileset>
</path>
<foreach target="compile_schema" param="file.schema">
<path refid="path.schema"/>
</foreach>
</target>
<target name="compile_schema">
<java classname="org.exolab.castor.builder.SourceGenerator" fork="yes">
<arg line="-f"/>
<arg line="-i ${file.schema}"/>
<arg line="-dest src/java"/>
<arg line="-binding-file castor_binding.xml"/>
<classpath refid="path.class"/>
</java>
</target>
※ foreach タスクは内包する path を順番に param 属性で指定されたプロパティに設定して、指定された target をサブルーチンのように呼び出すというものらしい。
<path id="path.schema">
<fileset dir="." >
<include name="*.xsd"/>
</fileset>
</path>
<foreach target="compile_schema" param="file.schema">
<path refid="path.schema"/>
</foreach>
</target>
<target name="compile_schema">
<java classname="org.exolab.castor.builder.SourceGenerator" fork="yes">
<arg line="-f"/>
<arg line="-i ${file.schema}"/>
<arg line="-dest src/java"/>
<arg line="-binding-file castor_binding.xml"/>
<classpath refid="path.class"/>
</java>
</target>
※ foreach タスクは内包する path を順番に param 属性で指定されたプロパティに設定して、指定された target をサブルーチンのように呼び出すというものらしい。
Ant で Castor を使う (全部コンパイル) More ログイン