summaryrefslogtreecommitdiffstats
path: root/build/inverse_depth.py
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 22:07:43 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 22:07:43 +0000
commita4b0f408ac92589d244e6d0ca05309865c5ec5aa (patch)
tree571bf91e0cb5a3a378f79067b3c16a787a7f539d /build/inverse_depth.py
parent16dcbb6a94d4d5ac8d1f0761718de38a0eeacd0b (diff)
downloadchromium_src-a4b0f408ac92589d244e6d0ca05309865c5ec5aa.zip
chromium_src-a4b0f408ac92589d244e6d0ca05309865c5ec5aa.tar.gz
chromium_src-a4b0f408ac92589d244e6d0ca05309865c5ec5aa.tar.bz2
Mojo: Include "path/to/foo.mojom.h"
Given path/to/foo.mojom, change the code generator to output: <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom.cc <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom.h <(SHARED_INTERMEDIATE_DIR)/path/to/foo.mojom-internal.h This involves shelling out to a python script to compute "path/to" part as that is not otherwise available from GYP. See build/inverse_depth.py. DEPTH is now passed to mojom_bindings_generator.py so that it can similarly compute "path/to". With that, we no longer need the include_dir argument, so I dropped it. R=davemoore@chromium.org, mark@chromium.org Review URL: https://codereview.chromium.org/177183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/inverse_depth.py')
-rwxr-xr-xbuild/inverse_depth.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/inverse_depth.py b/build/inverse_depth.py
new file mode 100755
index 0000000..ce7a6ab
--- /dev/null
+++ b/build/inverse_depth.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+
+
+def DoMain(argv):
+ depth = argv[0]
+ return os.path.relpath(os.getcwd(), os.path.abspath(depth))
+
+
+def main(argv):
+ if len(argv) < 2:
+ print "USAGE: inverse_depth.py depth"
+ return 1
+ print DoMain(argv[1:])
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))