should I check in the Google Play services library project to source version control for GCM support?

淺唱寂寞╮ 提交于 2019-12-25 06:57:27

问题


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:

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.

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.

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.

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

Update 1 at Jan 16:

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:

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

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


回答1:


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.

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. Move to Android Studio which uses .aar files which contains all your andorid resources in archive. Read more from refrence.

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



来源:https://stackoverflow.com/questions/21145478/should-i-check-in-the-google-play-services-library-project-to-source-version-con

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!