Created
October 2, 2019 02:22
-
-
Save stepango/8e86994e3b89b5a46020c2100d329510 to your computer and use it in GitHub Desktop.
Find all empty R.java files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
path = os.path.dirname(os.path.realpath(__file__)) | |
pattern = """public final class R { | |
private R() {} | |
}""" | |
# r=root, d=directories, f = files | |
for r, d, f in os.walk(path): | |
for file in f: | |
if 'R.java' == file: | |
fullPath = os.path.join(r, file) | |
s = open(fullPath, 'r').read() | |
if pattern in s: | |
print(os.path.join(r, file)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment