清單 1. Ant 構建文件的初始布局
<?xml version="1.0" encoding="UTF-8"?> <project name="Automation Project" default="init" basedir="."> <!-- Read project properties from a properties file. --> <property file="build.properties" /> <!-- A stub for the default target --> <target name="init" description="Initialize automation environment"> <!-- Set the standard DSTAMP, TSTAMP, and TODAY properties. --> <tstamp /> <!-- Set a variable to host environment variables. --> <property environment="env" /> <!-- Print the current WORKSPACE value. --> <echo message="Workspace: ${env.WORKSPACE}" /> <!-- Delete old export directory. --> <delete dir="${destination.dir}" /> <!-- Create the target export directory for the build. --> <mkdir dir="${destination.dir}" /> </target> </project> |
可以現在下載完整的 Ant 構建文件 ar-autotaskcode.zip。
在包含 Ant 構建項目的同一個目錄中創建屬性文件來存儲其屬性。ar-autotaskcode.zip 中也提供了完整的屬性文件。
現在 Ant 構建文件已經準備好開始添加表示自動化過程的新 Ant 目標了。
圖 2顯示了構建自動化程序的摘要。
圖 2. 自動化過程

延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/