Automatic building of Android projects using Jenkins (6)

Source: Internet
Author: User
Tags configuration settings

I've already introduced the use of Maven to build, to introduce Gralde's automated build.

What is Gralde? The official explanation is that

Gradle is an open source build automation system.  Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else. Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven to a more effec tive to build. Powered by Build programming Language, Gradle is concise yet expressive.

The environment setup steps are roughly the same as Maven's, just replace Maven with Gralde.

Download Gralde, unzip, and add the Gralde Bin directory to the environment variable path, then configure Jenkins, select "Manage Jenkins" and "Set system" and fill in the corresponding settings with the directory path just Gralde. Finally installs the Gradle plugin in Jenkins's plug-in program.

Specific examples of Gralde

Top-level build file where can add configuration options common to all Sub-projects/modules.buildscript {Reposito Ries {        mavencentral ()    }    dependencies {        classpath ' com.android.tools.build:gradle:1.0.0 '        // Note:do not place your application dependencies here; They belong        //In the individual module Build.gradle files    }}allprojects {    repositories {        mavenlocal () C9/>maven {            url "Http://localhost/repo"}}    }

Apply plugin: ' com.android.application '//apply plugin: ' Com.android.library ' android {compilesdkversion ' Buildtool Sversion "21.1.2" defaultconfig {applicationid "Com.example.demo" minsdkversion  On Versioncode 1 Versionname "2.1.1"} signingconfigs {releaseconfig {storefile File (system.getenv ("KEYSTORE")) Storepassword system.getenv ("Keystore_password") Keyalias system.ge            Tenv ("Key_alias") Keypassword system.getenv ("Key_password")}} buildtypes {release { Signingconfig Signingconfigs.releaseconfig}} packagingoptions {exclude ' meta-inf/license.txt                '} lintoptions {Abortonerror false} sourcesets {main {manifest {            Srcfile ' Src/main/androidmanifest.xml '} java {srcdir ' Src/main/java '}         res {       Srcdir ' Src/main/res '} assets {Srcdir ' assets '}}}}de pendencies {Compile filetree (dir: ' Libs ', include: [' *.jar ']) Compile project (': Framework ') compile ' com.example : libxxx:1.0 '}

The configuration settings for the project in Jenkins also need to be changed

Automatic building of Android projects using Jenkins (6)

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.