gradle

[root@localhost ~]# wget https://services.gradle.org/distributions/gradle-4.6-bin.zip

[root@localhost ~]# mkdir /opt/gradle

[root@localhost ~]# unzip -d /opt/gradle/ gradle-4.6-bin.zip

[root@localhost ~]# export PATH=$PATH:/opt/gradle/gradle-4.6/bin/

[root@localhost ~]# printenv |grep gradle
PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/gradle/gradle-4.6/bin/

[root@localhost ~]# gradle -v

————————————————————
Gradle 4.6
————————————————————

Build time: 2018-02-28 13:36:36 UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_161 (Oracle Corporation 25.161-b14)
OS: Linux 3.10.0-693.11.6.el7.x86_64 amd64

[root@localhost ~]# git clone https://github.com/gradle/gradle-build-scan-quickstart.git
Cloning into ‘gradle-build-scan-quickstart’…
remote: Counting objects: 287, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 287 (delta 0), reused 3 (delta 0), pack-reused 281
Receiving objects: 100% (287/287), 316.83 KiB | 249.00 KiB/s, done.
Resolving deltas: 100% (142/142), done.

[root@localhost ~]# cd gradle-build-scan-quickstart/

[root@localhost gradle-build-scan-quickstart]# ls -l
total 28
-rw-r–r–. 1 root root 153 Mar 9 09:42 build.gradle
drwxr-xr-x. 3 root root 21 Mar 9 09:42 gradle
-rw-r–r–. 1 root root 1 Mar 9 09:42 gradle.properties
-rwxr-xr-x. 1 root root 5296 Mar 9 09:42 gradlew
-rw-r–r–. 1 root root 2260 Mar 9 09:42 gradlew.bat
-rw-r–r–. 1 root root 1871 Mar 9 09:42 README.md
-rw-r–r–. 1 root root 51 Mar 9 09:42 settings.gradle
drwxr-xr-x. 4 root root 30 Mar 9 09:42 src

[root@localhost gradle-build-scan-quickstart]# tree .
.
|– build.gradle
|– gradle
| `– wrapper
| |– gradle-wrapper.jar
| `– gradle-wrapper.properties
|– gradle.properties
|– gradlew
|– gradlew.bat
|– README.md
|– settings.gradle
`– src
|– main
| `– java
| `– example
| `– Example.java
`– test
`– java
`– example
`– ExampleTest.java

9 directories, 10 files

[root@localhost gradle-build-scan-quickstart]# ./gradlew build –scan
Downloading https://services.gradle.org/distributions/gradle-4.6-bin.zip
…………………………………………………………….
Unzipping /root/.gradle/wrapper/dists/gradle-4.6-bin/4jp4stjndanmxuerzfseyb6wo/gradle-4.6-bin.zip to /root/.gradle/wrapper/dists/gradle-4.6-bin/4jp4stjndanmxuerzfseyb6wo
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-4.6-bin/4jp4stjndanmxuerzfseyb6wo/gradle-4.6/bin/gradle
Starting a Gradle Daemon (subsequent builds will be faster)
Download https://plugins.gradle.org/m2/com/gradle/build-scan-plugin/1.12.1/build-scan-plugin-1.12.1.pom
Download https://plugins.gradle.org/m2/com/gradle/build-scan-plugin/1.12.1/build-scan-plugin-1.12.1.jar
Download https://jcenter.bintray.com/com/google/guava/guava/23.0/guava-23.0.pom
Download https://jcenter.bintray.com/com/google/guava/guava-parent/23.0/guava-parent-23.0.pom
Download https://jcenter.bintray.com/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom
Download https://jcenter.bintray.com/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.pom
Download https://jcenter.bintray.com/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.pom
Download https://jcenter.bintray.com/org/codehaus/mojo/animal-sniffer-parent/1.14/animal-sniffer-parent-1.14.pom
Download https://jcenter.bintray.com/org/codehaus/mojo/mojo-parent/34/mojo-parent-34.pom
Download https://jcenter.bintray.com/org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
Download https://jcenter.bintray.com/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.pom
Download https://jcenter.bintray.com/com/google/errorprone/error_prone_parent/2.0.18/error_prone_parent-2.0.18.pom
Download https://jcenter.bintray.com/com/google/guava/guava/23.0/guava-23.0.jar
Download https://jcenter.bintray.com/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar
Download https://jcenter.bintray.com/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
Download https://jcenter.bintray.com/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
Download https://jcenter.bintray.com/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar

