Android持续集成——lint
来源:互联网 发布:淘宝店铺一年费用多少 编辑:程序博客网 时间:2024/05/21 11:20
http://blog.csdn.net/liaoqianchuan00/article/details/23131381
http://blog.csdn.net/liaoqianchuan00/article/details/23131381
http://blog.csdn.net/liaoqianchuan00/article/details/23131381
http://blog.csdn.net/liaoqianchuan00/article/details/23131381
Android持续集成
版权声明:本文为博主原创文章,未经博主允许不得转载。
目录(?)[+]
- Lint
- Findbugs
- Checkstyle
Android 持续集成
Lint
参考:
https://wiki.jenkins-ci.org/display/JENKINS/Android+Lint+Plugin
1. 进入jenkins插件管理,找到Android Lint Plugin,选择并且安装.之后重启Jenkins。
2. 在jenkins的job中,在build targets后面加上一项lint。
3. 构建job。你就可以看见lint的结果了
4. 之后你还可以在job的主页看到lint结果的变化趋势。
Findbugs
参考地址:
https://wiki.jenkins-ci.org/display/JENKINS/Building+an+Android+app+and+test+project
1. 下载Find’Bugs并且安装,假设安装在/data/findbugs.
下载地址:
http://sourceforge.jp/projects/sfnet_findbugs/downloads/findbugs/3.0.0/findbugs-3.0.0-dev-20131204-e3cbbd5.zip/
或者
http://findbugs.sourceforge.net/downloads.html
2. 从findbugs的安装目录lib下面拷贝findbugs-ant.jar到ant的lib目录下面
3. 在local.property文件中加入,也可以在jenkins的ant构建中加入
findbugs.home=C:\\develope\\findbugs-3.0.0
4. 在工程的build.xml文件中加入以下任务
<taskdefname="findbugs"classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
<targetname="findbugs">
<mkdirdir="reports" />
<findbugshome="${findbugs.home}" output="xml"outputFile="reports/findbugs.xml"
excludeFilter="findbugs-exclude.xml">
<auxClasspathpath="${android.jar}" />
<classlocation="${out.dir}" />
</findbugs></target>
5. 不要包含对R文件的check,在工程下面创建findbugs-exclude.xml。
<?xmlversion="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Classname="~.*\.R\$.*"/>
<Bug code="Nm"/>
</Match>
</FindBugsFilter>
6. 在Jenkins中进入插件管理,下载安装FindBugs Plugin并且重启Jenkins。
7. 在job的ant targets中加入findbugs。
8. 最后加上publish findbugs analysis results
**/findbugs.xml
Checkstyle
参考地址:
http://blog.jazzy.pro/en/jenkins-ci-and-android/
下载checkstyle
http://sourceforge.net/projects/checkstyle/
1. 将文件解压到一个指定的地方
2. 在ant build.xml中加入
<taskdef resource="checkstyletask.properties"
classpath="${checkstyle.home}/checkstyle-5.7-all.jar"/>
<target name="checkstyle">
<checkstyle config="${checkstyle.home}/sun_checks.xml"
failureProperty="checkstyle.failure"
failOnViolation="false">
<formatter type="xml"
tofile="reports/checkstyle.xml"/>
<fileset dir="${source.dir}"includes="**/*.Java"/>
</checkstyle>
</target>
3. 在job ant构建中加入以下的属性定义:
checkstyle.home= C: \\develope\\checkstyle-5.7
4. 在ant target中加入checkstyle
5. 在构建后操作中加入Publish Checkstyle analysis results. 填入**/checkstyle.xml
如果你想要加入发送邮件的功能:
参考
http://checkstyle.sourceforge.net/anttask.html
<!-- run this target as part ofautomated build -->
<target name="checkstyle-nightly"
depends="checkstyle"
if="checkstyle.failure"
description="Sends email ifcheckstyle detected code conventions violations.">
<!-- use your own server and email addresses below. See Antdocumentation for details -->
<mail from="qa@some.domain"
tolist="someone@some.domain,someoneelse@some.domain"
mailhost="mailbox.some.domain"
subject="Checkstyle violation(s)in project ${ant.project.name}"
files="checkstyle_report.html"/>
</target>
- Android持续集成——lint
- 【lint】Android代码优化——使用Android lint工具
- Android+Jenkins——从持续集成到测试发布
- Android持续集成
- Android持续集成
- Android持续集成
- 持续交付学习札记——第三章持续集成
- 《持续交付》笔记——第3章 持续集成
- 持续交付之三——持续集成
- 我们正在路上—从持续集成到持续发布
- Android API——通过lint优化代码(Improving Your Code with lint)
- 【lint】Android Lint简介
- 持续集成——大师的观点
- 持续集成之路——Maven
- 持续集成工具——Hudson
- ITOO——Jenkins持续集成
- 【工具】持续集成工具——Jenkins
- 云端持续集成——AppVeyor
- MyBatis整体Review
- 点击进入quick search box,搜索不到通话记录
- Eclipse中编辑xml文件不自动提示怎么办?
- spring3.1.1 spring mvc 和mybatis3框架整合配置
- 漂亮的servlet-acquire cookies
- Android持续集成——lint
- 广度优先搜索(breadth_first search)
- 对数组的每个元素仍是数组的遍历方法,c#,foreach,for
- HDU 3988 Harry Potter and the Hide Story(数论)(素数筛法)
- svn创建搭建教程
- C++迷宫问题(BFS)
- Activity跳转Flag详解
- Django中连接Mysql报错 No module named MySQLdb
- 多用类型常量,少用#define预处理指令