Ounce/Ant 和 Apache/Ant 整合
這個作業主題所概述的步驟,是要將 Ounce/Ant 整合到 Apache/Ant 建置環境所需要的步驟。
程序
- 將 ounceant.jar 檔和(選擇性)ant-contrib-1.0b3.jar 複製到 ant lib 目錄。
如果 Ant 外掛程式是 1.8.1 版或更新版本,也請複製 xml-api.jar 和 xercesImpl.jar。
AppScan® 源 安裝會將 ounceant.jar 和 ant-contrib-1.0b3.jar、xml-api.jar 及 xercesImpl.jar 放置在 <install_dir>\lib 中(其中 <install_dir> 是您的 AppScan® 源 安裝的位置)。
- 選擇性的: 覆寫
build.compiler
內容。如需覆寫
build.compiler
的相關資訊,請參閱建立專案。使用下列其中一項方法置換這項內容:
- 在 build.xml 檔案中使用內容標籤。
<property name="build.compiler" value="com.ouncelabs.ounceant.OunceCompilerAdapter"/>
- 使用
-D
選項呼叫 Ant 時,在指令行指定build.compiler
的值。ant -Dbuild.compiler= com.ouncelabs.ounceant.OunceCompilerAdapter
- 在文字檔中併入
build.compiler
的值,並指示 Ant 使用properties
選項,以載入該檔案中的內容,如 Ant 文件所述。
- 在 build.xml 檔案中使用內容標籤。
- 建立
taskdefs
。如果要使用 Ounce/Ant 作業,您必須在
taskdef
作業中參照 ounceant.jar。例如,<taskdef resource="com/ouncelabs/ounceant/task/ounce.xml" classpath="ounceant.jar"/>
如果要使用
var
作業,ant-contrib-1.0b3.jar 必須參照taskdef
作業,如下所示:<taskdef resource="net/sf/antcontrib/antlib.xml"/>