-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-android-makefile-file-list
More file actions
executable file
·52 lines (44 loc) · 1.27 KB
/
get-android-makefile-file-list
File metadata and controls
executable file
·52 lines (44 loc) · 1.27 KB
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
#!/usr/bin/env bash
# Author: Goldie Lin
# Usage: cd to Android root and run this script.
set -euo pipefail
# Variable definitions
# ====================
declare -gr top_file="build/core/envsetup.mk"
declare -gr top_file2="build/make/core/envsetup.mk"
# Function definitions
# ====================
check_pwd() {
if [[ ! -f "${top_file}" && ! -f "${top_file2}" ]]; then
echo "Error: Please cd to Android root and run again." >&2
return 1
fi
}
gen_list() {
# type `find -regextype help` to get supported regextypes in findutils.
find . -regextype posix-egrep \
\( -regex '^.*\/\.git(|\/.*)$' \
-o -regex '^.*\/\.repo(|\/.*)$' \
-o -regex '^.*\/\.svn(|\/.*)$' \
-o -regex '^.*\/\.bzr(|\/.*)$' \
-o -regex '^.*\/\.hg(|\/.*)$' \
-o -regex '^\.\/out(|\/.*)$' \
-o -regex '^\.\/docs(|\/.*)$' \
-o -regex '^\.\/sdk(|\/.*)$' \
-o -regex '^\.\/ndk(|\/.*)$' \
-o -regex '^\.\/gdk(|\/.*)$' \
-o -regex '^\.\/pdk(|\/.*)$' \
-o -regex '^\.\/prebuilt(|\/.*)$' \
-o -regex '^\.\/prebuilts(|\/.*)$' \
-o -regex '^\.\/developers(|\/.*)$' \
-o -regex '^\.\/development(|\/.*)$' \
\) -prune -o \
-type f -iregex \
'^.*\/(Makefile(|\..*)|[^/]*\.(mk|mak|make|makefile))$' \
-print
}
main() {
check_pwd
gen_list
}
main "$@"