Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: mojo/tools/check_mojom_golden_files.py

Issue 707893005: Add mojo/tools/mopy with paths and version utilities (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/tools/check_mojom_golden_files.py
diff --git a/mojo/tools/check_mojom_golden_files.py b/mojo/tools/check_mojom_golden_files.py
index 9af7a862ab67fed671047696cb524d88fa7bfdf0..ae80cebd61e1de2bc74b0850d21c89fbe3b077b2 100755
--- a/mojo/tools/check_mojom_golden_files.py
+++ b/mojo/tools/check_mojom_golden_files.py
@@ -9,11 +9,11 @@ import sys
from filecmp import dircmp
from shutil import rmtree
from tempfile import mkdtemp
+from mopy.paths import Paths
-_script_dir = os.path.dirname(os.path.abspath(__file__))
-_mojo_dir = os.path.join(_script_dir, os.pardir)
-_chromium_src_dir = os.path.join(_mojo_dir, os.pardir)
-sys.path.insert(0, os.path.join(_mojo_dir, "public", "tools", "bindings",
+paths = Paths()
+
+sys.path.insert(0, os.path.join(paths.mojo_dir, "public", "tools", "bindings",
"pylib"))
from mojom_tests.support.find_files import FindFiles
from mojom_tests.support.run_bindings_generator import RunBindingsGenerator
@@ -68,14 +68,14 @@ def main():
if args.verbose:
print "Generating files to %s ..." % out_dir
- mojom_files = FindFiles(_mojo_dir, "*.mojom")
+ mojom_files = FindFiles(paths.mojo_dir, "*.mojom")
for mojom_file in mojom_files:
if args.verbose:
- print " Processing %s ..." % os.path.relpath(mojom_file, _mojo_dir)
+ print " Processing %s ..." % os.path.relpath(mojom_file, paths.mojo_dir)
# TODO(vtl): This may wrong, since the path can be overridden in the .gyp
# file.
- RunBindingsGenerator(out_dir, _mojo_dir, mojom_file,
- ["-I", os.path.abspath(_chromium_src_dir)])
+ RunBindingsGenerator(out_dir, paths.mojo_dir, mojom_file,
+ ["-I", paths.src_root])
if args.generate_golden_files:
return 0
« no previous file with comments | « mojo/PRESUBMIT.py ('k') | mojo/tools/mopy/__init__.py » ('j') | mojo/tools/mopy/paths.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698