简体   繁体   English

自定义Cordova Xcode项目的最佳实践

[英]Best Practice for customizing Cordova Xcode project

I'm working on a Cordova project that requires me to replace my main.m file with a .mm file and - along with adding a custom build phase script. 我正在开发一个Cordova项目,该项目需要我用.mm文件替换main.m文件,以及-添加自定义构建阶段脚本。 When I do this I can no longer use the cordova cli commands or cleanly upgrade my cordova project when new versions are released. 当我这样做时,在发布新版本时,我将无法再使用cordova cli命令或彻底升级我的cordova项目。

I can't seem to find any documentation on editing things at this level. 我似乎找不到任何有关在此级别进行编辑的文档。 Can anyone point me in the right direction? 谁能指出我正确的方向? I've looked into the cordova hooks but I'm not sure whether that would work or where to hook my code to ensure a proper build. 我研究了cordova挂钩,但是不确定是否可行,或者在哪里挂钩我的代码以确保正确的构建。

  • Fork the Cordova-iOS and maintain your changes there. 分叉Cordova-iOS并在那里进行更改。 Merge commits from the original apache repo from time to time. 合并有时会来自原始的Apache回购。
  • Use cordova platform add your-fork-git-url#branch-or-tag to add platform 使用cordova platform add your-fork-git-url#branch-or-tag添加平台

I hope it can help 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM