zoukankan      html  css  js  c++  java
  • gradle 内容学习参考

    1、用Gradle打包出jar文件

    http://unclechen.github.io/2015/10/25/Gradle%E5%AE%9E%E8%B7%B5%E4%B9%8B%E6%89%93%E5%8C%85jar+Log%E5%BC%80%E5%85%B3%E8%87%AA%E5%8A%A8%E5%85%B3%E9%97%AD/

    https://www.jianshu.com/p/ed4ef3b96a29

    2、在Android Studio中编译出jar包

    gradle中支持jar操作,可以将classes.dex直接变成jar包:不过当前的gradle一定是编译apk的型:com.android.application

    task makeSDKJar(dependsOn: "assembleRelease", type: Jar) {
        baseName 'finaljar'
        from('build/intermediates/transforms/jack/release/classes.dex')
        destinationDir = file("output")
    }

    3、执行shell脚本,判断文件是否存在

    def targetPath = file("YOUR/TARGET/FILES")
    task shellexe(type: Exec) {
    
        if (!targetPath.exists()) {
            project.exec {
                println "the path is not exsit."
                commandLine "./shelldemo.sh"
            }
        }
    
        else println "preprocess the path is  exsit already."
    
    }

    4、task clean只能在根目录的build.gradle下面定义,不能够在其它目录下面的gradle定义。

  • 相关阅读:
    php 导出csv文件
    dns 服务器配置
    ettercap ARP dns 欺骗
    for循环内 执行$ajax(){}
    js 如何生成二维数组
    jquery读取csv文件并用json格式输出
    echo 换行
    cmd命令运行php,php通过cmd运行文件
    Git 常用命令整理
    图像裁剪插件
  • 原文地址:https://www.cnblogs.com/usec/p/9007443.html
Copyright © 2011-2022 走看看