How can I unzip a specific folder?

后端 未结 3 2212
名媛妹妹
名媛妹妹 2021-02-19 12:16

How can I unzip a specific folder with Ant?

Specifically, I have downloaded apache-tomcat-6.0.29.zip which contains the folder \"apache-tomcat-6.0.29\". I want Ant to u

相关标签:
3条回答
  • 2021-02-19 12:37

    You can use a mapper within the unzip task to change the paths written.

    <unzip dest="${release.dir}/image/tomcat" src="${tomcat.zip}">
        <patternset>
            <include name="apache-tomcat-6.0.29/*"/>
        </patternset>
        <mapper>
            <globmapper from="apache-tomcat-6.0.29/*" to="*"/>
        </mapper>
    </unzip>
    
    0 讨论(0)
  • 2021-02-19 12:41
    <unzip dest="${release.dir}/image/tomcat" src="${tomcat.zip}">
        <patternset>
            <!-- add another star -->
            <include name="apache-tomcat-6.0.29/**"/>
        </patternset>
    </unzip>
    
    0 讨论(0)
  • 2021-02-19 12:43

    The following works as long that there is a single directory in the tomcat archive.

    <untar src="${release.dir}" dest="${tomcat.tar.gz}" compression="gzip">
      <cutdirsmapper dirs="1" />
    </untar>
    
    0 讨论(0)
提交回复
热议问题