VirtualApk之插件部分

2020-03-19  本文已影响0人  大非_

*注:本节只针对VirtualApk框架的插件部分,不涉及宿主

VirtualAPK官方github地址及项目说明文档:https://github.com/didi/VirtualAPK

1.构建相关

-在项目根目录的build.gradle文件中添加依赖

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.didi.virtualapk:gradle:0.9.8.6'
    }

*注:目前VirtualAPK不支持Gradle插件3.2.1以上版(不支持AndroidX包)

//引入插件
apply plugin: 'com.didi.virtualapk.plugin'

virtualApk {
    packageId = 0x6F // 资源的包id,每个插件id唯一,保证在[0x02, 0x7E]之间
    targetHost = '../../VirtualAPK-master/app' // 宿主中应用模块的路径
    applyHostMapping = true //宿主映射,可选,默认值:true
}
   //签名包分类
    flavorDimensions "demo"
    productFlavors {
        beijing {
            dimension "demo"
            applicationId 'com.didi.virtualapk.demo'
        }
        shanghai {
            dimension "demo"
            applicationId 'com.didi.virtualapk.demo'
        }
    }
    //  签名
    signingConfigs {
        release {
            storeFile file("../../keystore/test.keystore")
            storePassword "test123456"
            keyAlias "test"
            keyPassword "test123456"
        }
    }

2.生成插件Apk

生成插件Apk
apk路径
上一篇下一篇

猜你喜欢

热点阅读