项目移植到Android和源头管理 [英] Project port to android and source management

查看:193
本文介绍了项目移植到Android和源头管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正试图端口现有的Java应用程序到Android,并想知道什么是最好的做法是为管理源$ C ​​$ C。

We are trying to port an existing java application to android and would like to know what the best practices are for managing the source code.

我们已经爆炸了大项目分成几个项目无关,但我们仍然有一个大的整体项目。对于那些小的框架,我们不应该做太多的工作,但大单需要一定的重写。

We have exploded our big project into several agnostic projects, but we still have a big monolithic project. For those little frameworks, we shouldn't have to do much work but the big one needs some rewrite.

有关目前,开发人员正在移植我们的应用程序到Android,但其他开发商继续开发上的非Android项目的新功能。
当端口完成后,我们将不得不重新合并所有的修改到了Android code基地,这将是一个真正的痛苦。所以我的问题是:我们应该如何管理我们的code源?我们是否应该为每个平台创建特定的资源库?我们应该保持两个code碱基在相同的资源库,但指向不同的分支,使合并是更容易?

For the time being, a developer is porting our app to Android, but other developers continue to develop new features on the non-Android project. When the port is complete, we will have to re merge all modifications into the android code base and this will be a real pain. So my question is: how should we manage our code source? Should we create a specific repository for each platform? should we keep the two code bases in the same repository but pointing to different branches so that merging is easier?

推荐答案

这可能不是一个源管理问题。尝试创建一个抽象的移植层。它应抽象的所有必要的API来让你的应用程序运行。然后在,比方说,SWT,用SWT的API,下,也就是说,Android的采用Android的API实现相同的层实施移植层。

It's probably not a source management problem. Try to create an abstract porting layer. It shall abstract all the APIs necessary to make your application running. Then under, say, SWT, implement that porting layer using SWT APIs, under, say, Android implement the same layer using Android APIs.

可以想见:

public interface ISoundEngine {
void startSound();
void stopSoud();
}

您的应用程序的其余部分使用startSound / stopSound操作发动机。

The rest of your app uses startSound/stopSound to operate the engine.

于是windows下大家实施

So then under windows you implement

public WindowsSoundEngine implements ISoundEngine {
...
}

Android的下你实施

under Android you implement

public AndroidSoundEngine implements ISoundEngine {
...
}

使用特定的Windows和Android专用的低级API在每种情况下。

using Windows-specific and Android-specific low level APIs in each case.

这篇关于项目移植到Android和源头管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