Skip to content

Commit 010f6ce

Browse files
DellaBittajonsimantov
authored andcommitted
Reflect changes made to our Open Source repo in order to fix build errors in release version 7.0.0. Reflecting the work made in the repo so that we don't export the problematic files again.
Fixes include: - Using std::mutex in app/heartbeat_date_storage_desktop. Replaced its use with our own internal implementation of Mutex. - ios_pod CmakeList updated with sunmou@'s changes to fallback to the xcframework path for header resolution. - Updating main podfile to the new minimum supported iOS version of 10.0. - Added heartbeat_date_storage_desktop to app's cmakefile on Desktop and iOS. - Removed firebase_firestore_settings_ios files from firestore's cmake file. - Removed util_desktop_windows, macos and linux files from database CMakeLists. This implentation had been migrated to firebase/app. - Added play-services-base dependency to google_api_resources gradle file. - Added new lines to the ends of numerous build.gradle files. PiperOrigin-RevId: 348119031
1 parent afaa730 commit 010f6ce

File tree

11 files changed

+31
-26
lines changed

11 files changed

+31
-26
lines changed

admob/admob_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ afterEvaluate {
5454
}
5555

5656
apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
57-
extractAndDexAarFile('admob_resources')
57+
extractAndDexAarFile('admob_resources')

