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
8 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
14 # clean sources, but preserve .gyp, .gypi
18 third_party/httpd24/ \
19 third_party/instaweb/ \
20 third_party/openssl/ \
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/ \
26 # some more unneeded files for build
27 rm -r net/instaweb/rewriter/testdata
28 rm -r third_party/aprutil/gen
29 rm -r third_party/chromium/src/base/test
30 #rm -r third_party/chromium/src/chrome
31 rm -r third_party/chromium/src/net
32 rm -r third_party/gflags/src/windows
33 rm -r third_party/giflib/windows
34 rm -r third_party/google-sparsehash/src/windows
35 rm -r third_party/libjpeg_turbo/src/{mac,win}
36 rm -r third_party/protobuf/java
37 rm -r third_party/protobuf/src/google/protobuf/testdata
38 rm -r third_party/zlib/{contrib,examples,old,doc}
39 rm -r third_party/zlib/{win32,msdos,nintendods,watcom,qnx,amiga}
41 find -type d -name testdata | xargs rm -r
42 find -type d -name mac | xargs rm -r
43 find -type d -name win | xargs rm -r
44 find -type d -name test | xargs rm -r
45 find third_party -type d -name android | xargs rm -r
47 find -type f -name '*_test.cc' | xargs rm
48 find -type f -name '*_unittest.cc' | xargs rm
50 # not using gn nor ninja
51 find -name BUILD.gn | xargs rm
54 find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty
56 # build/linux and third_party/chromium/src/build/linux are same dirs,
57 # the later is not used by build system, but used by tarball packaging
58 #rm -r third_party/chromium/src/build/linux
59 #third_party/chromium/src/build/linux