tvos 刷新焦点

Developing applications with a small team of developers is easy, but in a large team this can be a challenging task in Xcode. Particularly when the code commits are frequent and feature developments can cause conflicts. On top of workflow complexities, Xcode project file format doesn’t have much support for team software development.

与小型开发人员团队一起开发应用程序很容易,但是在大型团队中,这可能是Xcode中一项艰巨的任务。 特别是在代码提交频繁且功能开发可能导致冲突的情况下。 除了工作流程的复杂性之外,Xcode项目文件格式对团队软件开发没有太多支持。

When developers actively contribute to the repository, such as working with UI, Storyboards, adding, removing files, etc, conflicts may happen when changing the project structure. Therefore, having a big giant project might not be a good idea as a long term solution and you might end up in ‘what the hell’ situation.

当开发人员积极地向存储库做出贡献时,例如使用UI,情节提要,添加,删除文件等,在更改项目结构时可能会发生冲突。 因此,作为一个长期的解决方案,拥有一个巨大的大型项目可能不是一个好主意,并且您可能最终陷入“到底是什么”的境地。

创建多项目工作区: (Creating multi project workspace:)

If you’re starting a new project, this can be an easy task to do. Create an empty workspace and add sub projects to your workspace. Similarly, if you have existing projects you can split your codes with some refactoring to achieve the same structure.

如果您要开始一个新项目,这可以很容易地完成。 创建一个空的工作区并将子项目添加到您的工作区。 同样,如果您有现有项目,则可以通过一些重构拆分代码以实现相同的结构。

Number of sub-projects depends on how large the team is and how frequent the features are being added. As a general rule its good to have one main application project and 3–4 sub projects to separate UI and Logics, similar to example below. After which, you can then think about hierarchy of dependencies.

子项目的数量取决于团队的规模以及功能添加的频率。 通常,最好有一个主应用程序项目和3-4个子项目来分隔UI和逻辑,这与下面的示例类似。 之后,您可以考虑依赖关系的层次结构。

Pro tip: If you’re working in a large team or maintaing large applications, it is important to avoid adding targets for your libraries. This is because of scalability, separating out logics and avoid conflicts when multiple people are working on different xcrojects.

专家提示:如果您在大型团队中工作或维护大型应用程序,那么避免为库添加目标很重要。 这是由于可伸缩性,分离逻辑并避免当多个人在不同的xcroject上工作时发生冲突。

Generally, team is working on product (e.g. ABCApp) and over a time features will be added. There’s also a possibility that it is required to launch a secondary app (e.g. XYZApp) that might share a lot of logics, UI and APIs, similar to the original app. Either way, this architecture will be a scalable solution for your needs.

通常,团队正在开发产品(例如ABCApp),并且一段时间后将添加功能。 还可能需要启动一个辅助应用程序(例如XYZApp),该应用程序可能与原始应用程序共享许多逻辑,UI和API。 无论哪种方式,该体系结构都是满足您需求的可扩展解决方案。

Example 1: Mobile application ABC that runs on iPhone only

示例1:仅在iPhone上运行的移动应用程序ABC

ABCWorkspace: ABCApp , ABCUI, ABCCore , ABCAPI

ABCWorkspace:ABCApp,ABCUI,ABCCore,ABCAPI

Image for post

In this project dependency hierarchy for ABCApp is defined as below:

在此项目中,ABCApp的依赖关系层次结构定义如下:

Image for post
Dependency list for ABCApp: make sure you set the embedding to ‘Do Not Embed’
ABCApp的依赖项列表:确保将嵌入设置为“不嵌入”

Similarly sub projects might have their own dependency

同样,子项目可能有其自己的依赖性

Image for post
Dependency list of ABC.API
ABC.API的依赖关系列表

Note: In above example ABC.API, ABC.Core, ABC.UI are all defined as ‘Framework’ project.

注意:在上面的示例中,ABC.API,ABC.Core和ABC.UI都定义为“框架”项目。

Example 2: Mobile Application ABC available that runs on iPhone and iPad

示例2:可在iPhone和iPad上运行的移动应用程序ABC

As you can see the previous architecture is extendible and iPad support can be adopted by adding ABCiPadUI project

如您所见,以前的体系结构是可扩展的,可以通过添加ABCiPadUI项目来采用iPad支持

ABCWorkspace : ABCApp               ABCMobileUI               ABCiPadUI               ABCAPI               ABCCore

Example 3: Mobile Application ABC that runs on iPhone and has support for Apple Watch

