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/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}
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
43 find -depth -type d -name test | xargs rm -rv
44 find third_party -type d -name android | xargs rm -r
46 find -type f -name '*_test.cc' | xargs rm
47 find -type f -name '*_unittest.cc' | xargs rm
49 # not using gn nor ninja
50 find -name BUILD.gn | xargs rm
53 find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty
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
57 #rm -r third_party/chromium/src/build/linux
58 #third_party/chromium/src/build/linux