Clean up dead code: filter.
[platform/upstream/libSkiaSharp.git] / tools / git_clone_to_google3.sh
index 1e2f34f..9f64fc7 100755 (executable)
 # Usage:
 #      ./tools/git_clone_to_google3.sh
 
-source gbash.sh || exit
-DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR."
+prodcertstatus -q || (echo "Please run prodaccess." 1>&2; exit 1)
+source gbash.sh || exit 2
 
-set -x -e
+DEFINE_string skia_rev "" "Git hash of Skia revision to clone, default LKGR."
+gbash::init_google "$@"
 
-# To run this script after making edits, run:
-# g4 revert -k git_clone_to_google3.sh
-# To get the file back into your CL, run:
-# g4 edit git_clone_to_google3.sh
-#g4 opened | grep -q "//depot" && gbash::die "Must run in a clean client."
+set -e
 
 # Checkout LKGR of Skia in a temp location.
 TMP=$(gbash::make_temp_dir)
@@ -48,8 +45,9 @@ rsync -avzJ \
   --include=/dm \
   --include=/gm \
   --include=/include \
-  --include=/src \
+  --include=/resources \
   --exclude=/src/animator \
+  --include=/src \
   --include=/tests \
   --include=/third_party \
   --include=/tools \
@@ -80,12 +78,17 @@ echo BUILD >> .git/info/exclude
 g4 revert README.google
 g4 revert BUILD
 
-# Use google3 version of OWNERS, README.google, and BUILD.
+# Use google3 version of OWNERS.
 find . \
-  \( -name OWNERS -o -name README.google -o -name BUILD \) \
+  -name OWNERS \
   -exec git update-index --skip-worktree \{\} \; \
   -execdir g4 revert \{\} \;
 
+# Tell git to ignore these files that have Windows line endings, because Piper
+# will always change them to Unix line endings.
+git update-index --skip-worktree make.bat
+git update-index --skip-worktree make.py
+
 # Tell git to ignore files left out of the rsync (i.e. "deleted" files).
 git status --porcelain | \
   grep -e "^ D" | \