GData project now includes a static library target for iPhone apps

27 views
Skip to first unread message

Greg Robbins

unread,
Aug 31, 2009, 8:42:13 PM8/31/09
to gdata-objec...@googlegroups.com
The xcode project file checked in now to the top-of-trunk sources includes a target for building a static library for iPhone apps. This should enable iPhone projects to include the GData project as a cross-project reference, rather than dragging all of the sources into the iPhone app's project.


Static libraries with Objective-C code cannot be dead-code stripped, and most apps do not need most of the classes in the GData library. So to avoid compiling unneeded code into iPhone apps, the static library target has this define in Other C Flags build settings:

  -DGDATA_REQUIRE_SERVICE_INCLUDES=1

which will exclude all of code for unneeded services. But that means that to use the static library, you will need to tell the target which services your app is using. So there is a placeholder define also in the Other C Flags build settings:

  -DGDATA_INCLUDE_nameServiceHere_SERVICE=1

To avoid a build error, that should be replaced by the defines for the service or services your app is using, such as

  -DGDATA_INCLUDE_CALENDAR_SERVICE=1

Note that all Mac and iPhone apps can (and should) take advantage of the GDATA_REQUIRE_SERVICE_INCLUDES preprocessor define to reduce the compiled code size, but it's only required for the iPhone static library release build.


Linking to Objective-C static libraries also requires the -ObjC link option, per http://developer.apple.com/mac/library/qa/qa2006/qa1490.html


This static library target is an experiment to find easier ways to include the GData library in iPhone apps. Please let us know if it's helpful in your project. And if you have other suggestions for more convenient packaging of the library code, please share those ideas as well.

Guillermo Castro

unread,
Sep 15, 2009, 1:34:38 PM9/15/09
to Google Data APIs Objective-C Client Library Discussion
Any news on when will this option be released as a download? I have
been following the instructions on http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary
only to find out that even though the documentation says "since 1.8",
it is actually only in the subversion code.

Thanks,

On Aug 31, 7:42 pm, Greg Robbins <grobb...@google.com> wrote:
> The xcode project file checked in now to the top-of-trunk sources includes a
> target for building a static library for iPhone apps. This should enable
> iPhone projects to include the GData project as a cross-project reference,
> rather than dragging all of the sources into the iPhone app's project.
>
> Static libraries with Objective-C code cannot be dead-code stripped, and
> most apps do not need most of the classes in the GData library. So to avoid
> compiling unneeded code into iPhone apps, the static library target has this
> define in Other C Flags build settings:
>
>   -DGDATA_REQUIRE_SERVICE_INCLUDES=1
>
> which will exclude all of code for unneeded services. But that means that to
> use the static library, you will need to tell the target which services your
> app is using. So there is a placeholder define also in the Other C Flags
> build settings:
>
>   -DGDATA_INCLUDE_nameServiceHere_SERVICE=1
>
> To avoid a build error, that should be replaced by the defines for the
> service or services your app is using, such as
>
>   -DGDATA_INCLUDE_CALENDAR_SERVICE=1
>
> Note that all Mac and iPhone apps can (and should) take advantage of the
> GDATA_REQUIRE_SERVICE_INCLUDES preprocessor define to reduce the compiled
> code size, but it's only required for the iPhone static library release
> build.
>
> Linking to Objective-C static libraries also requires the -ObjC link option,
> perhttp://developer.apple.com/mac/library/qa/qa2006/qa1490.html

Thomas Van Lenten

unread,
Sep 15, 2009, 9:51:01 PM9/15/09
to gdata-objec...@googlegroups.com
On Tue, Sep 15, 2009 at 1:34 PM, Guillermo Castro <guillerm...@gmail.com> wrote:

Any news on when will this option be released as a download? I have
been following the instructions on http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary
only to find out that even though the documentation says "since 1.8",
it is actually only in the subversion code.

Greg's out on vacation, so it's atleast a few weeks before he does a new branch and zip file.

TVL

Greg Robbins

unread,
Oct 5, 2009, 6:22:22 PM10/5/09
to gdata-objec...@googlegroups.com
I'm not sure when there will be a new zipped library download, but getting the latest top-of-trunk sources is simple.

Just copy and paste

   svn checkout http://gdata-objectivec-client.googlecode.com/svn/trunk/ gdata-objectivec-client-read-only

into a terminal window. The "formal" library releases are just done by running that checkout command and zipping the downloaded source directory into an archive.

The checkout command is shown at http://code.google.com/p/gdata-objectivec-client/source/checkout

MrRubato

unread,
Oct 10, 2009, 9:35:17 PM10/10/09
to Google Data APIs Objective-C Client Library Discussion
Greg, building the static library doesn't seem to create the
corresponding header files. Or at least I can't see where they're
being generated. Can you please advise?

Michael

On Oct 5, 3:22 pm, Greg Robbins <grobb...@google.com> wrote:
> I'm not sure when there will be a new zipped library download, but getting
> the latest top-of-trunk sources is simple.
>
> Just copy and paste
>
>    svn checkouthttp://gdata-objectivec-client.googlecode.com/svn/trunk/gdata-objecti...
Reply all
Reply to author
Forward
0 new messages