Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
[![Version](https://img.shields.io/cocoapods/v/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities)
2
[![License](https://img.shields.io/cocoapods/l/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities)
3
[![Platform](https://img.shields.io/cocoapods/p/GoogleUtilities.svg?style=flat)](https://cocoapods.org/pods/GoogleUtilities)
4
 
5
[![Actions Status][gh-google-utilities-badge]][gh-actions]
6
 
7
# GoogleUtilities
8
 
9
GoogleUtilities provides a set of utilities for Firebase and other Google SDKs for Apple platform
10
development.
11
 
12
The utilities are not directly supported for non-Google library usage.
13
 
14
## Integration Testing
15
These instructions apply to minor and patch version updates. Major versions need
16
a customized adaptation.
17
 
18
After the CI is green:
19
* Determine the next version for release by checking the
20
  [tagged releases](https://github.com/google/GoogleUtilities/tags).
21
  Ensure that the next release version keeps the Swift PM and CocoaPods versions in sync.
22
* Verify that the releasing version is the latest entry in the [CHANGELOG.md](CHANGELOG.md),
23
  updating it if necessary.
24
* Update the version in the podspec to match the latest entry in the [CHANGELOG.md](CHANGELOG.md)
25
* Checkout the `main` branch and ensure it is up to date
26
  ```console
27
  git checkout main
28
  git pull
29
  ```
30
* Add the CocoaPods tag (`{version}` will be the latest version in the [podspec](GoogleUtilities.podspec#L3))
31
  ```console
32
  git tag CocoaPods-{version}
33
  git push origin CocoaPods-{version}
34
  ```
35
* Push the podspec to the designated repo
36
  * If this version of GoogleUtilities is intended to launch **before or with** the next Firebase release:
37
    <details>
38
    <summary>Push to <b>SpecsStaging</b></summary>
39
 
40
    ```console
41
    pod repo push --skip-tests staging GoogleUtilities.podspec
42
    ```
43
 
44
    If the command fails with `Unable to find the 'staging' repo.`, add the staging repo with:
45
    ```console
46
    pod repo add staging git@github.com:firebase/SpecsStaging.git
47
    ```
48
    </details>
49
  * Otherwise:
50
    <details>
51
    <summary>Push to <b>SpecsDev</b></summary>
52
 
53
    ```console
54
    pod repo push --skip-tests dev GoogleUtilities.podspec
55
    ```
56
 
57
    If the command fails with `Unable to find the 'dev' repo.`, add the dev repo with:
58
    ```console
59
    pod repo add dev git@github.com:firebase/SpecsDev.git
60
    ```
61
    </details>
62
* Run Firebase CI by waiting until next nightly or adding a PR that touches `Gemfile`.
63
* On google3, run copybara using the command below. Then, start a global TAP on the generated CL. Deflake as needed.
64
  ```console
65
  third_party/firebase/ios/Releases/run_copy_bara.py --directory GoogleUtilities --branch main
66
  ```
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/GoogleUtilities/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 `GoogleUtilities` 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 `GoogleUtilities.podspec` in `staging` to make sure the correct spec is being published.
91
  ```console
92
  pod trunk push ~/.cocoapods/repos/staging/GoogleUtilities/{version}/GoogleUtilities.podspec
93
  ```
94
  *Note: In some cases, it may be acceptable to `pod trunk push` with the `--skip-tests` flag. Please double check with
95
  the maintainers before doing so.*
96
 
97
  The pod push was successful if the above command logs: `🚀  GoogleUtilities ({version}) successfully published`.
98
  In addition, a new commit that publishes the new version (co-authored by [CocoaPodsAtGoogle](https://github.com/CocoaPodsAtGoogle))
99
  should appear in the [CocoaPods specs repo](https://github.com/CocoaPods/Specs). Last, the latest version should be displayed
100
  on [GoogleUtilities's CocoaPods page](https://cocoapods.org/pods/GoogleUtilities).
101
 
102
### [Create GitHub Release](https://github.com/google/GoogleUtilities/releases/new/)
103
  Update the [release template](https://github.com/google/GoogleUtilities/releases/new/)'s **Tag version** and **Release title**
104
  fields with the latest version. In addition, reference the [Release Notes](./CHANGELOG.md) in the release's description.
105
 
106
  See [this release](https://github.com/google/GoogleUtilities/releases/edit/9.0.1) for an example.
107
 
108
  *Don't forget to perform the [post release cleanup](#post-release-cleanup)!*
109
 
110
### Post Release Cleanup
111
  <details>
112
  <summary>Clean up <b>SpecsStaging</b></summary>
113
 
114
  ```console
115
  pwd=$(pwd)
116
  mkdir -p /tmp/release-cleanup && cd $_
117
  git clone git@github.com:firebase/SpecsStaging.git
118
  cd SpecsStaging/
119
  git rm -rf GoogleUtilities/
120
  git commit -m "Post publish cleanup"
121
  git push origin master
122
  rm -rf /tmp/release-cleanup
123
  cd $pwd
124
  ```
125
  </details>
126
 
127
## Development
128
 
129
To develop in this repository, ensure that you have at least the following software:
130
 
131
  * Xcode 12.0 (or later)
132
  * CocoaPods 1.10.0 (or later)
133
  * [CocoaPods generate](https://github.com/square/cocoapods-generate)
134
 
135
For the pod that you want to develop:
136
 
137
`pod gen GoogleUtilities.podspec --local-sources=./ --auto-open --platforms=ios`
138
 
139
Note: If the CocoaPods cache is out of date, you may need to run
140
`pod repo update` before the `pod gen` command.
141
 
142
Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for
143
those platforms. Since 10.2, Xcode does not properly handle multi-platform
144
CocoaPods workspaces.
145
 
146
### Development for Catalyst
147
* `pod gen GoogleUtilities.podspec --local-sources=./ --auto-open --platforms=ios`
148
* Check the Mac box in the App-iOS Build Settings
149
* Sign the App in the Settings Signing & Capabilities tab
150
* Click Pods in the Project Manager
151
* Add Signing to the iOS host app and unit test targets
152
* Select the Unit-unit scheme
153
* Run it to build and test
154
 
155
Alternatively disable signing in each target:
156
* Go to Build Settings tab
157
* Click `+`
158
* Select `Add User-Defined Setting`
159
* Add `CODE_SIGNING_REQUIRED` setting with a value of `NO`
160
 
161
### Code Formatting
162
 
163
To ensure that the code is formatted consistently, run the script
164
[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh)
165
before creating a PR.
166
 
167
GitHub Actions will verify that any code changes are done in a style compliant
168
way. Install `clang-format` and `mint`:
169
 
170
```console
171
brew install clang-format@13
172
brew install mint
173
```
174
 
175
### Running Unit Tests
176
 
177
Select a scheme and press Command-u to build a component and run its unit tests.
178
 
179
## Contributing
180
 
181
See [Contributing](CONTRIBUTING.md).
182
 
183
## License
184
 
185
The contents of this repository is licensed under the
186
[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
187
 
188
[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions
189
[gh-google-utilities-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/google-utilities/badge.svg