forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gradle#26936 Running Gradle Builds section in Grad…
…le User Manual ### Details This is a Documentation change ONLY. ### Context Major update of **Running Gradle Builds**. ### Reviewers: [Link to Build](https://builds.gradle.org/repository/download/Gradle_Release_Check_BuildDistributions/74243440:id/distributions/gradle-8.5-docs.zip!/gradle-8.5-20231108035006%2B0000/docs/userguide/userguide.html) #### Please review the finished sections highlighted below: Running Gradle Builds - [X] [Getting Started](https://builds.gradle.org/repository/download/Gradle_Release_Check_BuildDistributions/74243440:id/distributions/gradle-8.5-docs.zip!/gradle-8.5-20231108035006%2B0000/docs/userguide/getting_started_eng.html) - [X] [Core Concepts](https://builds.gradle.org/repository/download/Gradle_Release_Check_BuildDistributions/74243440:id/distributions/gradle-8.5-docs.zip!/gradle-8.5-20231108035006%2B0000/docs/userguide/gradle_basics.html) - [X] [Tutorial](https://builds.gradle.org/repository/download/Gradle_Release_Check_BuildDistributions/74243440:id/distributions/gradle-8.5-docs.zip!/gradle-8.5-20231108035006%2B0000/docs/userguide/part1_gradle_init.html) - [X] [Additional Topics](https://builds.gradle.org/repository/download/Gradle_Release_Check_BuildDistributions/74243440:id/distributions/gradle-8.5-docs.zip!/gradle-8.5-20231108035006%2B0000/docs/userguide/gradle_ides.html) ### Notes: The **Running Gradle Builds** section is for **Developers** that just want to use Gradle (think riding a bike - how to pedal). Co-authored-by: Laura Kassovic <[email protected]>
- Loading branch information
Showing
56 changed files
with
1,314 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+40.4 KB
(150%)
subprojects/docs/src/docs/userguide/img/task-dag-examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+58.8 KB
(390%)
subprojects/docs/src/docs/userguide/img/wrapper-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...rojects/docs/src/docs/userguide/running-builds/additional/continuous_build.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright (C) 2023 Gradle, Inc. | ||
// | ||
// Licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 International License.; | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://creativecommons.org/licenses/by-nc-sa/4.0/ | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
[[continous_build]] | ||
= Continuous Build | ||
|
||
Continuous Build allows you to automatically re-execute the requested tasks when file inputs change. | ||
You can execute the build in this mode using the `-t` or `--continuous` command-line option. | ||
|
||
For example, you can continuously run the `test` task and all dependent tasks by running: | ||
|
||
---- | ||
$ gradle test --continuous | ||
---- | ||
|
||
Gradle will behave as if you ran `gradle test` after a change to sources or tests that contribute to the requested tasks. | ||
This means unrelated changes (such as changes to build scripts) will not trigger a rebuild. | ||
To incorporate build logic changes, the continuous build must be restarted manually. | ||
|
||
Continuous build uses <<file_system_watching.adoc#sec:daemon_watch_fs,file system watching>> to detect changes to the inputs. | ||
If file system watching does not work on your system, then continuous build won't work either. | ||
In particular, continuous build does not work when using `--no-daemon`. | ||
|
||
When Gradle detects a change to the inputs, it will not trigger the build immediately. | ||
Instead, it will wait until no additional changes are detected for a certain period of time - the quiet period. | ||
You can configure the quiet period in milliseconds by the Gradle property `<<build_environment.adoc#sec:gradle_configuration_properties,org.gradle.continuous.quietperiod>>`. | ||
|
||
== Terminating Continuous Build | ||
If Gradle is attached to an interactive input source, such as a terminal, the continuous build can be exited by pressing `CTRL-D` (On Microsoft Windows, it is required to also press `ENTER` or `RETURN` after `CTRL-D`). | ||
|
||
If Gradle is not attached to an interactive input source (e.g. is running as part of a script), the build process must be terminated (e.g. using the `kill` command or similar). | ||
|
||
If the build is being executed via the Tooling API, the build can be cancelled using the Tooling API's cancellation mechanism. | ||
|
||
[[continuous_build_limitations]] | ||
== Limitations | ||
Under some circumstances, continuous build may not detect changes to inputs. | ||
|
||
[[sec:continuous_build_missing_files]] | ||
=== Creating input directories | ||
Sometimes, creating an input directory that was previously missing does not trigger a build, due to the way file system watching works. | ||
For example, creating the `src/main/java` directory may not trigger a build. | ||
Similarly, if the input is a <<working_with_files.adoc#filtering_files,filtered file tree>> and no files are matching the filter, the creation of matching files may not trigger a build. | ||
|
||
[[sec:continuous_build_untracked]] | ||
=== Inputs of untracked tasks | ||
Changes to the inputs of <<incremental_build.adoc#sec:disable-state-tracking,untracked tasks>> or tasks that have no outputs may not trigger a build. | ||
|
||
[[sec:continuous_build_project_dir]] | ||
=== Changes to files outside of project directories | ||
Gradle only watches for changes to files inside the project directory. | ||
Changes to files outside the project directory will go undetected and not trigger a build. | ||
|
||
[[sec:build_cycles]] | ||
=== Build cycles | ||
Gradle starts watching for changes just before a task executes. | ||
If a task modifies its own inputs while executing, Gradle will detect the change and trigger a new build. | ||
If every time the task executes, the inputs are modified again, the build will be triggered again. | ||
This isn't unique to continuous build. | ||
A task that modifies its own inputs will never be considered up-to-date when run "normally" without continuous build. | ||
|
||
If your build enters a build cycle like this, you can track down the task by looking at the list of files reported changed by Gradle. | ||
After identifying the file(s) that are changed during each build, you should look for a task that has that file as an input. | ||
In some cases, it may be obvious (e.g., a Java file is compiled with `compileJava`). | ||
In other cases, you can use `--info` logging to find the task that is out-of-date due to the identified files. |
67 changes: 67 additions & 0 deletions
67
subprojects/docs/src/docs/userguide/running-builds/additional/gradle_ides.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (C) 2023 Gradle, Inc. | ||
// | ||
// Licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 International License.; | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://creativecommons.org/licenses/by-nc-sa/4.0/ | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
[[gradle_ides]] | ||
= Gradle in IDEs | ||
|
||
Many IDEs support Gradle including Android Studio, IntelliJ IDEA, Visual Studio Code, Eclipse, and NetBeans. | ||
|
||
== IntelliJ IDEA | ||
|
||
IntelliJ IDEA supports a fully-functional integration with Gradle that helps you automate your building process. | ||
|
||
image::intellij_idea.png[] | ||
|
||
You can easily create a new Gradle project, open and sync an existing one, work with several linked projects simultaneously, and manage them. | ||
|
||
You can find documentation link:https://www.jetbrains.com/help/idea/gradle.html[here]. | ||
|
||
== Android Studio | ||
|
||
Android Studio is the official IDE for Android app development, based on IntelliJ IDEA. | ||
|
||
Android Studio uses Gradle to automate and manage the build process while letting you define flexible, custom build configurations. | ||
|
||
image::android_studio.png[] | ||
|
||
You can find documentation link:https://developer.android.com/build[here]. | ||
|
||
== Visual Studio Code | ||
|
||
VS Code supports Gradle Java projects (not including Android) via the link:https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle[Gradle for Java extension]. | ||
|
||
image::visual_studio_code.png[] | ||
|
||
The extension provides a visual interface for your Gradle build. | ||
You can use this interface to view Gradle Tasks and Project dependencies, or run Gradle Tasks as VS Code Tasks. The extension also offers a better Gradle build file authoring experience including syntax highlighting, error reporting, and auto-completion. | ||
|
||
You can find documentation link:https://code.visualstudio.com/docs/java/java-build[here]. | ||
|
||
== Eclipse | ||
|
||
The Eclipse IDE caters to the Java developer, and features Java tooling, a Git client, XML Editor, and Gradle integration. | ||
|
||
image::eclipse.png[] | ||
|
||
link:https://marketplace.eclipse.org/content/buildship-gradle-integration[Buildship] is a set of Eclipse Plug-ins that provide a deep integration of Gradle into the Eclipse IDE. | ||
|
||
You can find documentation link:https://projects.eclipse.org/projects/tools.buildship[here]. | ||
|
||
== NetBeans | ||
|
||
The Apache Software Foundation maintains NetBeans, an open-source IDE for Java, PHP, Javascript and other languages. | ||
|
||
image::netbeans.png[] | ||
|
||
You can find documentation link:https://cwiki.apache.org/confluence/display/BEAM/Gradle+Tips[here]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.