http://www.gradle.org/docs/current/userguide/gradle_command_line.html

Appendix D. Gradle Command Line

The gradle command has the following usage:

gradle [option...] [task...]

The command-line options available for the gradle command are listed below:

-?-h--help

Shows a help message.

-a--no-rebuild

Do not rebuild project dependencies.

--all

Shows additional detail in the task listing. See Section 11.6.2, “Listing tasks”.

-b--build-file

Specifies the build file. See Section 11.5, “Selecting which build to execute”.

-c--settings-file

Specifies the settings file.

--continue

Continues task execution after a task failure.

--configure-on-demand (incubating)

Only relevant projects are configured in this build run. This means faster builds for large multi-projects. See Section 57.1.1.1, “Configuration on demand”.

-D--system-prop

Sets a system property of the JVM, for example -Dmyprop=myvalue. See Section 14.2, “Gradle properties and system properties”.

-d--debug

Log in debug mode (includes normal stacktrace). See Chapter 18, Logging.

-g--gradle-user-home

Specifies the Gradle user home directory. The default is the .gradle directory in the user's home directory.

--gui

Launches the Gradle GUI. See Chapter 12, Using the Gradle Graphical User Interface.

-I--init-script

Specifies an initialization script. See Chapter 61, Initialization Scripts.

-i--info

Set log level to info. See Chapter 18, Logging.

-m--dry-run

Runs the build with all task actions disabled. See Section 11.7, “Dry Run”.

--no-color

Do not use color in the console output.

--offline

Specifies that the build should operate without accessing network resources. See Section 51.9.2, “Command line options to override caching”.

-P--project-prop

Sets a project property of the root project, for example -Pmyprop=myvalue. See Section 14.2, “Gradle properties and system properties”.

-p--project-dir

Specifies the start directory for Gradle. Defaults to current directory. See Section 11.5, “Selecting which build to execute”.

--parallel (incubating)

Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. This option should only be used with decoupled projects (see Section 57.9, “Decoupled Projects”).

--parallel-threads (incubating)

Build projects in parallel, using the specified number of executor threads. For example--parallel-threads=3. This option should only be used with decoupled projects (see Section 57.9, “Decoupled Projects”).

--profile

Profiles build execution time and generates a report in the buildDir/reports/profile directory. See Section 11.6.7, “Profiling a build”.

--project-cache-dir

Specifies the project-specific cache directory. Default value is .gradle in the root project directory. See Section 14.6, “Caching”.

-q--quiet

Log errors only. See Chapter 18, Logging.

--recompile-scripts

Specifies that cached build scripts are skipped and forced to be recompiled. See Section 14.6, “Caching”.

--refresh-dependencies

Refresh the state of dependencies. See Section 51.9.2, “Command line options to override caching”.

--rerun-tasks

Specifies that any task optimization is ignored.

-S--full-stacktrace

Print out the full (very verbose) stacktrace for any exceptions. See Chapter 18, Logging.

-s--stacktrace

Print out the stacktrace also for user exceptions (e.g. compile error). See Chapter 18, Logging.

-u--no-search-upwards

Don't search in parent directories for a settings.gradle file.

-v--version

Prints version info.

-x--exclude-task

Specifies a task to be excluded from execution. See Section 11.2, “Excluding tasks”.

The above information is printed to the console when you execute gradle -h.

D.1. Daemon command-line options:

The Chapter 19, The Gradle Daemon contains more information about the daemon. For example it includes information how to turn on the daemon by default so that you can avoid using --daemon all the time.

--daemon

Uses the Gradle daemon to run the build. Starts the daemon if not running or existing daemon busy. Chapter 19, The Gradle Daemon contains more detailed information when new daemon processes are started.

--foreground

Starts the Gradle daemon in the foreground. Useful for debugging or troubleshooting because you can easily monitor the build execution.

--no-daemon

Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default.

--stop

Stops the Gradle daemon if it is running. You can only stop daemons that were started with the Gradle version you use when running --stop.

D.2. System properties

The following system properties are available for the gradle command. Note that command-line options take precedence over system properties.

gradle.user.home

Specifies the Gradle user home directory.

The Section 20.1, “Configuring the build environment via gradle.properties” contains specific information about Gradle configuration available via system properties.

D.3. Environment variables

The following environment variables are available for the gradle command. Note that command-line options and system properties take precedence over environment variables.

GRADLE_OPTS

Specifies command-line arguments to use to start the JVM. This can be useful for setting the system properties to use for running Gradle. For example you could setGRADLE_OPTS="-Dorg.gradle.daemon=true" to use the Gradle daemon without needing to use the --daemon option every time you run Gradle. Section 20.1, “Configuring the build environment via gradle.properties” contains more information about ways of configuring the daemon without using environmental variables, e.g. in more maintainable and explicit way.

GRADLE_USER_HOME

