Skip to content

Commit ec193d0

Browse files
Add Performance Support for Swift Package Manager (#8412)
* Create NanoPb code generation scripts (#8336) * Create NanoPb code generation scripts * Fix style and add README * Fix copyright * Update proto_generator.py * Update README.md * Create nanopb options file. (#8371) * Create NanoPb code generation scripts * Fix style and add README * Fix copyright * Update perf_metrics.options * Update options with map * Add generated proto files. * Update imports. * Convert Objective-C Classes to Nanopb (#8387) * Convert all traces to nanopb * Refactor for loop. * Add set has_application_info to true. * Incorporated comments. * Fix style * Create NanoPb code generation scripts (#8336) * Create NanoPb code generation scripts * Fix style and add README * Fix copyright * Update proto_generator.py * Update README.md * Create nanopb options file. (#8371) * Create NanoPb code generation scripts * Fix style and add README * Fix copyright * Update perf_metrics.options * Update options with map * Add generated proto files. * Update imports. * Convert Objective-C Classes to Nanopb (#8387) * Convert all traces to nanopb * Refactor for loop. * Add set has_application_info to true. * Incorporated comments. * Fix style * Fix style * Convert nanopb struct to GDTCOREventDataObject and update the source code to use nanopb struct. (#8439) * Convert all traces to nanopb * Refactor for loop. * WIP: nanopb conversion in FPRClient and FPREvent * Update FPRClientTest.m * Update FPRClient.m * Update FPRClientTest.m * Add set has_application_info to true. * Remove proto imports. * Set has_fields to be true in FPRTestUtils.m * Completed GDTEvent conversion. * Fix sampler tests. * Fix style * Refactor nanopb struct setter * Fix style * Fix pod-lib-lint failures. * Update FPRClient with decoded string * Set some "_has" fields to true. * Add prefix to extern methods. * Fix style. * Update FPRClient to use trace.name without FPRDecodeString * Fix style * Incorporate comments. * Integrate Performance with SPM (#8476) * Convert all traces to nanopb * Refactor for loop. * WIP: nanopb conversion in FPRClient and FPREvent * Update FPRClientTest.m * Update FPRClient.m * Update FPRClientTest.m * Add set has_application_info to true. * Remove proto imports. * Set has_fields to be true in FPRTestUtils.m * Completed GDTEvent conversion. * Fix sampler tests. * Fix style * Refactor nanopb struct setter * Fix style * Fix pod-lib-lint failures. * Update FPRClient with decoded string * Set some "_has" fields to true. * Add prefix to extern methods. * Fix style. * Update FPRClient to use trace.name without FPRDecodeString * Fix style * Update Package.swift * Update Package.swift * Update Package.swift * Made SDK and unit tests buildable. * Made all unit tests passing. * Update keyWindow style. * Add Performance to workflow. * Update FPRUIViewControllerInstrument.h * Incorporate comments. * Add Performance to SwiftPMTests. * Update style. * Fix Unit tests and update workflow. * Add FirebasePerformance wrapper * Update import statement. * Update style. * Update performance.yml * Create PerformanceUnit.xcscheme * Update objc-module.m * Update objc-module.m * Updae objc-header.m * Update objc-header.m * Incorporate feedback. * Update objc-header.m * Organize folder structure to fix the spm tests. * Update public import path * Delete xcodebuild.log * Update workflow files * Fix failing swift-test for Perf SPM (#8507) * Fix UIKit import * Update FPRNetworkTraceTest.m * Exclude TARGET_OS_MACCATALYST from objc header test * Update main.swift * Update main.swift Co-authored-by: Paul Beusterien <[email protected]> * Remove Protobuf dependency (#8511) * Remove protobuf dependency * Update FirebasePerformance.podspec * Incorporate comments. * Update UIKit import Co-authored-by: Paul Beusterien <[email protected]>
1 parent ad1cd17 commit ec193d0

File tree

81 files changed

+2870
-3813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2870
-3813
lines changed

.github/workflows/performance.yml

+48
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,34 @@ jobs:
7474
- name: Test objc quickstart
7575
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance)
7676

77+
spm:
78+
# Don't run on private repo unless it is a PR.
79+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
80+
runs-on: macOS-latest
81+
strategy:
82+
matrix:
83+
target: [iOS]
84+
steps:
85+
- uses: actions/checkout@v2
86+
- name: Initialize xcodebuild
87+
run: scripts/setup_spm_tests.sh
88+
- name: Unit Tests
89+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
90+
91+
spm-cron:
92+
# Don't run on private repo.
93+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
94+
runs-on: macOS-latest
95+
strategy:
96+
matrix:
97+
target: [tvOS]
98+
steps:
99+
- uses: actions/checkout@v2
100+
- name: Initialize xcodebuild
101+
run: scripts/setup_spm_tests.sh
102+
- name: Unit Tests
103+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
104+
77105
catalyst:
78106
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
79107
runs-on: macOS-latest
@@ -94,3 +122,23 @@ jobs:
94122
run: scripts/setup_bundler.sh
95123
- name: Build and test
96124
run: scripts/third_party/travis/retry.sh pod spec lint FirebasePerformance.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'
125+
126+
performance-cron-only:
127+
# Don't run on private repo.
128+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
129+
runs-on: macos-latest
130+
strategy:
131+
matrix:
132+
target: [ios, tvos]
133+
flags: [
134+
'--skip-tests --use-static-frameworks',
135+
'--skip-tests --use-libraries'
136+
]
137+
needs: pod-lib-lint
138+
steps:
139+
- uses: actions/checkout@v2
140+
- name: Setup Bundler
141+
run: scripts/setup_bundler.sh
142+
- name: PodLibLint Performance Cron
143+
run: |
144+
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}

