我应该在谷歌Play服务库项目,源代码版本控制GCM支持检查? [英] should I check in the Google Play services library project to source version control for GCM support?

查看:219
本文介绍了我应该在谷歌Play服务库项目,源代码版本控制GCM支持检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了GCM支持我们的Andr​​oid应用程序,但是有一件事困扰我的是对谷歌Play服务库项目。基于此链接设置谷歌Play服务SDK ,我应该做的以下,在步骤4:

I already added the support for GCM at our android app, however one thing bothers me is about the Google Play services library project. Based on this link Set Up Google Play Services SDK, I should do the following at step 4:

请在谷歌Play服务库项目的副本。
  如果您使用的是Eclipse,导入库项目到工作区。单击文件>导入,选择的Andr​​oid>现有Android的code到工作区,并浏览到库项目的副本,将其导入。

Make a copy of the Google Play services library project. If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.

我们使用eclipse。因此,要允许其他开发人员构建我们的应用程序的项目没有做任何体力劳动,我在谷歌Play服务库项目到我们的版本控制(SVN)检查并添加项目作为我们的应用程序项目的一部分。

We are using eclipse. So to allow other developer to build our app project without doing any manual work, I checked in the Google Play services library project into our version control (SVN) and add that project as part of our app project.

但是我不知道我是否应该检查的项目到我们的源代码版本控制或没有。有一件事我还发现,谷歌,播放services_lib.jar文件被修改的今天,但是我没有做任何事情来的瓶子和我没有任何想法是怎么更新。我应在jar文件的新版本检查?同样,这还是要追溯到我是否应检查在谷歌Play服务库项目摆在首位。

However I am not sure whether I should check that project into our source version control or not. One thing I also found out that google-play-services_lib.jar file is modified today, however I didn't do anything to that jar and I don't have any idea how it got updated. Should I check in the new version of the jar file? Again this still goes back to whether I should check in the Google Play services library project in the first place.

有人拥有GCM经验棚一些灯光这里有什么最好的方法?

Could someone with GCM experience shed some lights what's the best approach here?

在1月16日的更新1:

每下面的答案,我们可以一个谷歌播放服务的jar文件添加到我们的应用程序的项目,但是基于此链接,的实施GCM客户,它具有以下内容:

Per the answer below, we could add a Google play services jar file to our app project, however based on this link, Implementing GCM Client, it has the following:

注意:当您添加Play服务库到您的项目,一定要与资源添加,如设置谷歌Play服务SDK描述。关键的一点是,你必须参考库 - 只需添加一个.jar文件到您的Eclipse项目将无法正常工作。你必须按照指示进行引用库,或者您的应用程序将无法访问该图书馆的资源,它将无法正常运行。

Caution: When you add the Play Services library to your project, be sure to add it with resources, as described in Setup Google Play Services SDK. The key point is that you must reference the library—simply adding a .jar file to your Eclipse project will not work. You must follow the directions for referencing a library, or your app won't be able to access the library's resources, and it won't run properly

因此​​,这将意味着,我们不能只是简单的添加jar文件。

So that would means that we could not just simple add the jar file.

推荐答案

您库编译时先编译应用程序,因为库项目创建的jar您谷歌播放服务罐子在每次运行时进行更新。

Your library compiles first whenever you compile your application, as library projects create jar your Google Play Services jar will be updated on every run.

由于库incluse资源,你不能创建罐子,在将它们添加到您的Java构建路径有两种可能的方式来摆脱这种

As the library incluse resources you cant create the jar and add them in to your java build path there two possible ways to get rid of this :


  1. 移动到Android工作室它使用 .aar 文件,其中包含归档所有的Andorid资源。阅读更多refrence

  1. Move to Android Studio which uses .aar files which contains all your andorid resources in archive. Read more from refrence.

prevent libray项目,每一个您在Eclipse运行应用程序时编译。 <一href=\"http://stackoverflow.com/questions/11375635/ant-rebuilding-library-projects-every-time\">Click这里 知道该怎么做。

Prevent libray project to compile each and every time you run the app in eclipse. Click Here to know how to do that.

这篇关于我应该在谷歌Play服务库项目,源代码版本控制GCM支持检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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