6eca4fc0c6483a2b6c80e32c9156a8db9907abb0
[platform/framework/web/crosswalk.git] / src / xwalk / app / tools / android / gyp / ant.py
1 #!/usr/bin/env python
2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6 # pylint: disable=F0401
7
8 """An Ant wrapper that suppresses useless Ant output.
9
10 Ant build scripts output "BUILD SUCCESSFUL" and build timing at the end of
11 every build. In the Android build, this just adds a lot of useless noise to the
12 build output. This script forwards its arguments to ant, and prints Ant's
13 output up until the BUILD SUCCESSFUL line.
14 """
15
16 import sys
17
18 from util import build_utils
19
20
21 def main(argv):
22   stdout = build_utils.CheckCallDie(['ant'] + argv[1:], suppress_output=True)
23   stdout = stdout.decode("utf-8").strip().split('\n')
24   for line in stdout:
25     if line.strip() == 'BUILD SUCCESSFUL':
26       break
27     print(line)
28
29
30 if __name__ == '__main__':
31   sys.exit(main(sys.argv))