示例3:在iPhone上运行并支持Apple Watch的移动应用程序ABC

ABCWorkspace: ABCApp              ABC.MobileUI              ABC.WatchUI              ABC.API              ABC.Core

Example 4: Multiple mobile applications, using similar frameworks

示例4:使用类似框架的多个移动应用程序

CompanyWorkspace: ABCMobile                  XYZMobile                   ABCUI                  ABCCore                  ABCAPI

设置依赖项和Pod (Setting up dependencies and pods)

There are different ways of managing dependencies and relatively there’s a same strategy about using them. Keep dependencies for sub projects in a dynamic library format as much as you can and avoid embedding 3rd party dependencies in your sub projects. By using dynamic libraries, you will allow dependencies to be linked at the compile time to the final binary, avoid duplications and having a fat binary.

有多种方法来管理依赖关系,并且使用依赖关系的策略也相同。 尽可能以动态库格式保持子项目的依赖关系,并避免将第三方依赖关系嵌入子项目中。 通过使用动态库,您将允许在编译时将依赖项链接到最终的二进制文件,避免重复并使用胖二进制文件。

How to setup Cocoapods for multi project apps?

如何为多项目应用程序设置Cocoapods?

While Cocoapods is very straight forward to use for simple applications, it can be complicated to setup for multi project workspaces and complex uses.

尽管Cocoapods非常简单地用于简单的应用程序,但是对于多项目工作区和复杂的用途而言,设置起来可能会很复杂。

Let’s look at this pod file

让我们看看这个pod文件

workspace 'ABC'target 'ABCApp' douse_frameworks!project 'ABCApp/ABCApp.project'platform :ios, '13.0'# Pods for ABCApppod 'ObjectMapper'target 'ABCAppTests' doinherit! :search_paths# Pods for testingendtarget 'ABCAppUITests' do# Pods for testingendendtarget 'ABC.API' douse_frameworks!project 'ABC.API/ABC.API.project'platform :ios, '13.0'target 'ABC.APITests' doinherit! :search_paths# Pods for testingendendtarget 'ABC.UI' douse_frameworks!project 'ABC.UI/ABC.UI.project'platform :ios, '13.0'target 'ABC.UITests' doinherit! :search_paths# Pods for testingendendtarget 'ABC.Core' douse_frameworks!project 'ABC.Core/ABC.Core.project'platform :ios, '13.0'pod 'ObjectMapper'target 'ABC.CoreTests' doinherit! :search_paths# Pods for testingendend

‘Pod install’ command usually generates a workspace for the simple projects, but as you can see in above example we manually take control of creating the workspace and generating pods for each project.

“ Pod install”命令通常会为简单的项目生成一个工作区,但是如您在上面的示例中所见,我们手动控制了创建工作区并为每个项目生成Pod的控制。

Also, by moving the ‘platform :ios, xxx’ to target definitions, we can setup each project with different min SDK and define them the way it’s needed.

另外,通过将'platform:ios,xxx'移至目标定义,我们可以使用不同的min SDK设置每个项目,并根据需要定义它们。

摘要 (Summary)

By implementing the above structure, you will isolate changes to be limited to the project level and you will avoid dealing with solving large merge conflicts.

通过实现上述结构,您可以将更改隔离到项目级别,并且可以避免解决大型合并冲突。

If you’re interested to play with the code, I have uploaded a sample project on github to download

如果您有兴趣使用该代码,我已经在github上上传了一个示例项目以下载

If you have any questions, comments, suggestion please don’t hesitate to reach out! If you also found this article helpful please don’t forget to clap

