简体   繁体   English

哪一种是管理具有多个目标的 iOS 项目的最佳方式?

[英]Which one is the best way to manage an iOS project with multiple target?

We have an iOS project with multiple targets that use Git as source control.我们有一个带有多个目标的 iOS 项目,这些目标使用 Git 作为源代码控制。 Some features belong to a specific target and the other features are common in all targets.一些特征属于特定目标,而其他特征在所有目标中都是通用的。 We have to consider and manage this issue.我们必须考虑和管理这个问题。 As far as I know, with considering git-flow we have two options to manage our project.据我所知,考虑到 git-flow,我们有两种选择来管理我们的项目。

  • The first option is: we divide each target to separated branches and each branch has two branches (Master and Develop) so we can use cherry-pick to move our commits from one branch to another one.第一个选项是:我们将每个目标划分为单独的分支,每个分支有两个分支(Master 和 Develop),因此我们可以使用cherry-pick 将我们的提交从一个分支移动到另一个分支。

  • The second option is: we just use one branch with multiple targets as a Master branch.第二种选择是:我们只使用一个具有多个目标的分支作为主分支。 So we should create a config file to specify which feature belongs to which target.所以我们应该创建一个配置文件来指定哪个特性属于哪个目标。 The main question is which one is the best way for our problem?主要问题是哪一种是解决我们问题的最佳方法?

Thanks in advance for sharing your experience.提前感谢您分享您的经验。

PS: PS:

1) Two developers are working on this project. 1) 两个开发人员正在从事这个项目。
2) Considering CI/CD tools such as Jenkins for building and releasing our apps. 2) 考虑使用 CI/CD 工具(例如 Jenkins)来构建和发布我们的应用程序。
3) We never use the Storyboard on this project at all. 3)我们从不在这个项目中使用故事板。

If I understood your question correctly I think you'd like to hide some features behind the beta/develop flag, rather than the release flag.如果我正确理解了你的问题,我认为你想隐藏 beta/develop 标志后面的一些功能,而不是发布标志。 One way which I personally use is having a Feature class for all of the targets and whenever a feature is still on develop it would be hidden behind a beta flag.我个人使用的一种方法是为所有目标设置一个Feature类,每当某个功能仍在开发中时,它就会隐藏在 beta 标志后面。

I hope this article by John Sundell about feature flag helpshttps://www.swiftbysundell.com/articles/feature-flags-in-swift/我希望 John Sundell 撰写的关于功能标志的文章对https://www.swiftbysundell.com/articles/feature-flags-in-swift/有所帮助

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

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