OSDN Git Service

ggrep
authorJon Boekenoogen <jboekeno@google.com>
Mon, 7 Apr 2014 17:57:38 +0000 (10:57 -0700)
committerJon Boekenoogen <jboekeno@google.com>
Mon, 7 Apr 2014 21:05:38 +0000 (21:05 +0000)
Add ggrep to search Gradle files more easily. Similar
to jgrep, cgrep, mgrep, etc...

Change-Id: I9f0bc74560c1df4c369216eabdb9e825bcb6fe75

envsetup.sh

index 0661fe6..cba01be 100644 (file)
@@ -10,6 +10,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
 - mma:     Builds all of the modules in the current directory, and their dependencies.
 - mmma:    Builds all of the modules in the supplied directories, and their dependencies.
 - cgrep:   Greps on all local C/C++ files.
+- ggrep:   Greps on all local Gradle files.
 - jgrep:   Greps on all local Java files.
 - resgrep: Greps on all local res/*.xml files.
 - godir:   Go to the directory containing a file.
@@ -988,6 +989,11 @@ function gettargetarch
     get_build_var TARGET_ARCH
 }
 
+function ggrep()
+{
+    find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.gradle" -print0 | xargs -0 grep --color -n "$@"
+}
+
 function jgrep()
 {
     find . -name .repo -prune -o -name .git -prune -o  -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"