Skip to content

Commit 1d8853b

Browse files
authored
Make the ios tvos packaging use the product list (#1092)
1 parent f1e2b43 commit 1d8853b

File tree

2 files changed

+37
-17
lines changed

2 files changed

+37
-17
lines changed

build_scripts/ios/package.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ cd "${origpath}"
4545

4646
# Convert frameworks into libraries so we can provide both in the SDK.
4747
cd "${sourcepath}"
48-
for frameworkpath in frameworks/ios/*/*.framework; do
49-
libpath=$(echo "${frameworkpath}" | sed 's|^frameworks|libs|' | sed 's|\([^/]*\)\.framework$|lib\1.a|')
50-
if [[ $(basename "${libpath}") == 'libfirebase.a' ]]; then
51-
libpath=$(echo "${libpath}" | sed 's|libfirebase\.a|libfirebase_app.a|')
52-
fi
53-
54-
frameworkpath=$(echo "${frameworkpath}" | sed 's|\([^/]*\)\.framework$|\1.framework/\1|')
55-
mkdir -p $(dirname "${destpath}/${libpath}")
56-
cp -af "${sourcepath}/${frameworkpath}" "${destpath}/${libpath}"
48+
for product in ${product_list[*]}; do
49+
if [[ "${product}" == "app" ]]; then
50+
product_name="firebase"
51+
else
52+
product_name="firebase_${product}"
53+
fi
54+
for frameworkpath in frameworks/ios/*/${product_name}.framework; do
55+
if [[ ! -d "${sourcepath}/${frameworkpath}" ]]; then
56+
continue
57+
fi
58+
libpath=$(echo "${frameworkpath}" | sed 's|^frameworks|libs|' | sed 's|\([^/]*\)\.framework$|lib\1.a|')
59+
if [[ $(basename "${libpath}") == 'libfirebase.a' ]]; then
60+
libpath=$(echo "${libpath}" | sed 's|libfirebase\.a|libfirebase_app.a|')
61+
fi
62+
63+
frameworkpath=$(echo "${frameworkpath}" | sed 's|\([^/]*\)\.framework$|\1.framework/\1|')
64+
mkdir -p $(dirname "${destpath}/${libpath}")
65+
cp -af "${sourcepath}/${frameworkpath}" "${destpath}/${libpath}"
66+
done
5767
done
5868
cd "${origpath}"

build_scripts/tvos/package.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,24 @@ cd "${origpath}"
5555

5656
# Convert frameworks into libraries so we can provide both in the SDK.
5757
cd "${sourcepath}"
58-
for frameworkpath in frameworks/tvos/*/*.framework; do
59-
libpath=$(echo "${frameworkpath}" | sed 's|^frameworks|libs|' | sed 's|\([^/]*\)\.framework$|lib\1.a|')
60-
if [[ $(basename "${libpath}") == 'libfirebase.a' ]]; then
61-
libpath=$(echo "${libpath}" | sed 's|libfirebase\.a|libfirebase_app.a|')
62-
fi
58+
for product in ${product_list[*]}; do
59+
if [[ "${product}" == "app" ]]; then
60+
product_name="firebase"
61+
else
62+
product_name="firebase_${product}"
63+
fi
64+
for frameworkpath in frameworks/tvos/*/${product_name}.framework; do
65+
if [[ ! -d "${sourcepath}/${frameworkpath}" ]]; then
66+
continue
67+
fi
68+
libpath=$(echo "${frameworkpath}" | sed 's|^frameworks|libs|' | sed 's|\([^/]*\)\.framework$|lib\1.a|')
69+
if [[ $(basename "${libpath}") == 'libfirebase.a' ]]; then
70+
libpath=$(echo "${libpath}" | sed 's|libfirebase\.a|libfirebase_app.a|')
71+
fi
6372

64-
frameworkpath=$(echo "${frameworkpath}" | sed 's|\([^/]*\)\.framework$|\1.framework/\1|')
65-
mkdir -p $(dirname "${destpath}/${libpath}")
66-
cp -af "${sourcepath}/${frameworkpath}" "${destpath}/${libpath}"
73+
frameworkpath=$(echo "${frameworkpath}" | sed 's|\([^/]*\)\.framework$|\1.framework/\1|')
74+
mkdir -p $(dirname "${destpath}/${libpath}")
75+
cp -af "${sourcepath}/${frameworkpath}" "${destpath}/${libpath}"
76+
done
6777
done
6878
cd "${origpath}"

0 commit comments

Comments
 (0)