FirebasePerformance.podspec

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
2828

2929
base_dir = "FirebasePerformance/"
3030
s.source_files = [
31-
base_dir + 'Sources/**/*.[mh]',
32-
base_dir + 'ProtoSupport/**/*.[mh]',
31+
base_dir + 'Sources/**/*.[cmh]',
3332
'FirebaseCore/Sources/Private/*.h',
3433
'FirebaseInstallations/Source/Library/Private/*.h',
3534
'FirebaseRemoteConfig/Sources/Private/*.h',
@@ -40,9 +39,10 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
4039
base_dir + 'Public/**/*.h',
4140
]
4241

43-
s.public_header_files = base_dir + 'Sources/Public/*.h'
42+
s.public_header_files = base_dir + 'Sources/Public/FirebasePerformance/*.h'
4443

45-
preprocessor_definitions = 'GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 ' + 'FIRPerformance_LIB_VERSION=' + String(s.version)
44+
preprocessor_definitions = 'FIRPerformance_LIB_VERSION=' + String(s.version)
45+
preprocessor_definitions += ' PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1'
4646
if ENV['FPR_UNSWIZZLE_AVAILABLE'] && ENV['FPR_UNSWIZZLE_AVAILABLE'] == '1' then
4747
preprocessor_definitions += ' UNSWIZZLE_AVAILABLE=1'
4848
end
@@ -64,14 +64,14 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
6464
s.dependency 'GoogleUtilities/Environment', '~> 7.4'
6565
s.dependency 'GoogleUtilities/ISASwizzler', '~> 7.4'
6666
s.dependency 'GoogleUtilities/MethodSwizzler', '~> 7.4'
67-
s.dependency 'Protobuf', '~> 3.15'
67+
s.dependency 'nanopb', '~> 2.30908.0'
6868

6969
s.test_spec 'unit' do |unit_tests|
7070
unit_tests.platforms = {:ios => ios_deployment_target, :tvos => tvos_deployment_target}
7171
unit_tests.scheme = { :code_coverage => true }
7272
unit_tests.source_files = [
7373
'FirebasePerformance/Tests/Unit/**/*.{m,h,plist}',
74-
'GoogleDataTransport/GDTCORTests/Common/**/*.[hm]',
74+
'SharedTestUtilities/*.[hm]',
7575
]
7676
unit_tests.resources = ['FirebasePerformance/Tests/Unit/Server/*File']
7777
unit_tests.requires_arc = true

FirebasePerformance/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Version 8.6.0
2+
* Add Firebase Performance support for Swift Package Manager. (#6528)
3+
14
# Version 8.2.0
25
* Update log messages with proper log levels.
36
* Fix empty values in `network_info.request_completed_time_us` field from the [data schema](https://firebase.google.com/docs/perf-mon/bigquery-export#detailed_data_schema).

0 commit comments

Comments
 (0)