维护类似的Android项目
我们目前有一个应用程序,本质上是为潜在客户提供的全功能演示。所有的功能都在那里。但是,我们使用通用品牌/徽标,调用我们自己的 Web 服务(稍后将替换为对客户端 Web 服务的调用)等。
这是我的问题。如果我们有两个不同的客户端,我们希望重复代码尽可能少。我知道从 java 的角度来看,这可以通过简单地包含一个共享 JAR 来完成。然而,我们需要改变资源。此外,一个客户端可能不想要另一客户端想要的某些功能。除此之外,如果我们正在进行一般错误修复,我们通常希望这些修复出现在应用程序的两个版本中。
我们使用 Git 进行版本控制,使用 Maven 构建项目。
我们讨论的一种选择是简单地对项目进行分支并维护单独的版本。但是,然后我们必须手动合并我们想要反映在应用程序的所有版本中的更改。
我们讨论的另一个选项是使用 Maven 配置文件以某种方式交换资源等。但是,如果我们需要对代码本身进行任何非表面的更改,这可能是一个问题。我们可能必须进入工厂和不同的实现。
有人对处理这个问题的最佳方法有建议吗?
We currently have an application which is essentially a fully-functional demo for potential clients. All the functionality is there. However, we use generic branding/logos, call our own web services (which would later be swapped out for calls to client web-services), etc.
Here is my question. If we have two different clients, we would prefer as little duplicate code as possible. I understand that this could be done -- from a java perspective -- by simply including a shared JAR. However, we will need to change around resources. Also, one client may not want some functionality that another client does want. On top of this, if we are doing general bug fixes, we will normally want these fixes to be in both versions of the application.
We are using Git for version control and Maven for building the project.
One option we discussed is simply branching the project and maintaining separate versions. However, then we would have to manually merge changes that we want reflected in all versions of the app.
Another option we discussed is somehow swapping out resources, etc. using maven profiles. However, if we need to make any non-superficial changes to the code itself, this could be a problem. We might have to get into factories and different implementations.
Does anyone have recommendations on the best way to handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们使用带有 git 子模块的库项目来处理所有类似的项目。主项目相当庞大,但我们使用配置文件来确定成品中应包含哪些功能。
We use a library project with git submodules to handle all of our similar projects. The master project is pretty hefty but we use a configuration file to determine what features should be in the finished product.