OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, 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 """Helper for building and deploying Observatory""" | 5 """Helper for building and deploying Observatory""" |
6 | 6 |
7 import argparse | 7 import argparse |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import shutil | 10 import shutil |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 options.pub_executable, | 132 options.pub_executable, |
133 options.pub_snapshot, | 133 options.pub_snapshot, |
134 options.package_root, | 134 options.package_root, |
135 ['get', '--offline'], | 135 ['get', '--offline'], |
136 options.silent) | 136 options.silent) |
137 elif (cmd == 'build'): | 137 elif (cmd == 'build'): |
138 return PubCommand(options.dart_executable, | 138 return PubCommand(options.dart_executable, |
139 options.pub_executable, | 139 options.pub_executable, |
140 options.pub_snapshot, | 140 options.pub_snapshot, |
141 options.package_root, | 141 options.package_root, |
142 ['build', '--output', args[0]], | 142 ['build', |
| 143 '-DOBS_VER=' + utils.GetVersion(), |
| 144 '--output', args[0]], |
143 options.silent) | 145 options.silent) |
144 elif (cmd == 'deploy'): | 146 elif (cmd == 'deploy'): |
145 Deploy('build', 'deployed') | 147 Deploy('build', 'deployed') |
146 elif (cmd == 'rewrite'): | 148 elif (cmd == 'rewrite'): |
147 RewritePubSpec(args[0], args[1], args[2], args[3]) | 149 RewritePubSpec(args[0], args[1], args[2], args[3]) |
148 else: | 150 else: |
149 print >> sys.stderr, ('ERROR: command "%s" not supported') % (cmd) | 151 print >> sys.stderr, ('ERROR: command "%s" not supported') % (cmd) |
150 return -1; | 152 return -1; |
151 | 153 |
152 def main(): | 154 def main(): |
(...skipping 13 matching lines...) Expand all Loading... |
166 if (options.pub_snapshot != None): | 168 if (options.pub_snapshot != None): |
167 options.pub_snapshot = os.path.abspath(options.pub_snapshot) | 169 options.pub_snapshot = os.path.abspath(options.pub_snapshot) |
168 if len(args) == 1: | 170 if len(args) == 1: |
169 args[0] = os.path.abspath(args[0]) | 171 args[0] = os.path.abspath(args[0]) |
170 # Pub must be run from the project's root directory. | 172 # Pub must be run from the project's root directory. |
171 ChangeDirectory(options.directory) | 173 ChangeDirectory(options.directory) |
172 return ExecuteCommand(options, args) | 174 return ExecuteCommand(options, args) |
173 | 175 |
174 if __name__ == '__main__': | 176 if __name__ == '__main__': |
175 sys.exit(main()); | 177 sys.exit(main()); |
OLD | NEW |