From 0c2b4f9ff3d177d98b1f0a3186b27cd7a6f31789 Mon Sep 17 00:00:00 2001 From: Chris Earle Date: Wed, 18 May 2016 13:51:46 -0400 Subject: [PATCH] Updating Gradle cheatsheet Original commit: elastic/x-pack-elasticsearch@94a2379d743b4badf215797544f42140e508b694 --- GRADLE.CHEATSHEET.asciidoc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/GRADLE.CHEATSHEET.asciidoc b/GRADLE.CHEATSHEET.asciidoc index d3f433e25c4..5efba3c932c 100644 --- a/GRADLE.CHEATSHEET.asciidoc +++ b/GRADLE.CHEATSHEET.asciidoc @@ -1,9 +1,20 @@ -As a quick helper, below are the equivalent commands from maven to gradle. You can also run `gradle tasks` to see all tasks that are available to run. +As a quick helper, below are the equivalent commands from `maven` to `gradle`. You can also run `gradle tasks` to see all tasks that are available to run. -| Maven | Gradle | Description | -| ----------------------------| ------------|---------------------| -| `clean` | `clean` | | -| `verify` | `check` | | -| `verify -Dskip.unit.tests` | `integTest` | | -| `package -DskipTests` | `assemble` | | -| `install -DskipTests` | `install` | | +[cols="3*", options="header"] +|==== +| Maven | Gradle | Description +| `clean` | `clean` | Delete anything that exists already. +| `test` | `test` | Run all unit tests. +| `verify` | `check` | Run all unit tests, plus extra checks (e.g., line length) +| `verify -Dskip.unit.tests` | `integTest` | +| `package -DskipTests` | `assemble` | Output is in `${project.projectDir}/build/distributions` +| `install -DskipTests` | `install` | + +With Gradle, you can easily target specific `projects` to run commands against, and it will build all necessary dependencies to make it happen. For example, if you make a change to a specific test in the `x-pack` subproject, then you can specifically invoke its `test` task. + +[source,bash] +---- +$ gradle :x-plugins:elasticsearch:x-pack:test -Dtests.class=*YourTests +---- + +This applies to any command that follows the Directed Acyclic Graph (DAG) for its dependencies. The above example would trigger Elasticsearch `core` to be built, as well as the test framework and any other dependencies that it may have.