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. SpringBoot RabbitMQ 实战解决项目中实践

    1 基础预览 1.1 环境准备 Springboot 1.5.6.RELEAS Springcloud Dalston.SR2 1.2 交换机类型 交换机是用来发送消息的AMQP实体.交换机拿到一个消 ...

  2. 电子表格vlookup函数使用

    vlookup是常用的辅助查找函数,但是这个函数的参数定义和解释非常的难以理解,即使用向导也很难搞清楚哪个参数是啥意思.放到编程圈里面应该也算bad design的典型了.下面是函数的定义,每次看到这 ...

  3. 【Shell】ps 命令

    ps 命令 Linux ps (英文全拼:process status)命令用于显示当前进程的状态,类似于 windows 的任务管理器. 1. ps 常用的命令 ps -aux #显示所有进程信息 ...

  4. 项目完成小结:使用Blazor和gRPC开发大模型客户端

    前言 先介绍下这个项目. 最近我一直在探索大语言模型,根据不同场景训练了好几个模型,为了让用户测试使用,需要开发前端. 这时候,用 Gradio 搭建的前端是不太够的,虽说 GitHub 上也有一堆开 ...

  5. Flutter系列文章-Flutter基础

    Flutter是Google推出的一种新的移动应用开发框架,允许开发者使用一套代码库同时开发Android和iOS应用.它的设计理念.框架结构.以及对Widget的使用,都让开发者能更有效率地创建高质 ...

  6. JNI c++ 与 java 通信过程

    JNI(Java Native Interface)是Java提供的一种机制,用于在Java和本地C/C++代码之间进行通信.下面是JNI C++与Java通信的一般过程: 1. 编写Java代码:首 ...

  7. windows内核情景分析-毛德操(第一章)

    微内核操作系统的特点内核尽量缩小 windows内核包括了两大部分 操作系统内核(ntoskrnl.exe),另一部分则是迁移到了内核中即系统空间中的视窗服务(win32k.sys) 用户空间和系统空 ...

  8. Django: ERRORS: ?: (staticfiles.E001) The STATICFILES_DIRS setting is not a tuple or list. HINT: Perhaps you forgot a trailing comma?

    必须是数组或者列表类型 如下所示: # 错误# STATICFILES_DIRS = { # os.path.join(BASE_DIR, 'static'), # }# 正确 STATICFILES ...

  9. ChatGPT插件开发实战

    1.概述 ChatGPT是一款由OpenAI推出的先进对话模型,其强大的自然语言处理能力使得它成为构建智能对话系统和人机交互应用的理想选择.为了进一步拓展ChatGPT的功能和适应不同领域的需求,Op ...

  10. mysql根据mysqlbinlog恢复找回被删除的数据库

    年初和朋友一起做了个项目,到现在还没收到钱呢,今天中午时候突然听说之前的数据库被攻击了,业务数据库全部被删除.看有没有什么办法恢复,要是恢复不了,肯定也别想拿钱了吧? README FOR RECOV ...