forked from MobiVM/robovm-robopods
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_deps.sh
executable file
·71 lines (62 loc) · 1.57 KB
/
build_deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#
# Small tools that build dependency tree between frameworks of Firebase
# for each framework it does:
# - list all exported symbols to out/symbols
# - list all imported symbols to out/${framework}.deps
# Then for each imported symbol it finds a framework where it is exported from
#
function dump_exports {
nm -g -U -j $1 2>/dev/null | grep -v ":" | sort | uniq | xargs -n 1 -I '{}' echo '{}' $2 >> out/symbols
}
function dump_deps {
nm -g -u -j $1 2>/dev/null | grep -v ":" | sort | uniq | xargs -n 1 echo > out/$2.deps
}
print_tree() {
local nm=$1
local tabs="$2"
if [ -f out/$nm.deps ]; then
echo "$tabs$nm"
deps=$(join -o2.2 out/$nm.deps out/symbols | sort | uniq | grep -v $nm)
for d in ${deps[@]}; do
print_tree $d " $tabs"
done
fi
}
rm -rf out
mkdir out
echo "Analyzing dependencies..."
for frm in $(find ~/Downloads/Firebase -name "*.framework"); do
if [[ $frm == *"xcframework"* && $frm != *"arm64"* ]]; then
continue
fi
nm=$(basename $frm .framework)
echo " ...$nm"
dump_exports "$frm/$nm" $nm
dump_deps "$frm/$nm" $nm
done
sort -o out/symbols out/symbols
# frameworks to list dependencies
frameworks=(
FirebaseCore
FirebaseAnalytics
FirebaseCoreDiagnostics
FirebaseAuth
FirebaseCrashlytics
FirebaseDatabase
FirebaseDynamicLinks
GoogleMobileAds
GoogleAppMeasurement
GoogleSignIn
UserMessagingPlatform
FirebaseMessaging
FirebaseRemoteConfig
FirebaseFirestore
FirebaseStorage
)
echo "Results:"
for frm in ${frameworks[@]}; do
nm=$(basename $frm)
print_tree $nm ""
echo "" # new line
done