You can use CocoaPods or Swift Package Manager.
Reminder: Please see the CONTRIBUTING.md file for how to contribute to this project.
open Package.swift
or double clickPackage.swift
in Finder.- Xcode will open the project
- The GoogleAPIClientForREST-Package scheme seems generally the simplest to build everything and run tests.
- Choose a target platform by selecting the run destination along with the scheme
Install
- CocoaPods 1.12.0 (or later)
- CocoaPods generate - This is not part of the core cocoapods install.
Generate an Xcode project from the podspec:
pod gen GoogleAPIClientForREST.podspec --local-sources=./ --auto-open --platforms=ios
Note: Set the --platforms
option to macos
, tvos
, or watchos
to
develop/test for those platforms.
To support CocoaPods and SwiftPM, Sources/GeneratedServices
gets updated with
the current state of the services from time to time. This is done by running:
Tools/GenerateCheckedInServices
On occasion, the service public definitions have hiccups (something in directory
but the actual referenced discovery document hasn't rolled out, etc); this can
be worked around by using --skip [name]
argument(s) to tell the script to
ignore something that might be bad in the directory return from discovery.
If a service is generating new warnings/info messages (or stops generating
some), then Tools/GenerateCheckedInServices-message_filter.json
will need to
also be updated. The goal is that normal generation shouldn't produce any
info/warning messages, that way it is more obvious when something might need
attention.
Or…
Google APIs also maintains a repo with the latest discovery data so the
generation is less likely to run into networking issues. To generate off that,
fetch the states of https://github.com/googleapis/discovery-artifact-manager and
use Tools/preferred_paths_from_cache.py
to exact what is currently preferred.
Note: Just like network based discovery, the directory in that repo can have
entries for which the documents aren't reachable, so they aren't actually in the
repo; Tools/preferred_paths_from_cache.py
thus supports a --skip
argument
also to skip things.
Since the admin
api has some services under odd versions, you have to explictly
pass those also.
Example generation assuming discovery-artifact-manager is checked out as a per directory to this project:
Tools/GenerateCheckedInServices \
--no-preferred \
`Tools/preferred_paths_from_cache.py --skip poly ../discovery-artifact-manager/discoveries` \
../discovery-artifact-manager/discoveries/admin.directory_v1.json \
../discovery-artifact-manager/discoveries/admin.datatransfer_v1.json
To update the version number and push a release:
-
Examine what has changed; determine the appropriate new version number.
-
Update the version number.
Run the
update_version.py
script to update the appropriate files with the new version number, by passing in the new version (must be in X.Y.Z format)../update_version.py 3.2.1
Submit the changes to the repo.
-
Create a release on Github.
Top left of the project's release page is Draft a new release.
The tag should be vX.Y.Z where the version number X.Y.Z exactly matches the one you provided to the
update_version.py
script. (GoogleAPIClientForREST has av
prefix on its tags.)For the description call out any major changes in the release. Usually the Generate release notes button in the toolbar is a good starting point and just updating as need for more/less detail (dropping comments about CI, updating the version number, etc.).
-
Publish the CocoaPod.
NOTE: You must be a registered owner of the podspec and be "logged in" from the CocoaPods pov locally to do this. The general google account for pods is and owner and can be used for releases.
pod trunk push --skip-import-validation --skip-tests GoogleAPIClientForREST.podspec
NOTE: Since validations are run on CI during every PR/commit, they are skipped here because publish takes a long time. And M2 based MBP can take > 1 hour to do this because of all of the subspecs and because the pod supports all of Apple platforms.
The tests are skipped because Cocoapods has had issues with running watchOS tests based on the local machines config. Those are also covered in github CI, so this should be good.