zoukankan      html  css  js  c++  java
  • gradle中调用ant.unzip对zip包解压缩

    任务:拷贝第三方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"
    }

  • 相关阅读:
    Asp.Net Web API 2第一课——入门
    Servlet之ServletContext获取web上下文路径、全局参数、和Attribute(域)
    jsp 获取服务器ip 以及端口号
    对String值不可变的理解以及String类型的引用传递问题
    关于 SAXParseException Content is not allowed in Prolog (前言中不允许有内容)
    用tomcat插件 在Eclipse 中配置Tomcat项目
    docker保存日志文件到本地
    java split函数结尾空字符串被丢弃的问题
    byte类型的127+1=-128?
    java 中 Integer 传参方式的问题
  • 原文地址:https://www.cnblogs.com/qdlk/p/4950526.html
Copyright © 2011-2022 走看看