2014年5月30日 星期五

CI: Execute Static Analysis through Ant on Jenkins

The purpose of this article focuses on software quality, and introduces these tools like uses lint, find bugs and checkstyle tool are how to complete the tasks.

1.Lint
 Install Lint
The stage is similar to the steps which the above session mentioned, as the following diagram.



 Set Android SDK Root path on Jenkins’s Configuration 
The stage is similar to the steps which the above session mentioned, as the following diagram.



 Set Project Configurations and Post-build Actions
The setting of the following sample is for Windows cmd, so the sample is to use “Windows Batch Command”. If using Linux, please change into “Shell Command”, as the following diagram.



 Build a Project, as the following diagrams.



 Observe results
After successfully building this project, you can checkup whether the workspace about it exists a lint-results.xml file. Then, the final result shows the following diagrams.




2.CheckStyle and FindBugs
 Install Findbug and CheckStyle
The stage is similar to the steps which the above session mentioned, as the following diagrams.




 Create a custom_rules.xml file
The purpose of the file is to describe how to construct results about FindBugs and CheckStyle, as the following source code.
 Add libs and file about FindBugs and CheckStyle
After the above steps, you should put the resources about them into your project, as the following diagrams. The Urls of FindBugs and CheckStyle lib are http://findbugs.sourceforge.net/ and http://checkstyle.sourceforge.net/.




 Set Project Configurations, as the following diagram


 Execute your project, as the following diagrams



 Observe final results, as the following diagrams



3.References
Book: CI – Continuous integration
Website: http://jenkins-ci.org/
Website: http://ithelp.ithome.com.tw/question/10109773

2014年5月29日 星期四

CI: Build an Android project through Ant on Jenkins

This article will introduce how to utilize a project from a Git pugin to complete the whole steps, and include Installing Git Plugin. You can try to read the article, if not understanding how to install Jenkins.

1.Install Git Plugin
You can enter Jenkins’s dashboard to enter Jenkins -> Manage Jenkins -> Manage Plugins, and choose “Available” label as well as search it through the “Filter” tool, as the following diagram.



2.Execute a Project
 Set a Project
You can select “New Item” icon and input a project name, which is used to identify your task, as well as choose “Build a free-style-software project”, as the following diagram.



 Set Configurations
You can enter Jenkins configuration, and fill out values about Git which you want to input. On the other hand, you need to setup another values about Ant, which is a kind of tool building your source code and constructing executive files for Android. Finally, you can set an option about sending an e-mail to notify you after building failures, but this option is optional, as the following diagrams.




 Set Project Configurations
First, after saving the above results, you should select project -> Confingure. Then, you can input your Git resource and information, as the following diagrams.





 Set Build Information
The purpose of this step is to build your source code and construct an apk file through Ant tool; however, you should offer a build.xml file in your project through Ant tool, as the following diagrams. If skipping the step which the above mentioned, you may be fail on this stage.



 Build a project
After setting project configurations, you can press the build icon to complete the stage. Then, you will see the results after the project is successfully built, as the following diagrams.




3.References
Book: CI – Continuous integration
Website: http://jenkins-ci.org/

2014年5月27日 星期二

CI: Installation Jenkins on Widows

1.Purpose
The spirit of the article is how to install Jenkins Server on Windows, create a Build Job, and observe the final result about building job. If you want to successfully complete the installation, you should setup JDK and Android SDK before.

1.1. Installation
After installing JDK and Android SDK, you can download Jenkins from the URL – http://mirrors.jenkins-ci.org/war/, and input the following instructions via Windows cmd.exe to install Jenkins.war, as the first diagram.


Then, you will see that the instructions is executing on the cmd and the whole result of Jenkins has been installed, as the following results.



1.2. General Settings
Before you use Jenkins, you can choose Jenkins -> Manage Jenkins -> Manage Plugins through Jenkins’s dashboard, and install the following plugins as well as set Jenkins’s language, as the following diagram.


Then, when completing the above steps, you can select Jenkins -> Manage Jenkins -> Configure System to set general system parameters, as the following diagrams.





2.References
Book: CI – Continuous integration
Website: http://jenkins-ci.org/