Ant步步为营(1)解压本地的zip包
不多说:
在eclipse上新建一个ant project,新建一个,build.xml 文件(ant 默认情况下是执行build.xml文件)。
解压脚本如下:
<?xml version="1.0"?>
<project name="ForTest" default="unzip" >
<property file="build.properties"></property>
<target name="unzip" description="unzip the zip package">
<unzip dest="${file.dir}">
<fileset dir="${file.dir}">
<include name="**/*.zip"/>
</fileset>
</unzip>
</target>
</project>
file.dir是本地的zip所在路径,build.properties是一个配置文件。file.dir可放到配置文件中,也可在脚本中直接写出,建议写到脚本。
浙公网安备 33010602011771号