Appendix D. Gradle Command Line

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.

Previous|Contents|Next

时间: 2025-01-07 07:04:33

Appendix D. Gradle Command Line的相关文章

Can't use Subversion command line client: svn

使用Intellij IDEA的svn时提示出错:Can't use Subversion command line client: svn. 当我在使用svn,Checkout一个项目后,然后将其导入到Intellij idea中,出现这样的报错!经过google后,发现了问题,我的问题是:我安装的TortoiseSVN工具,本身是带有command-line功能的(我没有安装)如图: 所以报这个错误.如果安装的TortoiseSVN工具,本身是不带有command-line功能的,必须要安装

解决MySQL5.6 Warning: Using a password on the command line interface can be insecure

MySQL5.6在使用名文的密码登陆时,会出现:Warning: Using a password on the command line interface can be insecure 当然这样对于平常的登陆会无所谓,如果在脚本里使用使用的话,就会有问题: 解决这种问题的方法是需要在my.cnf中配置即可: 在my.cnf中加入如下配置 [mysqladump] user=my_name password=my_pass 重启MySQL 即可 以后再使用mysqldump命令就不需要加上任

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 to install a number of programs for building your Android project, this article is for you. You will need only JDK, the Android SDK platform tools and

Command line option syntax error.type Command /? for help

电脑装思维导图的时候,报错显示"Command line option syntax error.Type Command /? for help."就查了一下,原来是系统没有C++2005,需要安装,就上网下载了一个vcredist_x86.exe,但是双击安装,仍然出现这个错误. 没办法,接着上网查吧,是什么原因呢?网上说是因为该文件安装不支持中文安装路径,然后我就把文件夹改成了英文名称的,但是双击还是出现这个错误.可能有的人用这种方法成功了吧~本着没有解决不了的问题的思想,接着奋

How To use RHEVM Command Line?

本文简单的描述下如何连接rhev shell以及简单的使用.关于更详细的用法请参考官方文档. 1.如何连接到rhevm? 要想连接到rhevm,必须拥有一个有效的证书.此证书一般安装完rhevm后会自动产生.下面是如何获取到证书. [[email protected] ~]# wget -O rhevm.cer http://rhevm.xzxj.edu.cn/ca.crt --2014-05-02 09:29:34-- http://rhevm.xzxj.edu.cn/ca.crt Resol

【转载】Data Science at the Command Line

Data Science at the Command Line Data Science at the Command Line is a new book written by Jeroen Janssens. This website contains information about the upcoming workshop in London, the webcast from August 20th, instructions on how to install the Data

Mac OS X Command Line

关于 man 命令 虽然有上千条命令,每条命令还有许多可选参数和具体的使用方式,但是你却不需要记住这些命令.你只需要记住一个:man 大多数命令都会包含一个使用指南,会告诉你任何你需要知道的关于这个命令的所有细节,在命令行中输入 man command-name 即可获取.例如,你想知道ls这个命令怎么使用,输入man ls即可进入使用指南页面. 使用指南往往很长,所以你可以使用▲(上箭头)或▼(下箭头)来上下移动,使用 来翻页,输入/和关键字来按照关键字搜索,按Q来退出使用指南页面. 那么——

MySQL5.6 Using a password on the command line interface can be insecure

最近把MySQL从5.5升到5.6以后,mysqldump居然不好用了,提示:  代码如下 复制代码 [[email protected] ~]# /usr/local/mysql/bin/mysqldump  -uroot -proot db > bak.sqlWarning: Using a password on the command line interface can be insecure. 翻译过来是:在命令行界面上使用密码可以是不安全的. 这让人有点郁闷,5.5用的一直都很爽,

Xcode Command Line Tools(命令行工具)

OS X 10.9 Mavericks正式发布,免费更新,立即去更新看看效果. 不过升级后安装命令行工具(Command Line Tools)时发现官网没有clt的下载安装包了,原来改了,使用命令在线安装. 打开终端,输入命令:xcode-select --install