Jenkins git gradle android Automation build configuration

Source: Internet
Author: User

Need to install software (Jenkins Server):

Gradle, SDK

One, Gradle installation (the Gradle version of the server deployment needs to be equal to or higher than the Gradle version of the development environment)

1,: Http://services.gradle.org/distributions (Gradle-2.14.1-all.zip)

2. Upload to Linux and unzip: Unzip Gradle-2.14.1-all.zip

3. Configure Environment variables:

Export gradle_home=/home/cfjekins/gradle/gradle-2.14.1 (GRADLE extracted directory)
Export path= $PATH: $GRADLE _home/bin

4. The source command makes the configuration effective: source. bash_profile (source file name)
5, check whether the configuration is effective: Echo $GRADLE _home
/home/cfjekins/gradle/gradle-2.14.1

Ii. SDK installation (the Server SDK version needs to be consistent with the SDK version of the development environment)

1,: http://tools.android-studio.org/index.php/sdk/(android-sdk_r24.4.1-linux.tgz)

2. Upload to Linux and unzip: Tar zxvf android-sdk_r24.4.1-linux.tgz

(The extracted directory does not have Build-tools, platforms, Platform-tools directory, need to update)

3. Configure Environment variables:

Export Android_home=/home/cfjekins/android_sdk/android-sdk-linux (directory after SDK decompression)
Export path= $PATH: $ANDROID _home/tools: $ANDROID _home/platform-tools: $PATH

Make configuration effective: source. bash_profile (source file name)
Verify that the configuration is in effect: Echo $ANDROID _home

4, update build-tools, platforms, Platform-tools

 Using the mirror server address update, the address is as follows:

Dalian Neusoft Institute of Information Mirror server address: http://mirrors.neusoft.edu.cn Port: 80

Beijing University mirror server address: ipv4:http://ubuntu.buct.edu.cn/Port: 80, ipv4:http://ubuntu.buct.cn/Port: 80, ipv6:http:// ubuntu.buct6.edu.cn/Port: 80

Shanghai GDG Mirror server address: http://sdk.gdgshanghai.com Port: 8000

1> into the Tools directory under the SDK decompression directory: Cd/home/cfjekins/android_sdk/android-sdk-linux/tools

2> View the image list, tools directory Execution command:./android List SDK--proxy-host sdk.gdgshanghai.com--proxy-port 8000-s

To play an updatable list:

  

3> Update, Tools directory Execute command:./android Update SDK--proxy-host sdk.gdgshanghai.com--proxy-port 8000-s-u-t Platform c1> (the parameter after-T is the update name)

Platform, Platform-tools, build-tools after the update, unzip the directory can see platform, Platform-tools, Build-tools directory, updated the following SDK directory:

Build-tools Directory: (23.0.1 version is a newer version, other versions are downloaded from Android Studio and put in, because Linux updates from the mirror server is the latest version on the mirror server, The latest version or other version needs to be downloaded and thrown in.

  

Paltforms Directory: (android-23/24 version is also downloaded from Android Studio to put in, here the highest SDK version needs to be consistent with the development Environment SDK version, our highest version is android-24, and the highest version of the Mirror address update is android-22, so you need to download android-24 put it in)

  

Paltform-tools directory:

Here the SDK is installed completely.

Third, install Gradle plugin

jenkins--> System Management--Manage plugins--select "Gradle plugin" to download and install

Iv. Configuration Gradle

System Management-->globl Tool configuration, such as:

  

V. New job and Configuration

Build a free-style software project with new jenkins->

1. General Configuration

2. Source code Management

Repository ur:git Project URL (ssh only on Linux)

Credentials:jenkins login git credentials, Linux environment can only set SSH mode (through the Add settings, detailed settings view jenkins SSH login git configuration (SSH key generated via eclipse))

  

3. Build triggers

This is set to run Job 2 o'clock in the morning every day.

4. Build--invoke Gradle Script

1> System Setup-->global Tool configuration Gradle version (I have set two versions here)

Name: The gradle of the configuration, please fill in

Gradle_home: GRADLE of the server on the Extract directory

  

Gradle configuration in the 2>job

Gradle version: Select the Gradle version that was configured in the previous step

Tasks: Build Task (--debug: output format for build log)

5. Configure mail delivery

Before you set up your Inbox, you can send mailbox settings on "System Management-system settings-and mail Notifications".

Recipients: Recipient Mailbox

Jenkins git gradle android Automation build configuration

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.