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"
    }

  • 相关阅读:
    四、创建多线程、数据共享
    operator函数操作符
    三、线程传参
    二、线程创建、结束
    一、并发、进程、线程概念
    bagging和boosting的区别
    ID3,C4.5和CART三种决策树的区别
    7创建型模式之建造者模式
    6创建型模式之工厂模式与抽象工厂模式
    5创建型模式之简单工厂模式
  • 原文地址:https://www.cnblogs.com/qdlk/p/4950526.html
Copyright © 2011-2022 走看看