# either -l/--list OR build-target is required (but not both). group = parser.add_mutually_exclusive_group(required=True) group.add_argument('build_target', nargs='?') group.add_argument('-l', '--list', action='store_true', help='List all possible run-build targets.') options = parser.parse_args() ########## if options.list: print("List of all known build_target: ") for k in sorted(target_config.keys()): print(" * " + k) # TODO: would be nice if this was the same order as the target config file. sys.exit(1) if not target_config.get(options.build_target): sys.stderr.write("error: invalid build_target, see -l/--list.\n") sys.exit(1) target = target_config[options.build_target] n_threads = options.n_threads custom_env = target.get('env', {}) custom_env['SOONG_ALLOW_MISSING_DEPENDENCIES'] = 'true' # Switch the build system to unbundled mode in the reduced manifest branch. if not os.path.isdir(env.ANDROID_BUILD_TOP + '/frameworks/base'): custom_env['TARGET_BUILD_UNBUNDLED'] = 'true' print(custom_env) os.environ.update(custom_env) # build is just a binary/script that is directly executed to build any artifacts needed for the # test.
# either -l/--list OR build-target is required (but not both). group = parser.add_mutually_exclusive_group(required=True) group.add_argument('build_target', nargs='?') group.add_argument('-l', '--list', action='store_true', help='List all possible run-build targets.') options = parser.parse_args() ########## if options.list: print "List of all known build_target: " for k in sorted(target_config.iterkeys()): print " * " + k # TODO: would be nice if this was the same order as the target config file. sys.exit(1) if not target_config.get(options.build_target): sys.stderr.write("error: invalid build_target, see -l/--list.\n") sys.exit(1) target = target_config[options.build_target] n_threads = options.n_threads custom_env = target.get('env', {}) custom_env['SOONG_ALLOW_MISSING_DEPENDENCIES'] = 'true' print custom_env os.environ.update(custom_env) if target.has_key('make'): build_command = 'make' build_command += ' -j' + str(n_threads) build_command += ' -C ' + env.ANDROID_BUILD_TOP build_command += ' ' + target.get('make')