blob: 0f49c85d6e927997e8e5756321f041a05993750f [file] [log] [blame]
vspasova@webrtc.org28655422012-08-15 14:35:40 +00001#!/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
10import subprocess
11import sys
12
13
14def 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
26def _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
32if __name__ == '__main__':
33 sys.exit(_main())