VirtualAPK 插件打包脚本 Posted on 2018-11-02 最近项目使用了didi开源的插件包框架,多个模块打包很繁琐,索性自己写了一个小脚本,如果自己使用,需要根据实际情况修改下里面涉及到路径,代码如下: 1234567891011121314151617181920212223242526272829303132333435#!/usr/bin/env python# -*- coding: UTF-8 -*-import osimport multiprocessing#获取当前目录root = os.getcwd()disrs = os.listdir(root)#list = [path for path in disrs if path.__contains__('ICQueryPlugin')]list = ['ICQueryPlugin','NoSettleICPlugin']def copyfile(s,t): print('') if not os.path.exists(t): os.makedirs(t) for file in os.listdir(s): sfile = os.path.join(s,file) tfile = os.path.join(t,file) open(tfile,'wb').write(open(sfile,'rb').read()) print('working end!!!!!!!!')def startwork(path): os.chdir(path) os.system('./gradlew clean assemblePlugin')for path in list: sub = os.path.join(root,path) print(sub) print("开始打包:"+path) multiprocessing.Process(target=startwork(sub)).start() apkpath = os.path.join(sub,'app/build/outputs/plugin/release') copyfile(apkpath,'/Users/ghwang/Desktop/apk') 具体使用 cd 到插件包路径 python 脚本文件.py Have a fun!