BUILD SUCCESSFUL in 52s
4 actionable tasks: 4 executed

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no]
yes
Gradle Terms of Service accepted.

Publishing build scan…
https://gradle.com/s/vafmar4mrvycy

 

[root@localhost gradle-build-scan-quickstart]# tree .
.
|– build
| |– classes
| | `– java
| | |– main
| | | `– example
| | | `– Example.class
| | `– test
| | `– example
| | `– ExampleTest.class
| |– libs
| | `– gradle-build-scan-quickstart.jar
| |– reports
| | `– tests
| | `– test
| | |– classes
| | | `– example.ExampleTest.html
| | |– css
| | | |– base-style.css
| | | `– style.css
| | |– index.html
| | |– js
| | | `– report.js
| | `– packages
| | `– example.html
| |– test-results
| | `– test
| | |– binary
| | | |– output.bin
| | | |– output.bin.idx
| | | `– results.bin
| | `– TEST-example.ExampleTest.xml
| `– tmp
| |– compileJava
| |– compileTestJava
| `– jar
| `– MANIFEST.MF
|– build.gradle
|– gradle
| `– wrapper
| |– gradle-wrapper.jar
| `– gradle-wrapper.properties
|– gradle.properties
|– gradlew
|– gradlew.bat
|– README.md
|– settings.gradle
`– src
|– main
| `– java
| `– example
| `– Example.java
`– test
`– java
`– example
`– ExampleTest.java

31 directories, 24 files

[root@localhost gradle-build-scan-quickstart]# gradle

> Task :help

Welcome to Gradle 4.6.

To run a build, run gradle <task> …

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle –help

To see more detail about a task, run gradle help –task <task>

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

[root@localhost gradle-build-scan-quickstart]# gradle tasks

> Task :tasks

————————————————————
All tasks runnable from root project
————————————————————

Build tasks
———–
assemble – Assembles the outputs of this project.
build – Assembles and tests this project.
buildDependents – Assembles and tests this project and all projects that depend on it.
buildNeeded – Assembles and tests this project and all projects it depends on.
classes – Assembles main classes.
clean – Deletes the build directory.
jar – Assembles a jar archive containing the main classes.
testClasses – Assembles test classes.

Build Setup tasks
—————–
init – Initializes a new Gradle build.
wrapper – Generates Gradle wrapper files.

Documentation tasks
——————-
javadoc – Generates Javadoc API documentation for the main source code.

Help tasks
———-
buildEnvironment – Displays all buildscript dependencies declared in root project ‘gradle-build-scan-quickstart’.
components – Displays the components produced by root project ‘gradle-build-scan-quickstart’. [incubating]
dependencies – Displays all dependencies declared in root project ‘gradle-build-scan-quickstart’.
dependencyInsight – Displays the insight into a specific dependency in root project ‘gradle-build-scan-quickstart’.
dependentComponents – Displays the dependent components of components in root project ‘gradle-build-scan-quickstart’. [incubating]
help – Displays a help message.
model – Displays the configuration model of root project ‘gradle-build-scan-quickstart’. [incubating]
projects – Displays the sub-projects of root project ‘gradle-build-scan-quickstart’.
properties – Displays the properties of root project ‘gradle-build-scan-quickstart’.
tasks – Displays the tasks runnable from root project ‘gradle-build-scan-quickstart’.

Verification tasks
——————
check – Runs all checks.
test – Runs the unit tests.

Rules
—–
Pattern: clean<TaskName>: Cleans the output files of a task.
Pattern: build<ConfigurationName>: Assembles the artifacts of a configuration.
Pattern: upload<ConfigurationName>: Assembles and uploads the artifacts belonging to a configuration.

To see all tasks and more detail, run gradle tasks –all

To see more detail about a task, run gradle help –task <task>

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

 

Leave a comment