清单 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. 自动化过程
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/










