Commit af071074 authored by Stephen Martinis's avatar Stephen Martinis Committed by Commit Bot

Restructure infra scripts

This is part of the effort to use more respectful terms in our code.
I've also just restructured everything; there's no need to have it in
this weird directory structure. There are only 3 files.

Bug: 1097180
Change-Id: Ib599cc04bdf08e55fc8a3fbfdbdce4f7162f1acb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264026
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782746}
parent 445d465f
......@@ -51,12 +51,8 @@ def GetBuildOutputDirectory(src_dir=None, cros_board=None):
return os.path.join(src_dir, out_dirname)
assert not cros_board, "'cros_board' not supported on this platform"
if sys.platform == 'darwin':
if AreNinjaFilesNewerThanXcodeFiles(src_dir):
return os.path.join(src_dir, 'out')
return os.path.join(src_dir, 'xcodebuild')
if sys.platform == 'cygwin' or sys.platform.startswith('win'):
if sys.platform == 'cygwin' or sys.platform.startswith('win') or (
sys.platorm == 'darwin'):
return os.path.join(src_dir, 'out')
raise NotImplementedError('Unexpected platform %s' % sys.platform)
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Set of basic operations/utilities that are used by the build. """
from contextlib import contextmanager
import ast
import cStringIO
import copy
import errno
import fnmatch
import glob
import json
import os
import re
import shutil
import socket
import stat
import subprocess
import sys
import threading
import time
import traceback
BUILD_DIR = os.path.realpath(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir))
# Local errors.
class MissingArgument(Exception):
pass
class PathNotFound(Exception):
pass
class ExternalError(Exception):
pass
def IsWindows():
return sys.platform == 'cygwin' or sys.platform.startswith('win')
def IsLinux():
return sys.platform.startswith('linux')
def IsMac():
return sys.platform.startswith('darwin')
def convert_json(option, _, value, parser):
"""Provide an OptionParser callback to unmarshal a JSON string."""
setattr(parser.values, option.dest, json.loads(value))
def AddPropertiesOptions(option_parser):
"""Registers command line options for parsing build and factory properties.
After parsing, the options object will have the 'build_properties' and
'factory_properties' attributes. The corresponding values will be python
dictionaries containing the properties. If the options are not given on
the command line, the dictionaries will be empty.
Args:
option_parser: An optparse.OptionParser to register command line options
for build and factory properties.
"""
option_parser.add_option('--build-properties', action='callback',
callback=convert_json, type='string',
nargs=1, default={},
help='build properties in JSON format')
option_parser.add_option('--factory-properties', action='callback',
callback=convert_json, type='string',
nargs=1, default={},
help='factory properties in JSON format')
......@@ -23,7 +23,7 @@ import subprocess
import sys
import tempfile
from slave import build_directory
import build_directory
SRC_DIR = os.path.abspath(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment