Skipping TasksGradle offers multiple ways to skip the execution of a task.
+ You can set system property named skip.taskname or pass such property as a parameter to the gradle command using option (see ).
+
+
+
+
+ You can also choose another another property that can be used to skip a task.
- The option of the gradle command has the same effect as the
- option of the java command. This way you can set system properties
- of the JVM that runs Gradle. You can use this to add one or more skip properties
- to any task. If the corresponding system property is set to any value
+ You can use this to add one or more skip properties
+ to any task.
+ In both cases if the corresponding system property is set to any value
The statement sets the property to empty string, thus you
don't need to type more to skip a task.
- except false (case does not matter), the actions of the task don't get executed. But often you don't even
- need to set the skip properties. If you set a system property according to the pattern
- skip.taskname, the actions of the task don't get executed.
+ except false (case does not matter), the actions of the task don't get executed.
-
-
-
-
- If you want tasks to be skipped, that depends on a skipped task, you have to declare this explicitly via
- the skip properties
+
+ Skipping depending tasks
+ By default tasks that depends on skipped task get executed. If you want to skip them, you have to declare this explicitly via
+ the skip properties.
+
+
+ Using StopExecutionExceptionIf the rules for skipping a task can't be expressed with a simple property, you can use the
. If this exception is thrown by an action,
the further execution of this action as well as the execution of
@@ -46,14 +50,18 @@
nor do we access it via its fully qualified name. The reason is, that Gradle adds a set of default imports
to your script. These imports are customizable (see ).
+
+
+ Enabling and disabling tasksEvery task has also a enabled
- flag which defaults to true. Setting it to false prevents the execution of any of the
+ flag which defaults to true. Setting it to false prevents the execution of any of the
tasks actions.
+ Obtaining Information About Your Build
@@ -125,8 +133,9 @@
Gradle Properties and System PropertiesGradle offers a variety of ways to add properties to your build. With the
- -D
- command line option you can pass a system property to the JVM which runs Gradle.
+
+ command line option you can pass a system property to the JVM which runs Gradle. The option of the gradle command has the same effect as the
+ option of the java command.
There is also the possibility to directly add properties to your project objects. You can place a
gradle.properties