博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gradle 笔记
阅读量:6227 次
发布时间:2019-06-21

本文共 3314 字,大约阅读时间需要 11 分钟。

1. 各种options

Simon@ZOUYUN-PC /f/AndroidstudioProjects/KeyguardTest (master)$ gradle --helpUSAGE: gradle [option...] [task...]-?, -h, --help          Shows this help message.-a, --no-rebuild        Do not rebuild project dependencies.-b, --build-file        Specifies the build file.-c, --settings-file     Specifies the settings file.--configure-on-demand   Only relevant projects are configured in this build run. This means faster build for large multi-project builds. [incubating]--continue              Continues task execution after a task failure.-D, --system-prop       Set system property of the JVM (e.g. -Dmyprop=myvalue).-d, --debug             Log in debug mode (includes normal stacktrace).--daemon                Uses the Gradle daemon to run the build. Starts the daemon if not running.--foreground            Starts the Gradle daemon in the foreground. [incubating]-g, --gradle-user-home  Specifies the gradle user home directory.--gui                   Launches the Gradle GUI.-I, --init-script       Specifies an initialization script.-i, --info              Set log level to info.-m, --dry-run           Runs the builds with all task actions disabled.--no-color              Do not use color in the console output.--no-daemon             Do not use the Gradle daemon to run the build.--offline               The build should operate without accessing network resources.-P, --project-prop      Set project property for the build script (e.g. -Pmyprop=myvalue).-p, --project-dir       指定项目的文件夹,编译子项目是使用 Specifies the start directory for Gradle. Defaults to current directory.  --parallel              Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating]--parallel-threads      Build projects in parallel, using the specified number of executor threads. [incubating]--profile               Profiles build execution time and generates a report in the 
/reports/profile directory.--project-cache-dir Specifies the project-specific cache directory. Defaults to .gradle in the root project directory.-q, --quiet Log errors only.--recompile-scripts Force build script recompiling.--refresh-dependencies Refresh the state of dependencies.--rerun-tasks Ignore previously cached task results.-S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions.-s, --stacktrace Print out the stacktrace for all exceptions.--stop Stops the Gradle daemon if it is running.-u, --no-search-upward Don't search in parent folders for a settings.gradle file.-v, --version Print version info.-x, --exclude-task Specify a task to be excluded from execution.

2. Tasks

  gradle projects 查看项目

  gradle tasks --all  查看task

  gradle help --task someTask 可以获取到 task 的详细信息

  gradle dependencies 会列出项目每个task的依赖列表, 可以通过 --configuration 指定具体的task

    eg.  gradle -q app:dependencies --configuration compile   
       gradle -q -p app/ dependencies --configuration compile
      指定具体的项目可以用 -p 指定项目路径, 或者 projectName:taskName

  gradle properties 可以获取项目所有属性列表

  

 

3.配置

  build.gradle 

  gradle.properties  属性配置

  settings.gradle  子项目配置

 

参考: https://github.com/waylau/Gradle-2-User-Guide/blob/master/SUMMARY.md

转载于:https://www.cnblogs.com/iori-zy/p/4330554.html

你可能感兴趣的文章
pytest文档7-pytest-html生成html报告
查看>>
java中this的N种使用方法
查看>>
Windows IIS安装php
查看>>
mingw 设置python 设置git环境变量
查看>>
linux 系统下如何进行用户之间的切换
查看>>
Socket拆包和解包
查看>>
工作之忠、智、勇
查看>>
电子书下载:Beginning Nokia Apps Development: Using MeeGo, Mobile QT and OpenSymbian
查看>>
mysql 5.0存储过程学习总结
查看>>
matlab练习程序(Ritter‘s最小包围圆)
查看>>
SQL存储过程教程
查看>>
最详细的临时表,表变量的对比
查看>>
C#中直接打印Report文件(rdlc)
查看>>
引用计数
查看>>
C#:XML操作类 (转)
查看>>
struts2 API chm帮助文档生成介绍说明(转)
查看>>
数据字典统一管理,动态下拉框
查看>>
汽车常识全面介绍 - 引擎详论
查看>>
枚举类型、结构体和类的区别
查看>>
AngularJS使用ngMessages进行表单验证
查看>>