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

构建

cd app
..\gradlew.bat clean assembleDebug

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

AndroidManifest.xml

<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">

基线发布

cd app
..\gradlew.bat publish

产物目录:Maven仓库目录

动态部署

参考Tpatch.txt

Tpatch构建

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目录

执行动态部署

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中

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

单模块部署(热部署)

需要重启APP生效

cd firstbundle
..\gradlew.bat clean assemblePatchDebug

发布bundle至私有Maven库

发布bundle:firstbundle/build.gradle

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"
        }
    }
}
cd firstbundle
..\gradlew.bat publish

引用bundle:app/build.gradle

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

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

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/18/atlas-build-baseline-release-dynamic-deployment-remote-bundles-single-module-deployment-publish-bundles-to-private-maven-library/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Atlas:构建-基线发布-动态部署-远程bundle-单模块部署-发布bundle至私有Maven库
构建 cd app ..\gradlew.bat clean assembleDebug 产物目录:app/build/ouput/apk AndroidManifest.xml <application android:name="android.taobao.……
<<上一篇
下一篇>>
文章目录
关闭
目 录