bash 如何使用 TFS 进行 iPhone 开发?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1334411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 21:09:54  来源:igfitidea点击:

How can I use TFS for iPhone development?

iphonebashtfsteamprise

提问by Batgar

I was struggling with how to use TFS as a source code repository for iPhone development.

我一直在苦苦思索如何使用 TFS 作为 iPhone 开发的源代码存储库。

My boss will never let me use Subversion (or God forbid Perforce), so I was stuck with TFS source control.

我的老板永远不会让我使用 Subversion(或上帝保佑 Perforce),所以我坚持使用 TFS 源代码控制。

The solution is to go and buy tools to bridge Mac to TFS, and I am not trying to advertise here, but the Teamprise Client Suite for Mac OS X is the bridge between Mac OS X and TFS.

解决方案是去购买将 Mac 连接到 TFS 的工具,我不是想在这里做广告,但适用于 Mac OS X 的 Teamprise 客户端套件是 Mac OS X 和 TFS 之间的桥梁。

For standard check-ins and developer workflow, there is no integration between Xcode and TFS. You have to do it all manually through the Teamprise Explorer client.

对于标准签入和开发人员工作流程,Xcode 和 TFS 之间没有集成。您必须通过 Teamprise Explorer 客户端手动完成所有操作。

For builds, it turns out that Automator and the Teamprise Command Line client do the trick.

对于构建,事实证明 Automator 和 Teamprise 命令行客户端可以解决问题。

Is there some Xcode to TFS bridge out there? What source code control system are you using for iPhone development?

那里有一些 Xcode 到 TFS 桥接吗?您在 iPhone 开发中使用什么源代码控制系统?

The key for me is the following bash script embedded in an Automator workflow.

对我来说,关键是以下嵌入在 Automator 工作流程中的 bash 脚本。

%1 = Local folder to do a code pull to. %2 = Project Name to do the pull from.

%1 = 执行代码拉取的本地文件夹。%2 = 要从中提取的项目名称。

This script assumes the Teamprise Command Line Client is installed to ~/Teamprise

此脚本假定 Teamprise 命令行客户端已安装到 ~/Teamprise

PATH="$PATH:~/Teamprise:~/Teamprise/lib"

cd ""
mkdir "/logs"

tf workspace -delete BuildScript -server:http://TFSServer -login:uname@domain,password >> /logs/wsdelete1.log

tf workspace -new BuildScript -server:http://TFSServer -login:uname@domain,password >> /logs/wscreate.log

tf workfold -map "$/TFSRoot" . -workspace:BuildScript -server:http://TFSServer -login:uname@domain,password >> /logs/workfold.log

tf get "$/TFSRoot/" -all -recursive -server:http://TFSServer -login:uname@domain,password >> /logs/get.log

tf workspace -delete BuildScript -server:http://TFSServer -login:uname@domain,password >> /logs/wsdelete2.log

#pump the tfs landing folder to the next step in the Automator script.
echo /Projects/

回答by Martin Woodward

As Louisstates, XCode doesn't currently provide a publicly accessible plug-in model for us (Teamprise) to provide a TFS integration with - it is something that we would love to do.

正如Louis所说,XCode 目前没有为我们(Teamprise)提供一个可公开访问的插件模型来提供 TFS 集成——这是我们很乐意做的事情。

We've experimented with a couple of hacks - such as pretending to be the Perforce command line and talking to TFS instead, however these internal proof of concepts have so far not worked out very well - especially as we would want to ideally have Work Item Tracking linked in somehow as well so that you can associate check-ins with bugs etc.

我们已经尝试了一些技巧 - 例如假装是 Perforce 命令行并改为与 TFS 交谈,但是这些内部概念证明迄今为止效果不佳 - 特别是因为我们希望理想地拥有工作项跟踪也以某种方式链接,以便您可以将签入与错误等联系起来。

Today, the majority of our customers that are using Teamprise to talk to TFS from XCode are doing so either using the standalone UI tool (Teamprise Explorer) or are doing Automator actions like you suggest to hook into the tf command line.

今天,我们使用 Teamprise 从 XCode 与 TFS 对话的大多数客户要么使用独立的 UI 工具(Temprise Explorer),要么正在执行 Automator 操作,就像您建议挂钩到tf 命令行

Apologies that this isn't a great experience. All I can suggest is that you file a bug with Appleto provide a plug-in model for SCM systems to hook into XCode. Hopefully if there is significant developer demand then we might have more luck than just us requesting it.

很抱歉这不是一次很棒的体验。我只能建议您向 Apple 提交一个错误,以便为 SCM 系统提供一个插件模型以连接到 XCode。希望如果有大量的开发人员需求,那么我们可能会比我们请求它有更多的运气。

回答by Louis Gerbarg

While internally Xcode is using a plugin system to support different version control systems, it is not public or documented. Aside from minimal support like running some commandline scripts there is no supported way to use any version control systems except for those Xcode ships with.

虽然 Xcode 在内部使用插件系统来支持不同的版本控制系统,但它不是公开的或文档化的。除了像运行一些命令行脚本这样的最小支持之外,除了 Xcode 附带的那些版本控制系统之外,没有支持的方法来使用任何版本控制系统。

You should filea bug with Apple asking for native support for TFS, or a supported VCS plugin system for Xcode.

您应该向 Apple提交错误,要求对 TFS 提供本机支持,或为 Xcode 提供受支持的 VCS 插件系统。

Anyway, in the short run I don't think you will find an satisfactory solution to your problem.

无论如何,从短期来看,我认为您不会为您的问题找到令人满意的解决方案。

回答by rpetrich

If you must integrate with a TFS server, your best route at this time is to use SVNBridgeand then connect to the bridge via Xcode's built-in subversion functionality.

如果必须与 TFS 服务器集成,此时最好的方法是使用SVNBridge,然后通过 Xcode 的内置 subversion 功能连接到桥接器。

Also, installing a VisualSVN server for the first time took me less than 15 minutes for a base install and another ten or so configuring users and getting the SSL cert signed by our company's root certificate. Give it a try, it was really easy.

此外,第一次安装 VisualSVN 服务器花了我不到 15 分钟的时间进行基本安装和另外十个左右的配置用户并获得由我们公司的根证书签名的 SSL 证书。试一试,这真的很容易。