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

Unified Diff: editor/tools/compile_analyzer.py

Issue 22393002: First CL for removing our dependency on the checked-in binary for building (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months 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
« no previous file with comments | « editor/build/create_analyzer.xml ('k') | runtime/dart-runtime.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/compile_analyzer.py
diff --git a/editor/tools/compile_analyzer.py b/editor/tools/compile_analyzer.py
index 3d7c4f0797ef7ed75c43b9f996cecc7712e2573e..7e7e8cb9c32b53df91d167142c637e825e42e9d6 100644
--- a/editor/tools/compile_analyzer.py
+++ b/editor/tools/compile_analyzer.py
@@ -8,6 +8,7 @@
# Usage: compile_analyzer.py OPTIONS files
#
+import imp
import optparse
import os
import platform
@@ -17,6 +18,13 @@ import sys
from os.path import join
+def GetUtils():
+ '''Dynamically load the tools/utils.py python module.'''
+ dart_dir = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
+ return imp.load_source('utils', os.path.join(dart_dir, 'tools', 'utils.py'))
+
+utils = GetUtils()
+
def GetOptions():
options = optparse.OptionParser(usage='usage: %prog [options] <output>')
options.add_option("--class_path_file",
@@ -82,7 +90,7 @@ def CreateManifestFile(options):
# version
print >> output, 'Implementation-Version: %s' % GetDartVersion()
-
+
def GetJavacPath():
if 'JAVA_HOME' in os.environ:
return join(os.environ['JAVA_HOME'], 'bin', 'javac' + GetExecutableExtension())
@@ -104,24 +112,7 @@ def GetExecutableExtension():
def GetDartVersion():
# 0.1.2.0_r13661
- return RunDart("../tools/version.dart")
-
-def RunDart(scriptPath):
- if sys.platform == 'darwin':
- pipe = subprocess.Popen(
- ['../tools/testing/bin/macos/dart', scriptPath],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- elif os.name == 'posix':
- pipe = subprocess.Popen(
- ['../tools/testing/bin/linux/dart', scriptPath],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- else:
- pipe = subprocess.Popen(
- ['..\\tools\\testing\\bin\\windows\\dart.exe', scriptPath],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-
- output = pipe.communicate()
- return output[0]
+ return utils.GetVersion()
def main():
(options, args) = GetOptions()
@@ -136,5 +127,5 @@ def main():
CreateJarFile(options)
-if __name__=='__main__':
+if __name__ == '__main__':
main()
« no previous file with comments | « editor/build/create_analyzer.xml ('k') | runtime/dart-runtime.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698