Atlas:构建-基线发布-动态部署-远程bundle-单模块部署-发布bundle至私有Maven库

构建

1
2
cd app
..\gradlew.bat clean assembleDebug

产物目录:app/build/ouput/apk

AndroidManifest.xml

1
2
3
4
<application android:name="android.taobao.atlas.startup.AtlasBridgeApplication"/>

<meta-data android:name="REAL_APPLICATION" android:value="cn.appblog.atlas.DemoApplication">
<meta-data android:name="multidex_enable" android:value="true">

基线发布

1
2
cd app
..\gradlew.bat publish

产物目录:Maven仓库目录

动态部署

参考Tpatch.txt

Tpatch构建

1
2
cd app
..\gradlew.bat clean assembleDebug -DapVersion=1.0.0 -DversionName=1.0.1

产物目录:app/build/ouput/tpatch-debug

  • patch-1.0.1@1.0.0tpatch
  • update.json

Tpatch结构

差异化classes.dex及res目录

执行动态部署

1
2
adb push build/outputs/tpatch-debug/update-1.0.0.json /sdcard/Android/data/com.taobao.demo/cache/update-1.0.0.json
adb push build/outputs/tpatch-debug/patch-1.0.1@1.0.0.tpatch /sdcard/Android/data/com.taobao.demo/cache/patch-1.0.1@1.0.0.tpatch

远程bundle

注:远程bundle不会打包进apk中

1
adb push build/outputs/remote-bundles-debug/libcom_taobao_remotebundle.so /sdcard/Android/data/com.taobao.demo/cache

单模块部署(热部署)

需要重启APP生效

1
2
cd firstbundle
..\gradlew.bat clean assemblePatchDebug

发布bundle至私有Maven库

发布bundle:firstbundle/build.gradle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
group = 'com.taobao.android.atlasdemo'
version = '1.0.0';

apply plugin: 'maven'
apply plugin: 'maven-publish'

publishing {
repositories {
mavenLocal()
}
publications {
maven(MavenPublication) {
artifact "${project.buildDir}/outputs/awb/${project.name}-debug.awb"
artifactId "firstbundle"
}
}
}
1
2
cd firstbundle
..\gradlew.bat publish

引用bundle:app/build.gradle

1
2
//bundleCompile project(':firstbundle')
compile 'com.taobao.android.atlasdemo:firstbundle:1.0.0@awb'

移除setting.gradle中的include ':firstbundle'

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :