| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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: |
| 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 exit(1) | 101 exit(1) |
| 102 return javac_path | 102 return javac_path |
| 103 | 103 |
| 104 def GetJavacPath(): | 104 def GetJavacPath(): |
| 105 if 'JAVA_HOME' in os.environ: | 105 if 'JAVA_HOME' in os.environ: |
| 106 return join(os.environ['JAVA_HOME'], 'bin', | 106 return join(os.environ['JAVA_HOME'], 'bin', |
| 107 'javac' + GetExecutableExtension()) | 107 'javac' + GetExecutableExtension()) |
| 108 else: | 108 else: |
| 109 return "javac" | 109 return "javac" |
| 110 | 110 |
| 111 def GetJarToolPath(): | 111 def GetJarToolPath(): |
| 112 if 'JAVA_HOME' in os.environ: | 112 if 'JAVA_HOME' in os.environ: |
| 113 return join(os.environ['JAVA_HOME'], 'bin', 'jar' + GetExecutableExtension()
) | 113 return join(os.environ['JAVA_HOME'], 'bin', 'jar' + GetExecutableExtension()
) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 133 os.makedirs(options.output_dir) | 133 os.makedirs(options.output_dir) |
| 134 | 134 |
| 135 CopyFiles(options) | 135 CopyFiles(options) |
| 136 CreateManifestFile(options) | 136 CreateManifestFile(options) |
| 137 CompileAnalyzer(options, args) | 137 CompileAnalyzer(options, args) |
| 138 CreateJarFile(options) | 138 CreateJarFile(options) |
| 139 | 139 |
| 140 | 140 |
| 141 if __name__ == '__main__': | 141 if __name__ == '__main__': |
| 142 main() | 142 main() |
| OLD | NEW |