Gradle Notes - Introduction and Installation of Gradle

Introduction to Gradle

Gradle is a JVM-based build tool that provides:
  • Like Ant, a versatile and flexible build tool
  • Switchable, convention-based build framework
  • Powerful multi-project build support
  • Powerful dependency management based on Apache Ivy
  • Support maven, Ivy repository
  • Supports transitive dependency management without the need for remote repositories or pom.xml and ivy.xml configuration files.
  • Nice integration of Ant tasks
  • Based on Groovy, the build script is written in Groovy
  • Built with extensive domain model support

Gradle overview

1. Declaration-based and contract-based construction.
2. Dependent programming language.
3. It can be structured structured, easy to maintain and understand.
4. There are high-level APIs that allow you to monitor its core or configure its behavior during the entire process of build execution.
5. It has good scalability. There are incremental build capabilities to overcome performance bottlenecks.
6, Multi-project build support.
7. Multiple ways of dependency management.
8, is the first build integration tool. Integrate the functions of Ant and maven.
9, easy to shift value.
10. The script is written in Groovy, which is easy to maintain.
11. The Gradle Wrapper allows you to build Gradle on machines that do not have Gradle installed.
12. Free and open source.
 

Gradle installation

1. Install JDK and configure the JAVA_HOME environment variable. Because Gradle is written in Groovy which is based on JAVA. In addition, the Java version must be at least 1.5.
2. Download. The address is: http://www.gradle.org/downloads. Download the version you want here.
3. Unzip. If you download the full package of gradle-xx-all.zip, it will have the following content:
  • binary file
  • User Manual (both PDF and HTML versions)
  • DSL Reference Guide
  • API Manual (including Javadoc and Groovydoc)
  • Sample
  • Source code, for reference only.
4. Configure environment variables. Configure GRADLE_HOME to your gradle root directory, then add %GRADLE_HOME%/bin ($GRADLE_HOME/bin for linux or mac) to the PATH environment variable.
Linux users can configure it in the ~/.bashrc file.
 
After the configuration is complete, run gradle -v to check if the installation is correct. If installed correctly, it will print out Gradle version information, including its build information, Groovy, Ant, Ivy, current JVM and current system version information.
 
Additionally, Gradle runtime JVM parameters can be configured via GRADLE_OPTS or JAVA_OPTS. However, the parameters set by JAVA_OPTS will also affect other JAVA applications.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326822742&siteId=291194637