tvos 刷新焦点_如何为大型团队设置可扩展的iOS / tvOS / watchOS Xcode项目,并避免代码冲突?...相关推荐

  1. git拉取代码如何解决冲突_开源项目 git pull 代码冲突的解决方式?

    假设我正在使用一个开源项目,为了时刻保持根官方github保持同步,我用git clone项目到本地并进行二次开发,我的大部分二次开发是不会和官方的核心文件产生冲突的,但是个别文件还是会冲突.. 比如 ...

  2. ESLint 在中大型团队的应用实践

    引言 代码规范是软件开发领域经久不衰的话题,几乎所有工程师在开发过程中都会遇到,并或多或少会思考过这一问题.随着前端应用的大型化和复杂化,越来越多的前端工程师和团队开始重视 JavaScript 代码 ...

  3. 敏捷开发“松结对编程”实践之六:大型团队篇|后记(大型研发团队,学习型团队,139团队,师徒制度,人员招聘,职业生涯规划)...

    本文是"松结对编程"系列的第六篇.(之一,之二,之三,之四,之五,之六,之七,之八) 松结对编程是小型团队的实践,大约运行在1个师傅+1-3个徒弟的尺度上,当面临更大尺度的时候,就 ...

  4. 139团队(大型研发团队,大型敏捷开发团队,大型团队结构,敏捷绩效管理)...

    作者:陈勇 出处:blog.csdn.net/cheny_com 定义 简单看,139团队就是1个项目经理,3个小组长,9个开发人员,小组长管理各自管理3个左右开发人员. 139团队从管理上缩减了团队 ...

  5. 《现实世界的敏捷开发-大型敏捷研发团队》培训课程扩展阅读

    •    谁在管理团队中的个体? •    从领导指令到自组织团队-敏捷生态系统 –  自组织团队的潜在问题 –  敏捷Scrum是怎样解决这些问题的? –  敏捷生态系统 同行压力(兼谈敏捷团队,绩 ...

  6. wcf负责与数据库打交道_有关与远程团队打交道的7个技巧

    wcf负责与数据库打交道 7 tips & tricks on how to deal with remote teams 有关如何与远程团队打交道的7个提示和技巧 A number of b ...

  7. 什么是高绩效团队_建立高绩效团队的方式1

    什么是高绩效团队 When I arrived at Quantum Talent in September 2019, although I was excited about the idea o ...

  8. maven引用公共包_使用github作为maven仓库存放发布自己的jar包依赖 实现多个项目公共部分代码的集中,避免团队中多个项目之间代码的复制粘贴...

    使用github作为maven仓库存放发布自己的jar包依赖 实现多个项目公共部分代码的集中,避免团队中多个项目之间代码的复制粘贴. 1.首先在本地maven位置的配置文件setting.xml(没有 ...

  9. 团队的远程管理_不管理远程团队的7种方法

    团队的远程管理 建立远程开发团队提出了独特的挑战. 试图组建一支充满各种个性的跨职能团队,实际上可能导致通信灾难. 幸运的是,通过计划,明智的招聘,培训和沟通,项目负责人可以成功建立并领导虚拟开发团队 ...

最新文章

  1. Facebook加入AI芯片大战,挖走Google芯片产品开发负责人
  2. asp实现301跳转的方法
  3. Android移动开发之【Android实战项目】剑走偏锋-得会导入别人的Android Studio项目!
  4. 通过计算机二级考试的计划,如何轻松通过国家计算机二级考试
  5. python下的scripts有什么用_python安装后无scripts内文件,无法使用pip
  6. CentOS 6.5安装VNC server
  7. LeetCode 460. LFU缓存(哈希双链表)
  8. 编程之美 - 哪个题目最美?
  9. 数据分析专题报告范文6篇_小学生看图写话范文:小熊玩跷跷板?(6篇),让孩子参考练习...
  10. VMWare MAC系统调整磁盘
  11. cesium加载百度地图_Cesium专栏-百度地图加载(附源码下载)
  12. oracle signed类型,char、signed char 和 unsigned char 的区别
  13. Apache Flume 简介
  14. 12c r2单实例 静默安装软件
  15. 路西法第一季为什么会被打伤_海贼王:路飞新招式‘红岩枪’,这次把凯多打伤了,大妈震惊...
  16. java类验证和装载顺序_深度分析Java的ClassLoader机制(源码级别)
  17. studio2.3app签名打包安装失败,找不到签名证书。
  18. QT编程入门系列文章之三十三——国际化(上)
  19. NB-IoT未来发展,主要是靠什么驱动的?
  20. 公差带与配合 常用基孔(轴)制基准公差数值

热门文章

  1. linux动态库修改名称(修改库文件内容)
  2. 各大Android手机厂商进入工程模式方式{LogCat调试 日志打印}
  3. 你知道工作站和服务器有什么区别吗?科普必看
  4. 定时器/计数器的基本概念
  5. oracle原厂培,数据库Oracle 11g OCP 原厂培训完整课件PDF文档
  6. java怎么把毫秒转换成天数_java – 如何将毫秒转换成小时和数天?
  7. 【Linux】用户配置文件(passwd shadow | group gshadow)
  8. 触发器的四种应用场景
  9. 轻松掌握非关系型数据库Redis
  10. 小虎电商浏览器:如何利用店小秘助手上架产品到亚马逊?