app/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ set(common_SRCS
135135
src/function_registry.cc
136136
src/future.cc
137137
src/future_manager.cc
138-
src/heartbeat_date_storage_desktop.cc
139-
src/heartbeat_info_desktop.cc
140138
src/path.cc
141139
src/reference_counted_future_impl.cc
142140
src/scheduler.cc
@@ -164,11 +162,15 @@ set(app_android_SRCS
164162
set(app_ios_SRCS
165163
src/app_ios.mm
166164
src/util_ios.mm
165+
src/heartbeat_date_storage_desktop.cc
166+
src/heartbeat_info_desktop.cc
167167
src/invites/ios/invites_receiver_internal_ios.mm
168168
src/invites/ios/invites_ios_startup.mm
169169
src/uuid_ios_darwin.mm)
170170
set(app_desktop_SRCS
171171
src/app_desktop.cc
172+
src/heartbeat_date_storage_desktop.cc
173+
src/heartbeat_info_desktop.ccx`
172174
src/invites/stub/invites_receiver_internal_stub.cc
173175
src/variant_util.cc)
174176
if(ANDROID)

app/app_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ afterEvaluate {
5454
}
5555

5656
apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
57-
extractAndDexAarFile('app_resources')
57+
extractAndDexAarFile('app_resources')

app/google_api_resources/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ android {
5050

5151
dependencies {
5252
implementation 'com.google.firebase:firebase-analytics:18.0.0'
53+
implementation 'com.google.android.gms:play-services-base:17.5.0'
5354
implementation project(':app:app_resources')
5455
}
5556

@@ -58,4 +59,4 @@ afterEvaluate {
5859
}
5960

6061
apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
61-
extractAndDexAarFile('google_api_resources')
62+
extractAndDexAarFile('google_api_resources')

app/invites_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ afterEvaluate {
5555
}
5656

5757
apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
58-
extractAndDexAarFile('invites_resources')
58+
extractAndDexAarFile('invites_resources')

app/src/heartbeat_date_storage_desktop.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <utility>
2121

2222
#include "app/src/filesystem.h"
23+
#include "app/src/mutex.h"
2324

2425
namespace FIREBASE_NAMESPACE {
2526

@@ -29,8 +30,8 @@ const char kHeartbeatDir[] = "firebase-heartbeat";
2930
const char kHeartbeatFilename[] = "HEARTBEAT_INFO_STORAGE";
3031

3132
// Returns the mutex that protects accesses to the storage file.
32-
std::mutex& FileMutex() {
33-
static std::mutex* mutex_ = new std::mutex();
33+
Mutex& FileMutex() {
34+
static Mutex* mutex_ = new Mutex(Mutex::kModeNonRecursive);
3435
return *mutex_;
3536
}
3637

@@ -47,7 +48,7 @@ std::string GetFilename(std::string& error) {
4748
} // namespace
4849

4950
HeartbeatDateStorage::HeartbeatDateStorage() : filename_(GetFilename(error_)) {
50-
std::lock_guard<std::mutex> lock(FileMutex());
51+
MutexLock lock(FileMutex());
5152

5253
// Ensure the file exists, otherwise the first attempt to read it would
5354
// fail.
@@ -69,7 +70,7 @@ bool HeartbeatDateStorage::ReadPersisted() {
6970

7071
HeartbeatMap result;
7172

72-
std::lock_guard<std::mutex> lock(FileMutex());
73+
MutexLock lock(FileMutex());
7374

7475
std::ifstream f(filename_);
7576
if (!f) {
@@ -102,7 +103,7 @@ bool HeartbeatDateStorage::ReadPersisted() {
102103
bool HeartbeatDateStorage::WritePersisted() const {
103104
if (!IsValid()) return false;
104105

105-
std::lock_guard<std::mutex> lock(FileMutex());
106+
MutexLock lock(FileMutex());
106107

107108
std::ofstream f(filename_, std::ios_base::trunc);
108109
if (!f) {

app/src/heartbeat_date_storage_desktop.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#include <ctime>
2525
#include <map>
26-
#include <mutex> // NOLINT(build/c++11)
2726
#include <string>
2827

2928
namespace FIREBASE_NAMESPACE {

database/CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,18 +155,8 @@ elseif(IOS)
155155
set(database_platform_SRCS
156156
"${ios_SRCS}")
157157
else()
158-
# Add platform-specific util files.
159-
if(MSVC)
160-
set(desktop_extra_SRCS src/desktop/util_desktop_windows.cc)
161-
elseif(APPLE)
162-
set(desktop_extra_SRCS src/desktop/util_desktop_macos.mm)
163-
else()
164-
# Linux
165-
set(desktop_extra_SRCS src/desktop/util_desktop_linux.cc)
166-
endif()
167158
set(database_platform_SRCS
168-
"${desktop_SRCS}"
169-
"${desktop_extra_SRCS}")
159+
"${desktop_SRCS}")
170160
endif()
171161

172162
if(ANDROID OR IOS)

firestore/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ set(ios_SRCS
131131
src/ios/document_snapshot_ios.h
132132
src/ios/field_value_ios.cc
133133
src/ios/field_value_ios.h
134-
src/ios/firebase_firestore_settings_ios.cc
135-
src/ios/firebase_firestore_settings_ios.h
136134
src/ios/firestore_ios.cc
137135
src/ios/firestore_ios.h
138136
src/ios/hard_assert_ios.cc
@@ -247,6 +245,8 @@ elseif(IOS)
247245
FirebaseFirestore
248246
abseil
249247
nanopb
248+
gRPC-C++
249+
gRPC-Core
250250
)
251251
endif()
252252

ios_pod/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ function(symlink_pod_headers target_name pod_name dir_name)
122122
file(GLOB framework_dir ${glob_dir})
123123
endif()
124124

125+
# If failed to find headers, try xcframework path.
126+
if(NOT EXISTS ${framework_dir})
127+
set(glob_dir "${FIREBASE_POD_DIR}/Pods/${pod_name}/${FRAMEWORK_DIR}/*/*.xcframework/*/*.framework/Headers")
128+
file(GLOB framework_dirs ${glob_dir})
129+
# xcframework contains several frameworks. Their Headers are the same. So it's okay use first framework's Headers
130+
list(LENGTH framework_dirs dir_len)
131+
if(dir_len GREATER 0)
132+
list(GET framework_dirs 0 first_dir)
133+
file(GLOB framework_dir ${first_dir})
134+
endif()
135+
endif()
136+
125137
# Maybe this pod is not a framework, continue
126138
if(NOT EXISTS ${framework_dir})
127139
return()

ios_pod/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source 'https://github.com/CocoaPods/Specs.git'
2-
platform :ios, '8.0'
2+
platform :ios, '10.0'
33

44
target 'GetPods' do
55
pod 'Firebase/Core', '7.0.0'

0 commit comments

Comments
 (0)