Basic introduction
Gradle is a project automation build tool based on the concepts of Apache Ant and Apache Maven. It uses a Groovy-based domain-specific language (DSL) to declare project settings, abandoning various cumbersome XML-based configurations.
Mainly for Java applications. The languages currently supported are limited to Java, Groovy, Kotlin and Scala, and it is planned to support more languages in the future. Gradle is a JVM-based build tool. It is a universal and flexible build tool that supports maven and Ivy warehouses. It supports transitive dependency management without the need for remote warehouses or pom.xml and ivy.xml configuration files. Based on Groovy, The build script is written in Groovy.
Function introduction
- Free and open source
- gradle supports partial building.
- Gradle's support for building multiple projects is excellent, and project dependencies are Gradle's first citizen.
- Gradle is the first build integration tool and has good compatibility and correlation with ant, maven, and ivy.
- Supports multi-way dependency management: including jars or dirs from maven remote warehouse, nexus private server, ivy warehouse and local file system
- The overall design of gradle is oriented as a language, rather than becoming a strict and rigid framework.
- Easy migration: gradle is suitable for projects with any structure. You can build the original project and gradle project in parallel on the same development platform. It is usually required to write relevant tests to ensure the similarity of the developed plug-ins. This migration can be less destructive and as reliable as possible. This is also a best practice for refactoring.
How to use
1. Unzip the ZIP file. In this case, unzip it in D: usrlocal
2. Create a new environment variable GRADLE_HOME, that is, D: usrlocalgradle-2.4;
3. Modify the environment variable Path, that is, append %GRADLE_HOME%BIN;
4. Enter the shortcut key WIN+ R, enter cmd, and enter the command line in the pop-up window: gradle -v;
5. Create the directory where the project is located. This experience was created in c:gdemo;
6. Create a blank build.gradle file and open it;
7. Enter apply plugin: ‘java’ in the first line, and execute the command: gradle build.
it works
it works
it works