]>
Commit | Line | Data |
---|---|---|
81c4dc24 ER |
1 | #!/bin/sh |
2 | set -xe | |
3 | ||
4 | # There are directories we want to strip, but that are unnecessarily required by the build-system | |
5 | # So we drop everything but the gyp/gypi files | |
6 | almost_strip_dirs() { | |
7 | for dir in "$@"; do | |
8 | find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || : | |
9 | done | |
10 | } | |
11 | ||
12 | export LC_ALL=C | |
13 | ||
14 | # clean sources, but preserve .gyp, .gypi | |
15 | almost_strip_dirs \ | |
16 | third_party/apr/ \ | |
17 | third_party/httpd/ \ | |
18 | third_party/httpd24/ \ | |
19 | third_party/instaweb/ \ | |
20 | third_party/openssl/ \ | |
d1259ece ER |
21 | third_party/chromium/src/base/third_party/superfasthash/ \ |
22 | third_party/chromium/src/base/third_party/symbolize/ \ | |
23 | third_party/chromium/src/base/third_party/xdg_mime/ \ | |
24 | third_party/chromium/src/base/third_party/xdg_user_dirs/ \ | |
81c4dc24 ER |
25 | |
26 | # some more unneeded files for build | |
81c4dc24 | 27 | rm -r net/instaweb/rewriter/testdata |
d1259ece ER |
28 | rm -r third_party/aprutil/gen |
29 | rm -r third_party/chromium/src/base/test | |
d1259ece ER |
30 | rm -r third_party/chromium/src/net |
31 | rm -r third_party/gflags/src/windows | |
32 | rm -r third_party/giflib/windows | |
33 | rm -r third_party/google-sparsehash/src/windows | |
34 | rm -r third_party/libjpeg_turbo/src/{mac,win} | |
35 | rm -r third_party/protobuf/java | |
36 | rm -r third_party/protobuf/src/google/protobuf/testdata | |
37 | rm -r third_party/zlib/{contrib,examples,old,doc} | |
38 | rm -r third_party/zlib/{win32,msdos,nintendods,watcom,qnx,amiga} | |
39 | ||
40 | find -type d -name testdata | xargs rm -r | |
41 | find -type d -name mac | xargs rm -r | |
42 | find -type d -name win | xargs rm -r | |
12ba1b2b | 43 | find -depth -type d -name test | xargs rm -rv |
d1259ece ER |
44 | find third_party -type d -name android | xargs rm -r |
45 | ||
46 | find -type f -name '*_test.cc' | xargs rm | |
47 | find -type f -name '*_unittest.cc' | xargs rm | |
48 | ||
49 | # not using gn nor ninja | |
50 | find -name BUILD.gn | xargs rm | |
51 | ||
52 | # cleanup empty dirs | |
53 | find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty | |
81c4dc24 | 54 | |
d1259ece ER |
55 | # build/linux and third_party/chromium/src/build/linux are same dirs, |
56 | # the later is not used by build system, but used by tarball packaging | |
81c4dc24 ER |
57 | #rm -r third_party/chromium/src/build/linux |
58 | #third_party/chromium/src/build/linux |