antを使ってみる

今まではコマンドラインからDITAをPDFへ変換させていたけれども,Antを使ってみる.
とは言っても,XMLをかじっていない私でもあまりにも簡単すぎました.
参考ファイルはantディレクトリにあるtemplate_pdf.xmlとsample_pdf.xml
template_pdf.xmlをDITAコンテンツのディレクトリにコピーして,設定部分を書き換えます.

<project name="pf3manual_pdf" default="pf3manual2pdf" basedir=".">
  
  <!-- dita.dir should point to the toolkit's root directory -->
  <property name="dita.dir" value="${basedir}${file.separator}.."/>
  
  <!-- if file is a relative file name, the file name will be resolved 
       relative to the importing file -->
  <import file="${dita.dir}${file.separator}integrator.xml"/>
  
  <target name="pf3manual2pdf" depends="integrate">
    <ant antfile="${dita.dir}${file.separator}build.xml" target="init">
      <!-- please refer to the toolkit's document for supported parameters, and 
           specify them base on your needs -->
      <property name="args.input" value="pf3manual.ditamap"/>
      <property name="output.dir" value="pdf"/>
      <property name="transtype" value="pdf"/>
    </ant>
  </target>
</project>

注意点としてはoutput.dirにフォントメトリックスファイル(msmincho.xml,msgothic.xml)とuserconfig.xmlがあること.
フォントメトリックスファイルの作成は他の人へ展開するときのハードルになるので,FOPではなくてRenderX XEPへ変更をする方向で考えてます.やっぱりApache FOPしか今のところ,うちの会社っぽくないようです.(4/1追記)