Specifies the Gradle user home directory (which defaults to “USER_HOME/.gradle” if not set).

JAVA_HOME

Specifies the JDK installation directory to use.

Appendix D. Gradle Command Line的更多相关文章

  1. Linux Command Line learning

    https://www.codecademy.com/en/courses/learn-the-command-line Background The command line is a text i ...

  2. How to build .apk file from command line(转)

    How to build .apk file from command line Created on Wednesday, 29 June 2011 14:32 If you don’t want ...

  3. Can't use Subversion command line client: svn Probably the path to Subversion executable is wrong. Fix it.

    1.最近使用SVN工具时,Checkout出项目到本地后后,然后将其导入到Intellij idea中开发,在提交svn代码的时候,出现这样的错误:Can't use Subversion comma ...

  4. How to Use Android ADB Command Line Tool

    Android Debug Bridge (adb) is a tool that lets you manage the state of an emulator instance or Andro ...

  5. Chrome-Console( Command Line API Reference)

    来源于:https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference The Comma ...

  6. logoff remote desktop sessions via command line tools

    This trick I learned from my one of ex-college.  In Windows servers, only two remote desktop session ...

  7. 使用intellij的svn时提示出错: Can't use Subversion command line client: svn.Errors found while svn working copies detection.

    使用Intellij的svn时提示出错:Can't use Subversion command line client: svn. Errors found while svn working co ...

  8. ubuntu16.04安装virtualbox5.1失败 gcc:error:unrecognized command line option ‘-fstack-protector-strong’

    系统:ubuntu16.04.1 软件:Virtualbox-5.1 编译器:GCC 4.7.4 在如上环境下安装Vbx5.1提示我在终端执行/sbin/vboxconfig命令 照做 出现如下err ...

  9. Linux Command Line 笔记(1)

    Yunduan CUI graphical user interfaces make easy tasks easy, while command line interfaces make diffi ...

  10. Can't use Subversion command line client:svn

    在Intellij IDEA里checkout东西时出先这个错误提示:Can't use Subversion command line client:svn Subversion command l ...

随机推荐

  1. Spring Cloud灰度部署

    1.背景(灰度部署) 在我们系统发布生产环境时,有时为了确保新的服务逻辑没有问题,会让一小部分特定的用户来使用新的版本(比如客户端的内测版本),而其余的用户使用旧的版本,那么这个在Spring Clo ...

  2. Pinot2的开发者社区和教程

    目录 文章背景: Pinot 2 是任天堂公司于2018年发布的一款游戏机,采用了基于马里奥兄弟游戏<塞尔达传说:荒野之息>的开放世界操作系统,并推出了许多创新的功能,例如"超级 ...

  3. Jmeter压测实战:Jmeter二次开发之自定义函数

    1 前言 Jmeter是Apache基金会下的一款应用场景非常广的压力测试工具,具备轻量.高扩展性.分布式等特性.Jmeter已支持实现随机数.计数器.时间戳.大小写转换.属性校验等多种函数,方便使用 ...

  4. Python中 sys.argv[]用法详解

    sys.argv[0]表示代码本身文件路径. sys.argv[]是一个从程序外部获取参数的桥梁,从外部取得的参数可以是多个,所以获得的是一个列表(list),也就是说sys.argv其实可以看作是一 ...

  5. LaTeX 的学习笔记

    摘自我的洛谷博客 该文章被打开的次数(包括洛谷平台): \(\LaTeX\) 中所有命令都以\开头,后面可以跟一个花括号,代表参数. \documentclass{} 指定了文章类型,有 articl ...

  6. base64详解

    base64详解 前置知识 位与字节 二进制系统中,每个0或1就是一个位(bit,比特),也叫存储单元,位是数据存储的最小单位. 其中8bit就称为一个字节(Byte). 1B=8位 位运算 与运算: ...

  7. Linux 日志服务管理

    日志管理 1 系统日志管理 1 rsyslog系统日志服务 日志记录的内容包括: 历史事件:时间,地点,人物,事件 Jul 18 14:30:53 # 时间 ubuntu2204 # 地点 (在哪个主 ...

  8. MyBatis 常用工具类

    SQL 类 MyBatis 提供了一个 SQL 工具类,使用这个工具类,我们可以很方便在 Java 代码动态构建 SQL 语句 String newSql = new SQL() ({ SELECT( ...

  9. spring-mvc系列:详解@RequestMapping注解(value、method、params、header等)

    目录 一.@RequestMapping注解的功能 二.@RequestMapping注解的位置 三.@RequestMapping注解的value属性 四.@RequestMapping注解的met ...

  10. Python 潮流周刊第 14 期(内容摘要)

    你好,我是猫哥.这里每周分享优质的 Python.AI 及通用技术内容,本期分享的全部是英文材料. 本周刊由 Python猫 出品,精心筛选国内外的 250+ 信息源,为你挑选最值得分享的文章.教程. ...