Gradle Common commands and principles, and gradle Common commands

Source: Internet
Author: User

Gradle Common commands and principles, and gradle Common commands
Gradle is a new Android App compilation tool introduced by Android Studio to replace the previous Ant-based compilation system. Gradle commands such. /gradlew-v. /gradlew clean. /gradlew build. /gradlew ,. /indicates the current directory. gradlew indicates gradle wrapper. It indicates a gradle package. You can understand that gradle is encapsulated locally in this project, that is, gradle wrapper, the directory and version to which it points are declared in the/gradle/wrapper/gralde-wrapper.properties file. We recommend that you install a global gradle and configure the Path variable to avoid repeated downloading of each project, so that you can directly run gradle build after compiling the project.

After understanding the concept of gradle wrapper, the following common commands are easy to understand.

  • ./Gradlew-v version number

  • ./Gradlew clean clear the build folder in the 9GAG/app directory

  • ./Gradlew build check dependencies and compile and Package

Note that. /The gradlew build command releases all the packages in the debug and release environments. If you only need to Release the release package, what should you do? The following describes a useful command ** assemble **, Such

  • ./Gradlew assembleDebug compilation and debugging package

  • ./Gradlew assembleRelease: Build and Release the package

In addition, assemble can be used with productFlavors. For more information, see the next multi-channel packaging section.

  • ./Gradlew installRelease Release mode package and install

  • ./Gradlew uninstallRelease uninstall the Release mode package


Gradle is an Android compilation system based on the groovy language (JVM-based syntax and a similar scripting language in java). google developed a dsl for Android compilation in groovy language, which is gradle. Therefore, if you encounter a gradle configuration that you don't understand, you can look at the source code of groovy. Generally, you can find a solution. Always remember that groovy is a java-like programming language, not just a scripting language.
In the popular Spring Boot microservice development framework, Groovy can be used instead of Java programming.

Copyright: This article is the original author article, reprint Please retain the source http://blog.csdn.net/offbye

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.