简体   繁体   English

在多个Xcode + PhoneGap项目之间共享代码

[英]Share code between multiple Xcode+PhoneGap projects

I have created a phonegap-based app for which I would like to create several similar apps with different content but the same basic code. 我已经创建了一个基于phonegap的应用程序,我想为其创建多个内容不同但基本代码相同的类似应用程序。 And I would like to have only one copy of the "base" code rather than trying to maintain multiple copies of it in different projects. 我想只拥有一个“基本”代码副本,而不是尝试在不同的项目中维护它的多个副本。

Basically each app needs a config file, a directory for some images, and a json file describing the images. 基本上每个应用程序都需要一个配置文件,一些图像的目录以及一个描述图像的json文件。 But otherwise the code would be the same between all of them. 但是,否则所有代码之间都是相同的。

How can I accomplish this in Xcode+PhoneGap? 如何在Xcode + PhoneGap中完成此操作?

You could use SVN or Git and have the base code that is shared as an external (SVN) or submodule (Git). 您可以使用SVN或Git,并具有作为外部(SVN)或子模块(Git)共享的基本代码。

That way you are only editing the base code in one spot, then when you create each new project you just add the base code in. 这样,您只需要在一个位置编辑基本代码,然后在创建每个新项目时,只需在其中添加基本代码即可。

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

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