码迷,mamicode.com
首页 > 其他好文 > 详细

gradle中调用ant.unzip对zip包解压缩

时间:2015-11-09 18:55:04      阅读:738      评论:0      收藏:0      [点我收藏+]

标签:

任务:拷贝第三方jar的zip包到lib,unzip到temp目录,把其中的jar拷贝到lib目录,把zip和产生的中间文件删掉。

apply plugin: ‘java‘
def root = file(‘..‘)
copy {
    from "${root}/3rdpartyinternal/selenium_java/selenium-java-2.47.1.zip"
    into "lib"
}
ant.unzip(src:"lib/selenium-java-2.47.1.zip", dest:"temp")
    copy {
    from "temp/selenium-2.47.1/selenium-java-2.47.1.jar"
    from "temp/selenium-2.47.1/libs/apache-mime4j-0.6.jar"
    from "temp/selenium-2.47.1/libs/bsh-1.3.0.jar"
    from "temp/selenium-2.47.1/libs/cglib-nodep-2.1_3.jar"
    from "temp/selenium-2.47.1/libs/commons-codec-1.10.jar"
    from "temp/selenium-2.47.1/libs/commons-collections-3.2.1.jar"
    from "temp/selenium-2.47.1/libs/commons-exec-1.3.jar"
    from "temp/selenium-2.47.1/libs/commons-io-2.4.jar"
    from "temp/selenium-2.47.1/libs/commons-lang3-3.4.jar"
    from "temp/selenium-2.47.1/libs/commons-logging-1.1.3.jar"
    from "temp/selenium-2.47.1/libs/cssparser-0.9.16.jar"
    from "temp/selenium-2.47.1/libs/gson-2.3.1.jar"
    from "temp/selenium-2.47.1/libs/guava-18.0.jar"
    from "temp/selenium-2.47.1/libs/hamcrest-core-1.3.jar"
    from "temp/selenium-2.47.1/libs/hamcrest-library-1.3.jar"
    from "temp/selenium-2.47.1/libs/htmlunit-2.17.jar"
    from "temp/selenium-2.47.1/libs/htmlunit-core-js-2.17.jar"
    from "temp/selenium-2.47.1/libs/httpclient-4.4.1.jar"
    from "temp/selenium-2.47.1/libs/httpcore-4.4.1.jar"
    from "temp/selenium-2.47.1/libs/httpmime-4.4.1.jar"
    from "temp/selenium-2.47.1/libs/jcommander-1.29.jar"
    from "temp/selenium-2.47.1/libs/jetty-io-9.2.11.v20150529.jar"
    from "temp/selenium-2.47.1/libs/jetty-util-9.2.11.v20150529.jar"
    from "temp/selenium-2.47.1/libs/jna-4.1.0.jar"
    from "temp/selenium-2.47.1/libs/jna-platform-4.1.0.jar"
    from "temp/selenium-2.47.1/libs/junit-4.12.jar"
    from "temp/selenium-2.47.1/libs/nekohtml-1.9.22.jar"
    from "temp/selenium-2.47.1/libs/netty-3.5.7.Final.jar"
    from "temp/selenium-2.47.1/libs/phantomjsdriver-1.2.1.jar"
    from "temp/selenium-2.47.1/libs/sac-1.3.jar"
    from "temp/selenium-2.47.1/libs/serializer-2.7.2.jar"
    from "temp/selenium-2.47.1/libs/testng-6.8.5.jar"
    from "temp/selenium-2.47.1/libs/websocket-api-9.2.11.v20150529.jar"
    from "temp/selenium-2.47.1/libs/websocket-client-9.2.11.v20150529.jar"
    from "temp/selenium-2.47.1/libs/websocket-common-9.2.11.v20150529.jar"
    from "temp/selenium-2.47.1/libs/xalan-2.7.2.jar"
    from "temp/selenium-2.47.1/libs/xercesImpl-2.11.0.jar"
    from "temp/selenium-2.47.1/libs/xml-apis-1.4.01.jar"
    into "lib"

if (file("lib/selenium-java-2.47.1.zip").exists()) {
    file("lib/selenium-java-2.47.1.zip").delete()
    file("temp").deleteDir()  
}
dependencies {
    compile fileTree(‘lib‘)
    compile project(‘:Automation_Fwk‘)
}
sourceSets {
    main {
        java {
            srcDir ‘src‘
        }
    }
}

jar {
    archiveName = "tests.jar"
}

gradle中调用ant.unzip对zip包解压缩

标签:

原文地址:http://www.cnblogs.com/qdlk/p/4950526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!