Gradle installation (Windows)

A, Gradle Profile

1.1 What is Gradle?

  Gradle is an open source tool for building automation projects based on Apache Ant and Maven concepts of Apache. It is based on the use Groovyof DSL(Domain-Specific Language Domain Specific Language) to declare the project settings, abandoned the XML-based variety of complicated configurations. For Java-based applications. It supports the current language is limited to Java, Groovy, Kotlin and Scala, plan for the future will support more languages.

  Gradle is a JVM-based build tool, is a versatile and flexible building tools, support for Maven, Ivy warehouse, supports transitive dependencies management, without the need to warehouse or remote pom.xmland ivy.xmlprofiles, based on Groovy (Groovy is a JVM-based dynamic languages), build scripts written in Groovy.

1.2 Gradle function

  • Based on the construction and building claims-based convention
  • Language support is dependent manner based programming
  • Construction of structured
  • Depth API
  • Good Gradle extension
  • Construction of multi-project
  • In many ways depend on administration
  • Easy to transplant
  • Gradle build scripts are written using Groovy instead of XML
  • Gradle Wrapper allows you to perform on machines without installation of Gradle Gradle build
  • Gradle is an open source project, and follow the ASL license

1.3 Groovy compared with Java

  Groovy is an agile dynamic to as a JVM language, it is a mature object-oriented programming language that can be used for both object-oriented programming, but also can be used as a pure scripting language. Use the language without having to write much code, but also has 闭包other characteristics and dynamic languages.

  • Groovy is fully compatible with Java syntax (because they are based on the JVM)
  • The semicolon is optional
  • Class, the default method is publicthe
  • Attribute automatic-addition to the compiler getter/settermethod
  • Property can be used as a dot ( .) Gets
  • The last value of the expression is as a return value (that is, if the method needs to return a value, you returncan not write)
  • ==Equivalent equals(), noNullPointerExceptions

1.4 Groovy some efficient properties

  • Own assert(断言)statement (assertion can operate anywhere)
  • Optional Type Definition (corresponding to a weakly typed programming languages)
  • Optional brackets (parentheses parameters such as call can not write)
  • String (expressed in three forms: single and double quotation marks, and three single quotes)
  • Set of API (Groovy in List, Map a more simple wording)
  • Closure

Two, Gradle installation configuration (Windows)

2.1 Prerequisites

  • The JDK: JDK 8(JDK & JRE need to 8 or higher, this is used java version "1.8.0_65")

2.2 Manual installation

  The current version is version 5.4.1 Gradle, on April 26, 2019 release. Distribution zip files in two versions:

  When in doubt, choose only a binary version and see the online documentation and source . You need to use the old version? See version page .

2.3 environment configuration

  1. New directory under the disk D D:\Gradle, and download the gradle-5.4.1-bin.zipunzip to the folder;
  2. Editing environment variables Pathvariable, add entries D:\Gradle\gradle-5.4.1\bin, click "OK" to save.

2.4 Gradle verify whether the installation was successful

  • Windows + R-> input cmdinto the command line;
  • Run gradle -vView Gradle version information.
C:\Users\Administrator>gradle -v

Welcome to Gradle 5.4.1!

Here are the highlights of this release:
 - Run builds with JDK12
 - New API for Incremental Tasks
 - Updates to native projects, including Swift 5 support

For more details see https://docs.gradle.org/5.4.1/release-notes.html


------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------

Build time:   2019-04-26 08:14:42 UTC
Revision:     261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_65 (Oracle Corporation 25.65-b01)
OS:           Windows 10 10.0 amd64

Third, the document reference

3.1 Gradle official documents

3.2 Construction of the Eclipse IDE system Gradle

3.3 Gradle in the IntelliJ IDEA

3.4 Gradle vs Maven

Migrating from Apache 3.5 Maven to Gradle

Guess you like

Origin www.cnblogs.com/wumz/p/10948908.html