GradleforAndroid中文版
热门搜索: 中考 高考 考试 开卷17
服务电话 024-96192/23945006
 

GradleforAndroid中文版

编号:
9787121300158001
销售价:
¥42.63
(市场价: ¥49.00)
赠送积分:
43
商品介绍

Gradle是Android 开发小组于2013年推出的作为Android 应用的首选的构建系统。Gradle可以很容易地扩展构建,并插入到现有的构建过程中来。它提供了一套类Groovy 的DSL 语言,用于申明构建和创建任务,让依赖管理变得更加简单。此外,它是完全免费和开源的。本书共分9章,依次介绍了Gradle的基础知识、基本自定义构建、依赖管理、创建构建Variants、管理多模块构建、运行测试、创建tasks和插件、设置持续集成,以及高级自定义构建。

目录
1 Gradle和Android Studio入门 ............................................................................................. 1
1.1 Android Studio .......................................................................................................................1
1.2 理解Gradle基础 .....................................................................................................................3
1.2.1 项目和任务................................................................................................................3
1.2.2 构建生命周期............................................................................................................4
1.2.3 构建配置文件............................................................................................................4
1.2.4 项目结构....................................................................................................................5
1.3 创建新项目 ............................................................................................................................6
1.4 Gradle Wrapper入门 ............................................................................................................10
1.4.1 获取Gradle Wrapper ...............................................................................................10
1.4.2 运行基本构建任务..................................................................................................12
1.5 迁移出Eclipse ......................................................................................................................13
1.5.1 导入向导..................................................................................................................13
1.5.2 手动迁移..................................................................................................................15
1.6 总结 ......................................................................................................................................17
2 基本自定义构建 ............................................................................................................... 19
2.1 理解Gradle文件 ...................................................................................................................19
2.1.1 settings 文件 ............................................................................................................20
Gradle for Android 中文版
【XII】
2.1.2 顶层构建文件..........................................................................................................20
2.1.3 模块的构建文件......................................................................................................21
2.2 任务入门 ..............................................................................................................................23
2.2.1 基础任务..................................................................................................................24
2.2.2 Android 任务 ...........................................................................................................24
2.2.3 Android Studio .........................................................................................................25
2.3 自定义构建 ..........................................................................................................................27
2.3.1 操控manifest 条目 ..................................................................................................28
2.3.2 BuildConfig 和资源 .................................................................................................29
2.3.3 项目范围的设置......................................................................................................30
2.3.4 项目属性..................................................................................................................30
2.3.5 默认的任务..............................................................................................................32
2.4 总结 ......................................................................................................................................32
3 依赖管理 .......................................................................................................................... 33
3.1 依赖仓库 ..............................................................................................................................33
3.1.1 预定义依赖仓库......................................................................................................34
3.1.2 远程仓库..................................................................................................................35
3.1.3 本地仓库..................................................................................................................36
3.2 本地依赖 ..............................................................................................................................37
3.2.1 文件依赖..................................................................................................................37
3.2.2 原生依赖库..............................................................................................................37
3.2.3 依赖项目..................................................................................................................38
3.3 依赖概念 ..............................................................................................................................39
3.3.1 配置..........................................................................................................................39
3.3.2 语义化版本..............................................................................................................40
3.3.3 动态化版本..............................................................................................................40
3.4 Android Studio .....................................................................................................................41
3.5 总结 ......................................................................................................................................43
目录
【XIII】
4 创建构建Variant .............................................................................................................. 44
4.1 构建类型 ..............................................................................................................................45
4.1.1 创建构建类型..........................................................................................................45
4.1.2 源集..........................................................................................................................47
4.1.3 依赖..........................................................................................................................49
4.2 product flavor .......................................................................................................................49
4.2.1 创建product flavor ..................................................................................................49
4.2.2 源集..........................................................................................................................50
4.2.3 多种定制的版本......................................................................................................50
4.3 构建variant ..........................................................................................................................51
4.3.1 任务..........................................................................................................................52
4.3.2 源集..........................................................................................................................52
4.3.3 源集合并资源和manifest .......................................................................................52
4.3.4 创建构建variant .....................................................................................................53
4.3.5 variant 过滤器 .........................................................................................................55
4.4 签名配置 ..............................................................................................................................56
4.5 总结 ......................................................................................................................................58
5 管理多模块构建 ............................................................................................................... 59
5.1 解剖多模块构建 ..................................................................................................................59
5.1.1 重访构建生命周期..................................................................................................61
5.1.2 模块任务..................................................................................................................62
5.2 将模块添加到项目 ..............................................................................................................62
5.2.1 添加一个Java 依赖库 ............................................................................................63
5.2.2 添加一个Android 依赖库 ......................................................................................64
5.2.3 融合Android Wear ..................................................................................................64
5.2.4 使用Google App Engine .........................................................................................65
5.3 提示和最佳实践 ..................................................................................................................69
5.3.1 在Android Studio 中运行模块任务 .......................................................................69
5.3.2 加速多模块构建......................................................................................................70
Gradle for Android 中文版
【XIV】
5.3.3 模块耦合..................................................................................................................70
5.4 总结 ......................................................................................................................................71
6 运行测试 .......................................................................................................................... 72
6.1 单元测试 ..............................................................................................................................72
6.1.1 JUnit .........................................................................................................................72
6.1.2 Robolectric ...............................................................................................................76
6.2 功能测试 ..............................................................................................................................77
6.3 测试覆盖率 ..........................................................................................................................81
6.4 总结 ......................................................................................................................................82
7 创建任务和插件 ............................................................................................................... 83
7.1 理解Groovy .........................................................................................................................83
7.1.1 简介..........................................................................................................................84
7.1.2 类和成员变量..........................................................................................................85
7.1.3 方法..........................................................................................................................85
7.1.4 Closures....................................................................................................................86
7.1.5 集合..........................................................................................................................87
7.1.6 Gradle 中的Groovy ................................................................................................88
7.2 任务入门 ..............................................................................................................................89
7.2.1 定义任务..................................................................................................................89
7.2.2 任务剖析..................................................................................................................91
7.2.3 使用任务来简化release 过程 ................................................................................94
7.3 Hook到Android插件 ...........................................................................................................97
7.3.1 自动重命名APK.....................................................................................................97
7.3.2 动态创建新的任务..................................................................................................98
7.4 创建自己的插件 ................................................................................................................100
7.4.1 创建一个简单的插件............................................................................................100
7.4.2 分发插件................................................................................................................101
目录
【XV】
7.4.3 使用自定义插件....................................................................................................103
7.5 总结 ....................................................................................................................................104
8 设置持续集成 ................................................................................................................ 105
8.1 Jenkins ................................................................................................................................105
8.1.1 设置Jenkins...........................................................................................................106
8.1.2 配置构建................................................................................................................107
8.2 TeamCity ............................................................................................................................109
8.2.1 设置TeamCity .......................................................................................................110
8.2.2 配置构建................................................................................................................110
8.3 Travis CI............................................................................................................................. 111
8.4 自动化进阶 ........................................................................................................................113
8.4.1 SDK mananger 插件 ..............................................................................................114
8.4.2 运行测试................................................................................................................114
8.4.3 持续部署................................................................................................................115
8.4.4 Beta 分发包 ...........................................................................................................116
8.5 总结 ....................................................................................................................................117
9 高级自定义构建 ..............................................................................................................118
9.1 减少APK文件大小 ............................................................................................................118
9.1.1 ProGuard ................................................................................................................119
9.1.2 缩减资源................................................................................................................120
9.2 加速构建 ............................................................................................................................121
9.2.1 Gradle 参数 ............................................................................................................122
9.2.2 Android Studio .......................................................................................................123
9.2.3 Profiling..................................................................................................................124
9.2.4 Jack 和Jill..............................................................................................................125
9.3 忽略Lint .............................................................................................................................126
9.4 在Gradle中使用Ant ...........................................................................................................126
9.4.1 在Gradle 中运行Ant 任务 ...................................................................................126
Gradle for Android 中文版
【XVI】
9.4.2 导入整个Ant 脚本................................................................................................127
9.4.3 属性........................................................................................................................129
9.5 高级应用部署 ....................................................................................................................129
9.6 总结 ....................................................................................................................................131

商品参数
基本信息
品牌/出版社 电子工业出版社
ISBN 9787121300158
条码 9787121300158
编者 KevinPelgrims
译者
出版年月 2016.1
开本
装帧
页数
字数
版次
印次
纸张
商品评论

暂无商品评论信息 [发表商品评论]

商品咨询

暂无商品咨询信息 [发表商品咨询]