当前位置:   article > 正文

ProGuard 应用Gradle Task_proguardtask

proguardtask

ProGuard can be run as a task in the Java-based build tool Gradle (version 2.1 or higher).

ProGuard可以作为一个任务运行在基于java的构建工具Gradle(版本2.1或更高版本)。

Before you can use the proguard task, you have to make sure Gradle can find it in its class path at build time. One way is to add the following line to your build.gradle file:

您可以使用ProGuard 之前,您必须确保它可以找到它在构建时的类路径。一种方法是添加 build.gradle 文件

buildscript {
    repositories {
        flatDir dirs: '/usr/local/java/proguard/lib'
    }
    dependencies {
        classpath ':proguard:'
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

Please make sure the class path is set correctly for your system.

请确保您的系统类路径设置正确。

You can then define a task:

你可以定义一个task

task myProguardTask(type: proguard.gradle.ProGuardTask) {
    .....
}
  • 1
  • 2
  • 3

The embedded configuration is much like a standard ProGuard configuration. Notable similarities and differences:

嵌入的配置是更像一个标准ProGuard 配置。明显的异同

  • Like in ProGuard-style configurations, we’re using all lower-case names for the settings.
  • The options don’t have a dash as prefix.
  • Arguments typically have quotes.
  • Some settings are specified as named arguments.

    • 像ProGuard的配置,我们使用所有小写名称的设置
    • 选项没有前缀
    • 参数通常有引用
    • 一些设置指定为命名参数

You can find some sample build files in the examples/gradle directory of the ProGuard distribution.

你可以在examples/ gradle 目录下找到一些ProGuard 描述的示例构建文件

Setting

The ProGuard task supports the following settings in its closure:
ProGuard 任务支持以下设置

configuration files
  • Read and merge options from the given ProGuard-style configuration files. The files are resolved and parsed lazily, during the execution phase.

从给定的ProGuard-style阅读和合并选项配置文件。文件在执行阶段解析

injars class_path

未完待续

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/1015795
推荐阅读
相关标签
  

闽ICP备14008679号