windfly2006
windfly2006

Reputation: 1705

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

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.

Upvotes: 0

Views: 634

Answers (1)

Piyush Agarwal
Piyush Agarwal

Reputation: 25858

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.

Upvotes: 1

Related Questions