vspasova@webrtc.org | 2865542 | 2012-08-15 14:35:40 +0000 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license |
| 5 | # that can be found in the LICENSE file in the root of the source |
| 6 | # tree. An additional intellectual property rights grant can be found |
| 7 | # in the file PATENTS. All contributing project authors may |
| 8 | # be found in the AUTHORS file in the root of the source tree. |
| 9 | |
| 10 | import subprocess |
| 11 | import sys |
| 12 | |
| 13 | |
| 14 | def run_ant_build_command(path_to_ant_build_file): |
| 15 | """Tries to build the passed build file with ant.""" |
| 16 | process = subprocess.Popen([ |
| 17 | 'ant', '-buildfile', '%s' % path_to_ant_build_file], |
| 18 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 19 | output, error = process.communicate() |
| 20 | if process.returncode != 0: |
| 21 | print 'Error: ', error |
| 22 | else: |
| 23 | print output |
| 24 | |
| 25 | |
| 26 | def _main(): |
| 27 | run_ant_build_command('third_party/zxing/core/build.xml') |
| 28 | run_ant_build_command('third_party/zxing/javase/build.xml') |
| 29 | return 0 |
| 30 | |
| 31 | |
| 32 | if __name__ == '__main__': |
| 33 | sys.exit(_main()) |