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可放到配置文件中,也可在脚本中直接写出,建议写到脚本。

posted @ 2014-04-28 16:34  PyJava老鸟  阅读(300)  评论(0编辑  收藏  举报