本插件自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,从而加速 Android 项目的全量编译速度
Plugin version | Gradle version |
---|---|
4.0.0+ | 6.1.1+ |
4.1.0+ | 6.5+ |
4.2.0+ | 6.7.1+ |
7.0 | 7.0+ |
- 依赖 gradle 插件
buildscript {
dependencies {
classpath 'io.github.trycatchx:rocketx:1.0.9'
}
}
- 依赖 AS 插件 android studio setting->plugins-> marketplace 搜索 RocketX 安装(搜索不到使用本地安装)
下载项目中的 lib 文件夹两个 jar:
- rocketX-studio-plugin.jar 通过 android studio setting->plugins->install plugin from disk 进行安装
- rocketx.jar 通过在项目工程根目录新建文件夹Plugin,置放进去 Plugin文件夹,在根目录的build.gradle 写入 classpath fileTree(dir: './Plugin', include: ['*.jar'])
- openLog :打开 log
- transFormList:debug 阶段可以禁用的 transform ,速度更快(可通过build 的 log 搜索关键字 transFormList 查看自己项目引用了哪些 transform,并手动配置)
//配置插件编译项
RocketX {
openLog = true
//加速模式 禁用可禁用的 transform ,速度更快
transFormList = ["sensorsAnalyticsAutoTrack","..xx"]
}
- 第一次的加速,是最慢的因为需要全量编译后,打出 aar 上传到 LocalMaven
- 目前如果编译出错,请重新再 run 一次,出现的问题 欢迎提 issue
名单 | 留言 |
---|---|
JustAClamber | 知者不惑 |
louis | louis-lzt |
TryCatch | 日落西来,月向东 |
FamilyCYZ | 什么也没有留下 |
Copyright (C) 2021 [email protected]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.