Index: tools/buildtools/linux64/clang-format |
diff --git a/tools/buildtools/linux64/clang-format b/tools/buildtools/linux64/clang-format |
new file mode 100755 |
index 0000000000000000000000000000000000000000..715ff745bb6d9dbe391c295330e7efe1a3758f50 |
--- /dev/null |
+++ b/tools/buildtools/linux64/clang-format |
@@ -0,0 +1,20 @@ |
+#!/usr/bin/env python |
aam
2017/05/09 01:49:17
When invoked via 'git cl format' this script won't
|
+# Copyright 2017 The Dart project authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+"""Forwards to the clang-format for the Linux toolchain.""" |
+ |
+import os |
+import subprocess |
+import sys |
+ |
+DART_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
aam
2017/05/09 01:23:52
DART_ROOT here actually points to dart-sdk/sdk/bui
|
+TOOLCHAIN = os.path.join(DART_ROOT, 'buildtools', 'toolchain') |
+CLANG_FORMAT = os.path.join(TOOLCHAIN, 'clang+llvm-x86_64-linux', 'bin', 'clang-format') |
+ |
+def main(argv): |
+ return subprocess.call([CLANG_FORMAT] + argv[1:]) |
+ |
+if __name__ == '__main__': |
+ sys.exit(main(sys.argv)) |