| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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() |
| OLD | NEW |