List of configurations.
--- a/gradle.rst Tue Aug 07 01:37:22 2018 +0300
+++ b/gradle.rst Wed Aug 08 23:14:45 2018 +0300
@@ -84,6 +84,10 @@
$ gradle -x test build
$ gradle -x :core:build :client:build
+Skipt task programmatically::
+
+ gradle.startParameter.excludedTaskNames.add "jar"
+
Build sources
=============
::
@@ -206,6 +210,12 @@
// from configurations.testRuntime - configurations.runtime
}
+List of configurations::
+
+ configurations.each { println it.name }
+
+For each configuration ``build<ConfigurationName>`` and ``upload<ConfigurationName>`` are defined.
+
List project properties
=======================
::
@@ -214,6 +224,15 @@
$ gradle :$SUBPROJ:properties
$ gradle properties -p $SUBPROJ
+Well known properties
+=====================
+
+``rootDir``, ``projectDir``, ``buildDir`` are of ``java.io.File`` type.
+
+``tasks`` refers to task set.
+
+``project``, ``subprojects``, ``rootProject`` refer to various Project instances.
+
Dry tun
=======
@@ -302,4 +321,90 @@
$ gradle cleanIdea
+Logging
+=======
+``Project`` and ``Task`` has ``logger`` object with levels::
+
+ logger.error "..."
+ logger.quiet "..."
+ logger.warning "..."
+ logger.lifecycle "..."
+ logger.info "..."
+ logger.debug "..."
+
+``println`` is printed on ``quiet`` level.
+
+Make Gradle quiet::
+
+ $ gradle -q ...
+
+Make Gradle verbose::
+
+ $ gradle -i ...
+
+Make Gradle to print debug output::
+
+ $ gradle -d ...
+
+Dependencies between tasks
+==========================
+
+Direct dependency::
+
+ task A {
+ dependsOn B, C
+ }
+ A.dependsOn D, E
+
+Cleanup actions::
+
+ task A {
+ dependsOn startServer
+ finalizedBy stopServer
+ }
+
+To enforce order without enforcing dependency::
+
+ task A {
+ mustRunAfter B
+ }
+
+Declare dependencies programmatically::
+
+ dependsOn project.tasks.matching { it.name.endsWith "Test" }
+
+Apply task on condition::
+
+ task upload {
+ onlyIf { System.getProperty("debug") != null }
+ doLast { println "In debug mode." }
+ }
+
+Accessing task graph
+====================
+
+Process task graph when it is already populated::
+
+ gradle.taskGraph.whenReady { graph ->
+ if (graph.hasTask(":release")) { ... }
+ }
+
+``gradle.taskGraph`` is safe to access inside ``doFirst`` / ``doLast``::
+
+ task someTask {
+ doLast {
+ if (gradle.taskGraph.hasTask(":someTask")) { }
+ }
+ }
+
+List all tasks that will be executed in current build::
+
+ println gradle.taskGraph.allTasks
+
+Applying pluings
+================
+::
+
+ apply from: "plugins/my.gradle"
+