Gradle Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(41 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=TO DEPLETE TO=
{{Internal|Gradle Properties - Runtime and Project Configuration|Gradle Properties - Runtime and Project Configuration}}
=<span id='Configuration_Files'><span>Files and Paths=


* [[Gradle#Subjects|Gradle]]
==Gradle Home==


=Overview=
If Gradle was installed with [[Gradle Installation#Homebrew|Homebrew]] on Mac, then the Gradle home is


=Configuration Files=
[[Brew_Concepts#Cellar|/usr/local/Cellar]]/gradle/<''version''>/libexec
 
==<span id='.24HOME.2F.gradle'></span>Gradle User Home==
 
The Gradle user home is the directory indicated by $GRADLE_USER_HOME or $USER/.gradle if the environment variable is not set.
 
==Gradle Project Files==


  .
  .
  |
  |
  |- [[#build.gradle|build.gradle]]
  |- [[Gradle_Project_and_Build_Script#Overview|build.gradle]]
  |- [[#settings.gradle|settings.gradle]]
|- [[Gradle_Settings_Script_and_Settings_Instance#Overview|settings.gradle]]
  |- gradlew
|- [[#gradle.properties|gradle.properties]]
  +- gradle
  |- [[#Project-Level_.27.gradle.27_Directory|.gradle]]
  |       |
|      +-...
|- [[Gradle_Concepts#The_Gradle_Wrapper|gradlew]]
  +- [[#Project-Level_.27gradle.27_Directory|gradle]]
       |
       |
       +--
       +-[[Gradle_Concepts#The_Gradle_Wrapper|wrapper]]
 
            |
==build.gradle==
            +- ...
 
The project-level configuration script that contains task configuration for the current project.
 
==settings.gradle==
 
This file specifies how the project and sub-projects are structured.
 
==$HOME/.gradle==
 
The default [[Gradle_Concepts#Gradle_User_Home|Gradle user home]].
 
==gradle.properties==
 
<tt>gradle.properties</tt> files can be placed either in Gradle user home directory or in the project root directory. The configuration that comes from the user home directory takes precedence over the configuration that comes from the project root directory.
 
=Build Environment Configuration=
 
{{External|https://docs.gradle.org/current/userguide/build_environment.html}}
 
Gradle behavior is influenced by configuration provided with one or more of the following configuration mechanisms, listed below in the descending order of their precedence:
 
==Command-Line Flags==
 
{{Internal|Gradle Operations#Command-Line Interface|Gradle Command-Line Interface}}
 
==System Properties==


System properties are stored in a [[#gradle.properties|gradle.properties]] file.
===Project-Level 'gradle' Directory===


==Gradle Properties==
It may be created automatically on project initialization with [[Gradle_Operations#Start_a_Project|gradle init]].


Gradle properties are "org.gradle.*" system properties. They are typically stored in a [[#gradle.properties|gradle.properties]] in the project root directory or in Gradle user home.
<font color=darkgray>What does it contain? Should I check it into the repository or not?</font>


==Environment Variables==
===Project-Level '.gradle' Directory===


=Project Properties=
It may be created automatically on project initialization with [[Gradle_Operations#Start_a_Project|gradle init]].
<font color=darkgray>What does it contain? Should I check it into the repository or not?</font>

Latest revision as of 22:04, 13 October 2020

TO DEPLETE TO

Gradle Properties - Runtime and Project Configuration

Files and Paths

Gradle Home

If Gradle was installed with Homebrew on Mac, then the Gradle home is

/usr/local/Cellar/gradle/<version>/libexec

Gradle User Home

The Gradle user home is the directory indicated by $GRADLE_USER_HOME or $USER/.gradle if the environment variable is not set.

Gradle Project Files

.
|
|- build.gradle
|- settings.gradle
|- gradle.properties
|- .gradle
|       |
|       +-...
|- gradlew
+- gradle
      |
      +-wrapper
           |
           +- ...

Project-Level 'gradle' Directory

It may be created automatically on project initialization with gradle init.

What does it contain? Should I check it into the repository or not?

Project-Level '.gradle' Directory

It may be created automatically on project initialization with gradle init. What does it contain? Should I check it into the repository or not?