Skip to content

Commit 9150071

Browse files
Merge branch 'dev' into feature/aks-prebuilt-integration-tests
2 parents 8a42b26 + b178ecb commit 9150071

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

firestore/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ set(android_SRCS
9393
src/android/metadata_changes_android.cc
9494
src/android/metadata_changes_android.h
9595
src/android/promise_android.h
96+
src/android/promise_factory_android.h
9697
src/android/query_android.cc
9798
src/android/query_android.h
9899
src/android/query_snapshot_android.cc
@@ -112,23 +113,52 @@ set(android_SRCS
112113
src/android/timestamp_portable.cc
113114
src/android/transaction_android.cc
114115
src/android/transaction_android.h
116+
src/android/util_android.cc
115117
src/android/util_android.h
116118
src/android/wrapper.cc
117119
src/android/wrapper.h
118120
src/android/write_batch_android.cc
119121
src/android/write_batch_android.h
122+
src/jni/array.h
123+
src/jni/array_list.cc
124+
src/jni/array_list.h
125+
src/jni/boolean.cc
126+
src/jni/boolean.h
120127
src/jni/call_traits.h
128+
src/jni/class.cc
121129
src/jni/class.h
130+
src/jni/collection.cc
131+
src/jni/collection.h
132+
src/jni/declaration.h
133+
src/jni/double.cc
134+
src/jni/double.h
122135
src/jni/env.cc
123136
src/jni/env.h
137+
src/jni/hash_map.cc
138+
src/jni/hash_map.h
139+
src/jni/integer.cc
140+
src/jni/integer.h
141+
src/jni/iterator.cc
142+
src/jni/iterator.h
124143
src/jni/jni.cc
125144
src/jni/jni.h
126145
src/jni/jni_fwd.h
146+
src/jni/list.cc
147+
src/jni/list.h
148+
src/jni/loader.cc
149+
src/jni/loader.h
150+
src/jni/long.cc
151+
src/jni/long.h
152+
src/jni/map.cc
153+
src/jni/map.h
127154
src/jni/object.cc
128155
src/jni/object.h
129156
src/jni/ownership.h
157+
src/jni/set.h
130158
src/jni/string.cc
131159
src/jni/string.h
160+
src/jni/throwable.cc
161+
src/jni/throwable.h
132162
src/jni/traits.h)
133163

134164
set(ios_SRCS

scripts/gha/build_testapps.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,18 @@ def _build_ios(
451451
dir_util.copy_tree(framework_src_path, framework_dest_path)
452452
framework_paths.append(framework_dest_path)
453453

454+
podfile_tool_path = os.path.join(
455+
root_dir, "scripts", "gha", "integration_testing", "update_podfile.py")
456+
sdk_podfile_path = os.path.join(
457+
root_dir, "ios_pod", "Podfile")
458+
app_podfile_path = os.path.join(
459+
project_dir, "Podfile")
460+
podfile_patcher_args = [
461+
"python", podfile_tool_path,
462+
"--sdk_podfile", sdk_podfile_path,
463+
"--app_podfile", app_podfile_path
464+
]
465+
_run(podfile_patcher_args)
454466
_run(["pod", "install"])
455467

456468
entitlements_path = os.path.join(
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
r""" Update integration testapps' Podfiles to match the SDK's Podfile.
16+
Usage:
17+
python update_podfile.py --sdk_podfile ios_pod/Podfile \
18+
--app_podfile admob/integration_test/Podfile
19+
"""
20+
21+
from absl import app
22+
from absl import flags
23+
import re
24+
import fileinput
25+
26+
FLAGS = flags.FLAGS
27+
28+
flags.DEFINE_string(
29+
"sdk_podfile", None, "Path to CPP SDK's iOS podfile.",
30+
short_name="s")
31+
flags.DEFINE_string(
32+
"app_podfile", None, "Path to integration testapp's iOS podfile.",
33+
short_name="a")
34+
35+
36+
def main(argv):
37+
if len(argv) > 1:
38+
raise app.UsageError("Too many command-line arguments.")
39+
40+
sdk_podfile = FLAGS.sdk_podfile
41+
app_podfile = FLAGS.app_podfile
42+
43+
# split lines in Podfile by ' ' and ','
44+
split_pattern = ' |,'
45+
46+
# dict to store podName & podVersion from sdk's podfile
47+
pod_dict = {}
48+
with open(sdk_podfile) as f:
49+
for line in f:
50+
tokens = re.split(split_pattern, line)
51+
tokens = list(filter(None, tokens))
52+
if tokens[0] == 'pod':
53+
pod_dict[tokens[1]] = tokens[2]
54+
55+
# update podVersion in app's podfile
56+
new_lines = []
57+
with open(app_podfile) as f:
58+
for line in f:
59+
tokens = re.split(split_pattern, line)
60+
tokens = list(filter(None, tokens))
61+
if tokens[0] == 'pod' and tokens[1] in pod_dict:
62+
new_lines.append(line.replace(tokens[2], pod_dict[tokens[1]]))
63+
else:
64+
new_lines.append(line)
65+
66+
with open(app_podfile, "w") as out_file:
67+
out_file.writelines(new_lines)
68+
69+
70+
if __name__ == "__main__":
71+
flags.mark_flag_as_required("sdk_podfile")
72+
flags.mark_flag_as_required("app_podfile")
73+
app.run(main)

0 commit comments

Comments
 (0)