GithubHelp home page GithubHelp logo

aieth-zhangqiang / googledatatransport Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/googledatatransport

0.0 0.0 0.0 933 KB

License: Apache License 2.0

Shell 0.58% Ruby 1.57% Python 2.49% C 3.44% Objective-C 81.81% Swift 10.10%

googledatatransport's Introduction

Version License Platform

Actions Status

GoogleDataTransport

This library is for internal Google use only. It allows the logging of data and telemetry from Google SDKs.

Integration Testing

These instructions apply to minor and patch version updates. Major versions need a customized adaptation.

After the CI is green:

  • Determine the next version for release by checking the tagged releases. Ensure that the next release version keeps the Swift PM and CocoaPods versions in sync.
  • Verify that the releasing version is the latest entry in the CHANGELOG.md, updating it if necessary.
  • Update the version in the podspec to match the latest entry in the CHANGELOG.md
  • Checkout the main branch and ensure it is up to date.
    git checkout main
    git pull
  • Add the CocoaPods tag ({version} will be the latest version in the podspec)
    git tag CocoaPods-{version}
    git push origin CocoaPods-{version}
  • Push the podspec to the designated repo
    • If this version of GDT is intended to launch before or with the next Firebase release:

      Push to SpecsStaging
      pod repo push --skip-tests staging GoogleDataTransport.podspec

      If the command fails with Unable to find the 'staging' repo., add the staging repo with:

      pod repo add staging [email protected]:firebase/SpecsStaging.git
    • Otherwise:

      Push to SpecsDev
      pod repo push --skip-tests dev GoogleDataTransport.podspec

      If the command fails with Unable to find the 'dev' repo., add the dev repo with:

      pod repo add dev [email protected]:firebase/SpecsDev.git
  • Run Firebase CI by waiting until next nightly or adding a PR that touches Gemfile.
  • On google3, create a workspace and new CL. Then copybara and run a global TAP.
    /google/data/ro/teams/copybara/copybara third_party/firebase/ios/Releases/GoogleDataTransport/copy.bara.sky \
    --piper-description-behavior=OVERWRITE \
    --destination-cl=YOUR_CL gdt
    

Publishing

The release process is as follows:

  1. Tag and release for Swift PM
  2. Publish to CocoaPods
  3. Create GitHub Release
  4. Perform post release cleanup

Swift Package Manager

By creating and pushing a tag for Swift PM, the newly tagged version will be immediately released for public use. Given this, please verify the intended time of release for Swift PM.

  • Add a version tag for Swift PM
git tag {version}
git push origin {version}

Note: Ensure that any inflight PRs that depend on the new GoogleDataTransport version are updated to point to the newly tagged version rather than a checksum.

CocoaPods

  • Publish the newly versioned pod to CocoaPods

    It's recommended to point to the GoogleDataTransport.podspec in staging to make sure the correct spec is being published.

    pod trunk push ~/.cocoapods/repos/staging/GoogleDataTransport/{version}/GoogleDataTransport.podspec --skip-tests

    The pod push was successful if the above command logs: ๐Ÿš€ GoogleDataTransport ({version}) successfully published. In addition, a new commit that publishes the new version (co-authored by CocoaPodsAtGoogle) should appear in the CocoaPods specs repo. Last, the latest version should be displayed on GoogleDataTransport's CocoaPods page.

Update the release template's Tag version and Release title fields with the latest version. In addition, reference the Release Notes in the release's description.

See this release for an example.

Don't forget to perform the post release cleanup!

Post Release Cleanup

Clean up SpecsStaging
pwd=$(pwd)
mkdir -p /tmp/release-cleanup && cd $_
git clone [email protected]:firebase/SpecsStaging.git
cd SpecsStaging/
git rm -rf GoogleDataTransport/
git commit -m "Post publish cleanup"
git push origin master
rm -rf /tmp/release-cleanup
cd $pwd

Set logging level

Swift

  • Import GoogleDataTransport module:
    import GoogleDataTransport
  • Set logging level global variable to the desired value before calling FirebaseApp.configure():
    GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevel.debug.rawValue

Objective-C

  • Import GoogleDataTransport:
    #import <GoogleDataTransport/GoogleDataTransport.h>
  • Set logging level global variable to the desired value before calling -[FIRApp configure]:
    GDTCORConsoleLoggerLoggingLevel = GDTCORLoggingLevelDebug;

Prereqs

  • gem install --user cocoapods cocoapods-generate
  • brew install protobuf nanopb-generator
  • easy_install --user protobuf

To develop

  • Run ./GoogleDataTransport/generate_project.sh after installing the prereqs

When adding new logging endpoint

  • Use commands similar to:
    • python -c "line='https://www.firebase.com'; print line[0::2]"
    • python -c "line='https://www.firebase.com'; print line[1::2]"

When adding internal code that shouldn't be easily usable on github

  • Consider using go/copybara-library/scrubbing#cc_scrub

Development

Ensure that you have at least the following software:

For the pod that you want to develop:

pod gen GoogleDataTransport.podspec --local-sources=./ --auto-open --platforms=ios

Note: If the CocoaPods cache is out of date, you may need to run pod repo update before the pod gen command.

Note: Set the --platforms option to macos or tvos to develop/test for those platforms. Since 10.2, Xcode does not properly handle multi-platform CocoaPods workspaces.

Development for Catalyst

  • pod gen GoogleDataTransport.podspec --local-sources=./ --auto-open --platforms=ios
  • Check the Mac box in the App-iOS Build Settings
  • Sign the App in the Settings Signing & Capabilities tab
  • Click Pods in the Project Manager
  • Add Signing to the iOS host app and unit test targets
  • Select the Unit-unit scheme
  • Run it to build and test

Alternatively disable signing in each target:

  • Go to Build Settings tab
  • Click +
  • Select Add User-Defined Setting
  • Add CODE_SIGNING_REQUIRED setting with a value of NO

Code Formatting

To ensure that the code is formatted consistently, run the script ./scripts/check.sh before creating a PR.

GitHub Actions will verify that any code changes are done in a style compliant way. Install clang-format and mint:

brew install clang-format@14
brew install mint

Running Unit Tests

Select a scheme and press Command-u to build a component and run its unit tests.

Contributing

See Contributing for more information on contributing to the Firebase iOS SDK.

License

The contents of this repository is licensed under the Apache License, version 2.0.

googledatatransport's People

Contributors

mikehaney24 avatar paulb777 avatar maksymmalyhin avatar ncooke3 avatar ryanwilson avatar ddnan avatar granluo avatar visumickey avatar wilhuff avatar ulukaya avatar jasonhu-g avatar jeremyjiang-dev avatar tejasd avatar samedson avatar bjhomer avatar bhaktipriya avatar charlotteliang avatar mikelehen avatar morganchen12 avatar pranavrajgopal avatar vimanyu avatar dependabot[bot] avatar dmaclach avatar itslazyvar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.