
一个 manifest 仓库背后的工程化用 repo 管理近 80 个 Cordova 鸿蒙化三方库本文聚焦其中最容易被忽视、却最能体现工程化思维的一个仓库——CPF-Cordova/manifest它用 Android 生态的repo工具把1 个框架主工程 78 个三方插件仓库聚合为一键同步的代码集合适合读者需要批量管理多仓库生态的维护者、想一键拉取全部 Cordova 鸿蒙插件的迁移开发者。一、manifest 仓库是什么1.1 repo 工具与 manifest 的渊源Android 开源项目AOSP有数百个 git 仓库Google 为此创造了repo工具用一个 XML manifest 文件描述要拉哪些仓库、放哪个路径、跟踪哪个分支然后repo init-umanifest仓库地址reposync即可一次性克隆全部仓库并建立工作区。CPF-Cordova 把这套机制原样搬到了鸿蒙生态——manifest 仓库就是Cordova 鸿蒙化全家桶的目录索引。1.2 仓库结构实测manifest 仓库共 81 个 XML 文件 1 个 README分四类文件数量作用default.xml1主 manifest只含框架主工程 cordova-openharmony跟踪 develop 分支default_master.xml1主工程 master 分支版本cordova_plugin.xml78每个插件一份独立 manifestcordova_plugin_master.xml78各插件 master 分支版本README.md1组织介绍 全部插件仓库地址表两类 manifest 的分工default.xml实测内容?xml version1.0 encodingUTF-8?manifestremotefetchhttps://atomgit.com/CPF-Cordova/nameoriginreviewhttps://atomgit.com/CPF-Cordova//defaultremoteoriginrevisionmastersync-j4/!-- 主工程 --projectgroupsdefaultnamecordova-openharmonypathcordova-openharmonyremoteoriginrevisiondevelop//manifestdefault.xml→ 主工程develop 分支适配开发版default_master.xml→ 主工程master 分支稳定版单插件 manifest如cordova_camera.xml结构完全同构只是 project 节点换成插件仓库projectgroupsdefaultnamecordova-plugin-camerapathcordova-plugin-cameraremoteoriginrevisiondevelop/每个文件都是自包含的remotefetch 地址 review 地址、default分支策略 并发数、project仓库名 本地路径三要素齐全任意一个文件都能单独repo init。二、78 个三方库清单存量 Cordova 生态的鸿蒙覆盖以下清单从 78 份插件 manifest 与 README 插件表中提取每个三方库均附 AtomGit 仓库地址即 CPF-Cordova 组织的插件全集名称取自 manifest/README 中文说明2.1 Apache 核心插件官方 core plugins 对应插件仓库地址设备插件cordova-plugin-devicehttps://atomgit.com/CPF-Cordova/cordova-plugin-device对话框插件cordova-plugin-dialogshttps://atomgit.com/CPF-Cordova/cordova-plugin-dialogs电量信息查询cordova-plugin-battery-statushttps://atomgit.com/CPF-Cordova/cordova-plugin-battery-status相机插件cordova-plugin-camerahttps://atomgit.com/CPF-Cordova/cordova-plugin-camera媒体插件cordova-plugin-mediahttps://atomgit.com/CPF-Cordova/cordova-plugin-media媒体选择cordova-plugin-media-capturehttps://atomgit.com/CPF-Cordova/cordova-plugin-media-capture本地文件管理插件cordova-plugin-filehttps://atomgit.com/CPF-Cordova/cordova-plugin-file文件上传下载cordova-plugin-file-transferhttps://atomgit.com/CPF-Cordova/cordova-plugin-file-transfer地理定位插件cordova-plugin-geolocationhttps://atomgit.com/CPF-Cordova/cordova-plugin-geolocation获取网络信息插件cordova-plugin-network-informationhttps://atomgit.com/CPF-Cordova/cordova-plugin-network-information震动插件cordova-plugin-vibrationhttps://atomgit.com/CPF-Cordova/cordova-plugin-vibration状态栏cordova-plugin-statusbarhttps://atomgit.com/CPF-Cordova/cordova-plugin-statusbar启动屏cordova-plugin-splashscreenhttps://atomgit.com/CPF-Cordova/cordova-plugin-splashscreen白名单cordova-plugin-whitelisthttps://atomgit.com/CPF-Cordova/cordova-plugin-whitelist全球化插件cordova-plugin-globalizationhttps://atomgit.com/CPF-Cordova/cordova-plugin-globalization加速度传感器cordova-plugin-device-motionhttps://atomgit.com/CPF-Cordova/cordova-plugin-device-motion陀螺仪传感器cordova-plugin-device-orientationhttps://atomgit.com/CPF-Cordova/cordova-plugin-device-orientation通讯录插件cordova-plugin-contactshttps://atomgit.com/CPF-Cordova/cordova-plugin-contacts解压缩cordova-plugin-ziphttps://atomgit.com/CPF-Cordova/cordova-plugin-zip2.2 社区热门三方插件按能力域扫码插件仓库地址扫码自定义屏幕cordova-plugin-qrscannerhttps://atomgit.com/CPF-Cordova/cordova-plugin-qrscanner扫码插件phonegap-plugin-barcodescannerhttps://atomgit.com/CPF-Cordova/phonegap-plugin-barcodescanner相册/媒体插件仓库地址选择多张图片插件cordova-plugin-imagepickerhttps://atomgit.com/CPF-Cordova/cordova-plugin-imagepicker选择多张图片cordova-plugin-telerik-imagepickerhttps://atomgit.com/CPF-Cordova/cordova-plugin-telerik-imagepicker选择多张图片cordova-plugin-mediapicker-dmcsdkhttps://atomgit.com/CPF-Cordova/cordova-plugin-mediapicker-dmcsdk选择照片/视频保存cordova-plugin-photo-libraryhttps://atomgit.com/CPF-Cordova/cordova-plugin-photo-libraryCanvas保存到相册cordova-plugin-canvas2imagehttps://atomgit.com/CPF-Cordova/cordova-plugin-canvas2image相机预览cordova-plugin-camera-previewhttps://atomgit.com/CPF-Cordova/cordova-plugin-camera-preview存储插件仓库地址数据库插件cordova-sqlite-storagehttps://atomgit.com/CPF-Cordova/cordova-sqlite-storage数据库cordova-sqlite-evcore-extbuild-freehttps://atomgit.com/CPF-Cordova/cordova-sqlite-evcore-extbuild-free持久化插件cordova-plugin-nativestoragehttps://atomgit.com/CPF-Cordova/cordova-plugin-nativestorage文件MD5cordova-plugin-file-md5https://atomgit.com/CPF-Cordova/cordova-plugin-file-md5uri转pathcordova-plugin-filepathhttps://atomgit.com/CPF-Cordova/cordova-plugin-filepath网络/浏览器插件仓库地址http请求cordova-plugin-advanced-httphttps://atomgit.com/CPF-Cordova/cordova-plugin-advanced-http获取网络IP地址信息cordova-plugin-networkinterfacehttps://atomgit.com/CPF-Cordova/cordova-plugin-networkinterface内置浏览器cordova-plugin-inappbrowserhttps://atomgit.com/CPF-Cordova/cordova-plugin-inappbrowserionic-webviewcordova-plugin-ionic-webviewhttps://atomgit.com/CPF-Cordova/cordova-plugin-ionic-webview输入/窗口/UI插件仓库地址键盘插件cordova-plugin-keyboardhttps://atomgit.com/CPF-Cordova/cordova-plugin-keyboard键盘插件cordova-plugin-ionic-keyboardhttps://atomgit.com/CPF-Cordova/cordova-plugin-ionic-keyboard导航栏插件cordova-plugin-navigationbarhttps://atomgit.com/CPF-Cordova/cordova-plugin-navigationbar状态栏颜色cordova-plugin-navigationbar-colorhttps://atomgit.com/CPF-Cordova/cordova-plugin-navigationbar-colorspinner插件cordova-plugin-spinnerdialoghttps://atomgit.com/CPF-Cordova/cordova-plugin-spinnerdialog全屏插件cordova-plugin-fullscreenhttps://atomgit.com/CPF-Cordova/cordova-plugin-fullscreen内置浏览器一个分支cordova-plugin-themeablebrowserhttps://atomgit.com/CPF-Cordova/cordova-plugin-themeablebrowsertoast插件cordova-plugin-x-toasthttps://atomgit.com/CPF-Cordova/cordova-plugin-x-toast角标插件cordova-plugin-badgehttps://atomgit.com/CPF-Cordova/cordova-plugin-badge屏幕方向cordova-plugin-screen-orientationhttps://atomgit.com/CPF-Cordova/cordova-plugin-screen-orientation系统/安全插件仓库地址授权插件cordova-plugin-permissionhttps://atomgit.com/CPF-Cordova/cordova-plugin-permission安卓授权cordova-plugin-android-permissionshttps://atomgit.com/CPF-Cordova/cordova-plugin-android-permissions指纹的采集和使用cordova-plugin-fingerprint-aiohttps://atomgit.com/CPF-Cordova/cordova-plugin-fingerprint-aio保持屏幕常亮cordova-plugin-insomniahttps://atomgit.com/CPF-Cordova/cordova-plugin-insomnia最小化/返回插件cordova-plugin-backbuttonhttps://atomgit.com/CPF-Cordova/cordova-plugin-backbutton退出APPcordova-plugin-app-exithttps://atomgit.com/CPF-Cordova/cordova-plugin-app-exit最小化插件cordova-plugin-appminimizehttps://atomgit.com/CPF-Cordova/cordova-plugin-appminimize编译信息cordova-plugin-buildinfohttps://atomgit.com/CPF-Cordova/cordova-plugin-buildinfoapp版本插件cordova-plugin-appversionhttps://atomgit.com/CPF-Cordova/cordova-plugin-appversionapp版本插件cordova-plugin-app-versionhttps://atomgit.com/CPF-Cordova/cordova-plugin-app-version获取配置参数信息cordova-plugin-customconfigparametershttps://atomgit.com/CPF-Cordova/cordova-plugin-customconfigparameters通用连接cordova-plugin-deeplinkhttps://atomgit.com/CPF-Cordova/cordova-plugin-deeplinkjs文件注入cordova-plugin-injectviewhttps://atomgit.com/CPF-Cordova/cordova-plugin-injectview检测屏幕截图cordova-plugin-detect-screenshothttps://atomgit.com/CPF-Cordova/cordova-plugin-detect-screenshot禁止截图cordova-plugin-privacyscreenhttps://atomgit.com/CPF-Cordova/cordova-plugin-privacyscreen通信/定位插件仓库地址蓝牙插件cordova-plugin-ble-centralhttps://atomgit.com/CPF-Cordova/cordova-plugin-ble-central全局监听插件cordova-plugin-broadcasterhttps://atomgit.com/CPF-Cordova/cordova-plugin-broadcaster百度地图定位cordova-plugin-baidumaplocationhttps://atomgit.com/CPF-Cordova/cordova-plugin-baidumaplocation三方 SDK插件仓库地址微信插件cordova-plugin-wechathttps://atomgit.com/CPF-Cordova/cordova-plugin-wechatqqcordova-plugin-qqsdkhttps://atomgit.com/CPF-Cordova/cordova-plugin-qqsdk微博cordova-plugin-weibosdkhttps://atomgit.com/CPF-Cordova/cordova-plugin-weibosdk华为推送插件cordova-plugin-huawei-pushhttps://atomgit.com/CPF-Cordova/cordova-plugin-huawei-push激光推送cordova-plugin-jcorehttps://atomgit.com/CPF-Cordova/cordova-plugin-jcore激光推送jpush-phonegap-pluginhttps://atomgit.com/CPF-Cordova/jpush-phonegap-plugin分享/剪贴板/通知插件仓库地址剪贴板cordova-clipboardhttps://atomgit.com/CPF-Cordova/cordova-clipboard分享cordova-plugin-x-socialsharinghttps://atomgit.com/CPF-Cordova/cordova-plugin-x-socialsharing本地通知插件cordova-plugin-local-notificationhttps://atomgit.com/CPF-Cordova/cordova-plugin-local-notification支付插件仓库地址支付宝cordova-plugin-adam-alipayhttps://atomgit.com/CPF-Cordova/cordova-plugin-adam-alipay支付宝cordova-plugin-alipay-v2https://atomgit.com/CPF-Cordova/cordova-plugin-alipay-v2热更新插件仓库地址热更新插件cordova-hot-code-push-pluginhttps://atomgit.com/CPF-Cordova/cordova-hot-code-push-plugin2.3 覆盖度点评这份清单最值得注意的是中国本土化插件的全覆盖微信、QQ、微博、支付宝、极光推送、华为推送、百度定位——这些是存量企业 Cordova 应用迁移的最大阻塞项全部有了鸿蒙实现。配合热更新插件企业可以在不上架应用市场的情况下持续交付 Web 层更新Web 资源热更新在鸿蒙上的合规边界需自行评估。以上共75 个三方库链接19 个 Apache 核心插件 56 个社区/SDK 插件全部为 AtomGit 实际可达地址链接数据源为 manifest 仓库 README 插件表 78 份插件 manifest 的 project 节点交叉核对。三、manifest 的正确打开方式3.1 一键拉取全家桶# 安装 repoAndroid 生态通用工具# macOS: brew install repo# 拉取主工程develop 分支mkdircordova-ohoscdcordova-ohos repo init-uhttps://atomgit.com/CPF-Cordova/manifest.git-mdefault.xml reposync-j8# 或拉取某插件如扫码repo init-uhttps://atomgit.com/CPF-Cordova/manifest.git-mcordova_camera.xml reposync得到的目录结构直接就是可构建的相对布局sync-j4控制并发克隆数。3.2 与 hcordova 工作流的关系manifest 与 hcordova CLI 是两条互补的获取路径路径命令适合场景hcordova CLIhcordova plugin add cordova-plugin-camera应用开发者按需装插件自动完成工程注入repo manifestrepo init repo sync框架贡献者 / 插件适配者需要批量读改多仓库源码应用开发者日常用 hcordova 即可当你要批量修改 78 个插件的公共问题比如本次的 gitcode→atomgit 链接迁移manifest repo 的价值立刻显现一个 manifest 工作区里所有仓库就位批量脚本一遍跑完。3.3 实战链接迁移的批量化本人实测记录manifest 仓库自身的 README 和 159 个 XML 里的 fetch 地址原来指向 gitcode.com我们刚完成了整体迁移Issue #1 PR #9gitclone https://atomgit.com/CPF-Cordova/manifest.gitcdmanifestgitcheckout-bdocs/replace-gitcode-with-atomgit# 批量替换159 个文件 / 240 处 / 81 个唯一 URLgrep-rlgitcode.--include*.xml--include*.md|\xargssed-is|gitcode\.com/CPF-Cordova/|atomgit.com/CPF-Cordova/|g# 验证gitcode 残留 0grep-rlgitcode.--include*.xml--include*.md|wc-l# → 0这个案例本身就是 manifest 工程化价值的注脚目录索引类仓库的链接必须与实际托管平台一致否则 repo 用户第一步就会失败。四、manifest 工程化的深层价值4.1 多仓库生态的标准解法近 80 个仓库的管理摆在面前的选项有monorepo合并为单仓库、submodulegit 子模块、manifestrepo。CPF-Cordova 选 manifest 的理由方案优点缺点monorepo原子提交、简单78 个插件权限/发版耦合克隆体积大git submodule原生 git更新繁琐78 个 submodule 体验极差repo manifest每仓库独立发版/权限分支策略集中定义partial clone需要装 repo 工具对每个插件独立版本、独立 issue、独立贡献者的插件生态repo 是唯一不牺牲独立性的方案。4.2 分支策略develop/master 双轨每插件都有_master.xml变体配合框架主工程的 develop/master 双分支形成对齐的发布轨道default.xmldevelop 轨道 default_master.xmlmaster 轨道 │ │ 适配中/预发布 已验证/稳定使用方可以按需选择追新或追稳避免框架与插件版本错配。4.3 对其他 CPF 组织的示范意义CPF-Ionic 同样有 43 个插件仓库目前尚无对应的 manifest 聚合。将 manifest 模式复制过去ionic-default.xml 43 份插件 manifest是低成本、高收益的候选工作。五、踩坑与注意事项#点说明1repo 不在系统 PATHmacOSbrew install repoLinux 发行版多有打包2manifest fetch 地址必须是平台可达的本仓库原指向 gitcode.com 时AtomGit 用户 repo sync 全部失败——链接与托管平台一致性是 manifest 仓库的生命线本次 PR #9 修复的正是这一点3-m参数指定 manifest 文件不指定默认读default.xml拉插件要用-m cordova_plugin.xml4插件独立 manifest 不含主工程单插件 manifest 只有该插件仓库需要框架源码时用 default.xml5review 字段XML 里的reviewhttps://atomgit.com/CPF-Cordova/配合repo upload走 Gerrit 流程AtomGit 上实际以 PR 为主此字段可忽略六、总结manifest 仓库解决的是多仓库生态的最后一公里问题1. 聚合 ── 1 框架 78 插件一个 XML 索引repo sync 一键拉全 2. 双轨 ── develop/master 两套 manifest适配与稳定版本并行 3. 独立 ── 每插件独立仓库独立发版manifest 只管在哪、跟哪个分支对迁移开发者先读 manifest 清单确认你依赖的插件是否已适配78 个覆盖了核心插件 微信/QQ/微博/支付宝/推送等本土刚需再决定迁移方案对生态贡献者新增插件适配后记得在 manifest 仓库同步添加一份cordova_plugin.xml——进了 manifest才算真正进入这个生态的分发体系。参考文档CPF-Cordova/manifest 仓库CPF-Cordova 组织主页hcordova 仓库插件安装的 CLI 路径cordova-openharmony 仓库框架主工程repo 工具官方文档