Appendix D. Gradle Command Line

Source: Internet
Author: User

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 is 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 sections 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 is configured in this build run. This means faster builds for large multi-projects. See sections 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, Logging.

-g,--gradle-user-home

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

--gui

Launches the Gradle GUI. See Chapter, Using the Gradle graphical User Interface.

-I,--init-script

Specifies an initialization script. See Chapter, initialization Scripts.

-i,--info

Set log level to info. See Chapter, Logging.

-m,--dry-run

Runs the build with all task actions disabled. See section 11.7, "Dry Run".

--no-color

Don't use the color in the console output.

--offline

Specifies that the build should operate without accessing network resources. See sections 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 sections 11.5, "Selecting which build to execute".

--parallel (incubating)

Build projects in parallel. Gradle would attempt to determine the optimal number of executor threads to use. This option is should only being 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 is should only being used with decoupled projects (see section 57.9, "decoupled projects").

--profile

Profiles build execution time and generates a 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 in the .gradle root project directory. See section 14.6, "Caching".

-q,--quiet

Log errors only. See Chapter, Logging.

--recompile-scripts

Specifies that cached build scripts is skipped and forced to be recompiled. See section 14.6, "Caching".

--refresh-dependencies

Refresh the state of dependencies. See sections 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, Logging.

-s,--stacktrace

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

-u,--no-search-upwards

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

-v,--version

Prints version Info.

-x,--exclude-task

Specifies a task to is excluded from execution. See section 11.2, "Excluding tasks".

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

D.1. Daemon Command-Line options:

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

--daemon

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

--foreground

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

--no-daemon

The Gradle daemon to run the build. Useful occasionally if you had configured Gradle to always run with the daemon by default.

--stop

Stops the Gradle daemon if it is running. You can have only stop daemons this were started with the Gradle version if running --stop .

D.2. System Properties

The following system properties is 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 con Figuration available via System properties.

D.3. Environment variables

The following environment variables is 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 start the JVM. This can is useful for setting the system properties to use for running Gradle.  For example your could set to use the GRADLE_OPTS="-Dorg.gradle.daemon=true" 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 Configuri ng the daemon without using environmental variables, e.g. in more maintainable and explicit the.

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

Appendix D. Gradle Command Line

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.