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

Side by Side Diff: editor/tools/compile_analyzer.py

Issue 236063009: Fixes misleading error message when compiling dart Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 # 5 #
6 # Script to compile the analyzer. 6 # Script to compile the analyzer.
7 # 7 #
8 # Usage: compile_analyzer.py OPTIONS files 8 # Usage: compile_analyzer.py OPTIONS files
9 # 9 #
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 print >> output, file, 89 print >> output, file,
90 print >> output 90 print >> output
91 91
92 # version 92 # version
93 print >> output, 'Implementation-Version: %s' % GetDartVersion() 93 print >> output, 'Implementation-Version: %s' % GetDartVersion()
94 94
95 def VerifyJavacGetPath(): 95 def VerifyJavacGetPath():
96 javac_path = GetJavacPath() 96 javac_path = GetJavacPath()
97 try: 97 try:
98 subprocess.check_output([javac_path, "-version"]) 98 subprocess.check_output([javac_path, "-version"])
99 except: 99 except (OSError, subprocess.CalledProcessError), e:
100 print "You do not have JDK installed, can't build the analyzer" 100 print "You do not have JDK installed, can't build the analyzer"
101 print "Reason: %s" % e
101 exit(1) 102 exit(1)
102 return javac_path 103 return javac_path
103 104
104 def GetJavacPath(): 105 def GetJavacPath():
105 if 'JAVA_HOME' in os.environ: 106 if 'JAVA_HOME' in os.environ:
106 return join(os.environ['JAVA_HOME'], 'bin', 107 return join(os.environ['JAVA_HOME'], 'bin',
107 'javac' + GetExecutableExtension()) 108 'javac' + GetExecutableExtension())
108 else: 109 else:
109 return "javac" 110 return "javac"
110 111
111 def GetJarToolPath(): 112 def GetJarToolPath():
112 if 'JAVA_HOME' in os.environ: 113 if 'JAVA_HOME' in os.environ:
113 return join(os.environ['JAVA_HOME'], 'bin', 'jar' + GetExecutableExtension() ) 114 return join(os.environ['JAVA_HOME'], 'bin', 'jar' + GetExecutableExtension() )
(...skipping 19 matching lines...) Expand all
133 os.makedirs(options.output_dir) 134 os.makedirs(options.output_dir)
134 135
135 CopyFiles(options) 136 CopyFiles(options)
136 CreateManifestFile(options) 137 CreateManifestFile(options)
137 CompileAnalyzer(options, args) 138 CompileAnalyzer(options, args)
138 CreateJarFile(options) 139 CreateJarFile(options)
139 140
140 141
141 if __name__ == '__main__': 142 if __name__ == '__main__':
142 main() 143 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698