| NetCOBOL Studio 使用手引書 |
目次
索引
![]()
|
以下の手順で、COBOLアプリケーションのビルド時にプリプロセッサを使用することができます。
作成するAntスクリプトの例を以下に示します。
<?xml version="1.0" encoding="SHIFT_JIS"?>
<project name="pre-processor" default="defaulttarget" basedir=".">
<!-- プリプロセッサのコマンドをvalueに指定します -->
<property name="preprocessor.command" value="sqlpcob.exe" />
<!-- プリプロセッサの引数(オプションおよび入力ファイル名)をvalueに指定します -->
<property name="preprocessor.args" value="test.eco"/>
<!-- プリプロセッサの入力ファイル名をvalueに指定します -->
<property name="source.file.name" value="test.eco" />
<!-- プリプロセッサの出力ファイル名(COBOLソースファイル名)をvalueに指定します -->
<property name="target.file.name" value="test.cob" />
<property name="target" value="incremental" />
<target name="init">
</target>
<target name="preprocess" depends="init">
<exec executable="${preprocessor.command}">
<arg line="${preprocessor.args}" />
</exec>
</target>
<target name="check.uptodate">
<uptodate property="target.uptodate" targetfile="${target.file.name}">
<srcfiles dir="${basedir}" includes="${source.file.name}" />
</uptodate>
</target>
<target name="build" depends="check.uptodate" unless="target.uptodate">
<antcall target="preprocess" />
</target>
<target name="fullbuild">
<antcall target="preprocess" />
</target>
<target name="incremental">
<antcall target="build" />
</target>
<target name="full">
<antcall target="fullbuild" />
</target>
<target name="auto">
<antcall target="build" />
</target>
<target name="defaulttarget">
<antcall target="${target}" />
</target>
</project>
上記では、サンプルとしてSymfowareのSQL-COBOLプリプロセッサである"sqlpcob.exe"を設定しています。
以下の項目をご使用の環境に合わせて設定してください。
|
プロパティ(property name) |
値(Value) |
|---|---|
|
preprocessor.command |
プリプロセッサのコマンド |
|
preprocessor.args |
プリプロセッサの引数(オプションおよび入力ファイル名) |
|
source.file.name |
プリプロセッサの入力ファイル名 |
|
target.file.name |
プリプロセッサの出力ファイル名(COBOLソースファイル名) |





|
設定項目 |
設定内容 |
|---|---|
|
名前 |
任意 |
|
引数 |
-Dtarget=${build_type} |
なお、このダイアログボックスで定義する他のフィールドは、通常は変更しないで初期表示のままにしておきます。

このとき、追加したAntスクリプトがCOBOLビルダよりも上に設定されるようにします。下に設定されている場合には、[上へ]ボタンで上になるように変更してください。
目次
索引
![]()
|