1 |
efrain |
1 |
[](https://cocoapods.org/pods/GoogleDataTransport)
|
|
|
2 |
[](https://cocoapods.org/pods/GoogleDataTransport)
|
|
|
3 |
[](https://cocoapods.org/pods/GoogleDataTransport)
|
|
|
4 |
|
|
|
5 |
[![Actions Status][gh-datatransport-badge]][gh-actions]
|
|
|
6 |
|
|
|
7 |
# GoogleDataTransport
|
|
|
8 |
|
|
|
9 |
This library is for internal Google use only. It allows the logging of data and
|
|
|
10 |
telemetry from Google SDKs.
|
|
|
11 |
|
|
|
12 |
## Integration Testing
|
|
|
13 |
These instructions apply to minor and patch version updates. Major versions need
|
|
|
14 |
a customized adaptation.
|
|
|
15 |
|
|
|
16 |
After the CI is green:
|
|
|
17 |
* Determine the next version for release by checking the
|
|
|
18 |
[tagged releases](https://github.com/google/GoogleDataTransport/tags).
|
|
|
19 |
Ensure that the next release version keeps the Swift PM and CocoaPods versions in sync.
|
|
|
20 |
* Verify that the releasing version is the latest entry in the [CHANGELOG.md](CHANGELOG.md),
|
|
|
21 |
updating it if necessary.
|
|
|
22 |
* Update the version in the podspec to match the latest entry in the [CHANGELOG.md](CHANGELOG.md)
|
|
|
23 |
* Checkout the `main` branch and ensure it is up to date.
|
|
|
24 |
```console
|
|
|
25 |
git checkout main
|
|
|
26 |
git pull
|
|
|
27 |
```
|
|
|
28 |
* Add the CocoaPods tag (`{version}` will be the latest version in the [podspec](GoogleDataTransport.podspec#L3))
|
|
|
29 |
```console
|
|
|
30 |
git tag CocoaPods-{version}
|
|
|
31 |
git push origin CocoaPods-{version}
|
|
|
32 |
```
|
|
|
33 |
* Push the podspec to the designated repo
|
|
|
34 |
* If this version of GDT is intended to launch **before or with** the next Firebase release:
|
|
|
35 |
<details>
|
|
|
36 |
<summary>Push to <b>SpecsStaging</b></summary>
|
|
|
37 |
|
|
|
38 |
```console
|
|
|
39 |
pod repo push --skip-tests staging GoogleDataTransport.podspec
|
|
|
40 |
```
|
|
|
41 |
|
|
|
42 |
If the command fails with `Unable to find the 'staging' repo.`, add the staging repo with:
|
|
|
43 |
```console
|
|
|
44 |
pod repo add staging git@github.com:firebase/SpecsStaging.git
|
|
|
45 |
```
|
|
|
46 |
</details>
|
|
|
47 |
* Otherwise:
|
|
|
48 |
<details>
|
|
|
49 |
<summary>Push to <b>SpecsDev</b></summary>
|
|
|
50 |
|
|
|
51 |
```console
|
|
|
52 |
pod repo push --skip-tests dev GoogleDataTransport.podspec
|
|
|
53 |
```
|
|
|
54 |
|
|
|
55 |
If the command fails with `Unable to find the 'dev' repo.`, add the dev repo with:
|
|
|
56 |
```console
|
|
|
57 |
pod repo add dev git@github.com:firebase/SpecsDev.git
|
|
|
58 |
```
|
|
|
59 |
</details>
|
|
|
60 |
* Run Firebase CI by waiting until next nightly or adding a PR that touches `Gemfile`.
|
|
|
61 |
* On google3, create a workspace and new CL. Then copybara and run a global TAP.
|
|
|
62 |
<pre>
|
|
|
63 |
/google/data/ro/teams/copybara/copybara third_party/firebase/ios/Releases/GoogleDataTransport/copy.bara.sky \
|
|
|
64 |
--piper-description-behavior=OVERWRITE \
|
|
|
65 |
--destination-cl=<b>YOUR_CL</b> gdt
|
|
|
66 |
</pre>
|
|
|
67 |
|
|
|
68 |
## Publishing
|
|
|
69 |
The release process is as follows:
|
|
|
70 |
1. [Tag and release for Swift PM](#swift-package-manager)
|
|
|
71 |
2. [Publish to CocoaPods](#cocoapods)
|
|
|
72 |
3. [Create GitHub Release](#create-github-release)
|
|
|
73 |
4. [Perform post release cleanup](#post-release-cleanup)
|
|
|
74 |
|
|
|
75 |
### Swift Package Manager
|
|
|
76 |
By creating and [pushing a tag](https://github.com/google/GoogleDataTransport/tags)
|
|
|
77 |
for Swift PM, the newly tagged version will be immediately released for public use.
|
|
|
78 |
Given this, please verify the intended time of release for Swift PM.
|
|
|
79 |
* Add a version tag for Swift PM
|
|
|
80 |
```console
|
|
|
81 |
git tag {version}
|
|
|
82 |
git push origin {version}
|
|
|
83 |
```
|
|
|
84 |
*Note: Ensure that any inflight PRs that depend on the new `GoogleDataTransport` version are updated to point to the
|
|
|
85 |
newly tagged version rather than a checksum.*
|
|
|
86 |
|
|
|
87 |
### CocoaPods
|
|
|
88 |
* Publish the newly versioned pod to CocoaPods
|
|
|
89 |
|
|
|
90 |
It's recommended to point to the `GoogleDataTransport.podspec` in `staging` to make sure the correct spec is being published.
|
|
|
91 |
```console
|
|
|
92 |
pod trunk push ~/.cocoapods/repos/staging/GoogleDataTransport/{version}/GoogleDataTransport.podspec --skip-tests
|
|
|
93 |
```
|
|
|
94 |
|
|
|
95 |
The pod push was successful if the above command logs: `🚀 GoogleDataTransport ({version}) successfully published`.
|
|
|
96 |
In addition, a new commit that publishes the new version (co-authored by [CocoaPodsAtGoogle](https://github.com/CocoaPodsAtGoogle))
|
|
|
97 |
should appear in the [CocoaPods specs repo](https://github.com/CocoaPods/Specs). Last, the latest version should be displayed
|
|
|
98 |
on [GoogleDataTransport's CocoaPods page](https://cocoapods.org/pods/GoogleDataTransport).
|
|
|
99 |
|
|
|
100 |
### [Create GitHub Release](https://github.com/google/GoogleDataTransport/releases/new/)
|
|
|
101 |
Update the [release template](https://github.com/google/GoogleDataTransport/releases/new/)'s **Tag version** and **Release title**
|
|
|
102 |
fields with the latest version. In addition, reference the [Release Notes](./CHANGELOG.md) in the release's description.
|
|
|
103 |
|
|
|
104 |
See [this release](https://github.com/google/GoogleDataTransport/releases/edit/9.0.1) for an example.
|
|
|
105 |
|
|
|
106 |
*Don't forget to perform the [post release cleanup](#post-release-cleanup)!*
|
|
|
107 |
|
|
|
108 |
### Post Release Cleanup
|
|
|
109 |
<details>
|
|
|
110 |
<summary>Clean up <b>SpecsStaging</b></summary>
|
|
|
111 |
|
|
|
112 |
```console
|
|
|
113 |
pwd=$(pwd)
|
|
|
114 |
mkdir -p /tmp/release-cleanup && cd $_
|
|
|
115 |
git clone git@github.com:firebase/SpecsStaging.git
|
|
|
116 |
cd SpecsStaging/
|
|
|
117 |
git rm -rf GoogleDataTransport/
|
|
|
118 |
git commit -m "Post publish cleanup"
|
|
|
119 |
git push origin master
|
|
|
120 |
rm -rf /tmp/release-cleanup
|
|
|
121 |
cd $pwd
|
|
|
122 |
```
|
|
|
123 |
</details>
|
|
|
124 |
|
|
|
125 |
## Set logging level
|
|
|
126 |
|
|
|
127 |
### Swift
|
|
|
128 |
|
|
|
129 |
- Import `GoogleDataTransport` module:
|
|
|
130 |
```swift
|
|
|
131 |
import GoogleDataTransport
|
|
|
132 |
```
|
|
|
133 |
- Set logging level global variable to the desired value before calling `FirebaseApp.configure()`:
|
|
|
134 |
```swift
|
|
|
135 |
GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevel.debug.rawValue
|
|
|
136 |
```
|
|
|
137 |
### Objective-C
|
|
|
138 |
|
|
|
139 |
- Import `GoogleDataTransport`:
|
|
|
140 |
```objective-c
|
|
|
141 |
#import <GoogleDataTransport/GoogleDataTransport.h>
|
|
|
142 |
```
|
|
|
143 |
- Set logging level global variable to the desired value before calling `-[FIRApp configure]`:
|
|
|
144 |
```objective-c
|
|
|
145 |
GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevelDebug;
|
|
|
146 |
```
|
|
|
147 |
|
|
|
148 |
## Prereqs
|
|
|
149 |
|
|
|
150 |
- `gem install --user cocoapods cocoapods-generate`
|
|
|
151 |
- `brew install protobuf nanopb-generator`
|
|
|
152 |
- `easy_install --user protobuf`
|
|
|
153 |
|
|
|
154 |
## To develop
|
|
|
155 |
|
|
|
156 |
- Run `./GoogleDataTransport/generate_project.sh` after installing the prereqs
|
|
|
157 |
|
|
|
158 |
## When adding new logging endpoint
|
|
|
159 |
|
|
|
160 |
- Use commands similar to:
|
|
|
161 |
- `python -c "line='https://www.firebase.com'; print line[0::2]" `
|
|
|
162 |
- `python -c "line='https://www.firebase.com'; print line[1::2]" `
|
|
|
163 |
|
|
|
164 |
## When adding internal code that shouldn't be easily usable on github
|
|
|
165 |
|
|
|
166 |
- Consider using go/copybara-library/scrubbing#cc_scrub
|
|
|
167 |
|
|
|
168 |
## Development
|
|
|
169 |
|
|
|
170 |
Ensure that you have at least the following software:
|
|
|
171 |
|
|
|
172 |
* Xcode 12.0 (or later)
|
|
|
173 |
* CocoaPods 1.10.0 (or later)
|
|
|
174 |
* [CocoaPods generate](https://github.com/square/cocoapods-generate)
|
|
|
175 |
|
|
|
176 |
For the pod that you want to develop:
|
|
|
177 |
|
|
|
178 |
`pod gen GoogleDataTransport.podspec --local-sources=./ --auto-open --platforms=ios`
|
|
|
179 |
|
|
|
180 |
Note: If the CocoaPods cache is out of date, you may need to run
|
|
|
181 |
`pod repo update` before the `pod gen` command.
|
|
|
182 |
|
|
|
183 |
Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for
|
|
|
184 |
those platforms. Since 10.2, Xcode does not properly handle multi-platform
|
|
|
185 |
CocoaPods workspaces.
|
|
|
186 |
|
|
|
187 |
### Development for Catalyst
|
|
|
188 |
* `pod gen GoogleDataTransport.podspec --local-sources=./ --auto-open --platforms=ios`
|
|
|
189 |
* Check the Mac box in the App-iOS Build Settings
|
|
|
190 |
* Sign the App in the Settings Signing & Capabilities tab
|
|
|
191 |
* Click Pods in the Project Manager
|
|
|
192 |
* Add Signing to the iOS host app and unit test targets
|
|
|
193 |
* Select the Unit-unit scheme
|
|
|
194 |
* Run it to build and test
|
|
|
195 |
|
|
|
196 |
Alternatively disable signing in each target:
|
|
|
197 |
* Go to Build Settings tab
|
|
|
198 |
* Click `+`
|
|
|
199 |
* Select `Add User-Defined Setting`
|
|
|
200 |
* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO`
|
|
|
201 |
|
|
|
202 |
### Code Formatting
|
|
|
203 |
|
|
|
204 |
To ensure that the code is formatted consistently, run the script
|
|
|
205 |
[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh)
|
|
|
206 |
before creating a PR.
|
|
|
207 |
|
|
|
208 |
GitHub Actions will verify that any code changes are done in a style compliant
|
|
|
209 |
way. Install `clang-format` and `mint`:
|
|
|
210 |
|
|
|
211 |
```console
|
|
|
212 |
brew install clang-format@13
|
|
|
213 |
brew install mint
|
|
|
214 |
```
|
|
|
215 |
|
|
|
216 |
### Running Unit Tests
|
|
|
217 |
|
|
|
218 |
Select a scheme and press Command-u to build a component and run its unit tests.
|
|
|
219 |
|
|
|
220 |
## Contributing
|
|
|
221 |
|
|
|
222 |
See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase
|
|
|
223 |
iOS SDK.
|
|
|
224 |
|
|
|
225 |
## License
|
|
|
226 |
|
|
|
227 |
The contents of this repository is licensed under the
|
|
|
228 |
[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
|
|
229 |
|
|
|
230 |
[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions
|
|
|
231 |
[gh-datatransport-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/datatransport/badge.svg
|