Commit 5584383a authored by johnme@chromium.org's avatar johnme@chromium.org

Revert 221736 "[android] Adds constants.GetOutDirectory() and co..."

Consistently causing WebKit Android (Nexus4) to fail provision_devices.

> [android] Adds constants.GetOutDirectory() and converts test scripts to use it.
> 
> BUG=260494
> TEST=None
> NOTRY=True
> 
> Review URL: https://chromiumcodereview.appspot.com/22903016

TBR=craigdh@chromium.org

Review URL: https://codereview.chromium.org/23926012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222008 0039d316-1c4b-4281-b951-d872f2087c98
parent 3861521c
...@@ -38,8 +38,9 @@ def ValidateInstallAPKOption(option_parser, options): ...@@ -38,8 +38,9 @@ def ValidateInstallAPKOption(option_parser, options):
if not options.apk: if not options.apk:
option_parser.error('--apk is mandatory.') option_parser.error('--apk is mandatory.')
if not os.path.exists(options.apk): if not os.path.exists(options.apk):
options.apk = os.path.join(constants.GetOutDirectory(), 'apks', options.apk = os.path.join(constants.DIR_SOURCE_ROOT,
options.apk) 'out', options.build_type,
'apks', options.apk)
def _InstallApk(args): def _InstallApk(args):
...@@ -53,7 +54,6 @@ def main(argv): ...@@ -53,7 +54,6 @@ def main(argv):
parser = optparse.OptionParser() parser = optparse.OptionParser()
AddInstallAPKOption(parser) AddInstallAPKOption(parser)
options, args = parser.parse_args(argv) options, args = parser.parse_args(argv)
constants.SetBuildType(options.build_type)
ValidateInstallAPKOption(parser, options) ValidateInstallAPKOption(parser, options)
if len(args) > 1: if len(args) > 1:
raise Exception('Error: Unknown argument:', args[1:]) raise Exception('Error: Unknown argument:', args[1:])
......
...@@ -15,7 +15,7 @@ import optparse ...@@ -15,7 +15,7 @@ import optparse
import sys import sys
import time import time
from pylib import android_commands, constants, forwarder from pylib import android_commands, forwarder
from pylib.utils import run_tests_helper from pylib.utils import run_tests_helper
...@@ -50,9 +50,8 @@ def main(argv): ...@@ -50,9 +50,8 @@ def main(argv):
sys.exit(1) sys.exit(1)
adb = android_commands.AndroidCommands(options.device) adb = android_commands.AndroidCommands(options.device)
constants.SetBuildType(options.build_type)
try: try:
forwarder.Forwarder.Map(port_pairs, adb) forwarder.Forwarder.Map(port_pairs, adb, options.build_type)
while True: while True:
time.sleep(60) time.sleep(60)
except KeyboardInterrupt: except KeyboardInterrupt:
......
...@@ -247,6 +247,7 @@ class AndroidCommands(object): ...@@ -247,6 +247,7 @@ class AndroidCommands(object):
self._device_utc_offset = None self._device_utc_offset = None
self._potential_push_size = 0 self._potential_push_size = 0
self._actual_push_size = 0 self._actual_push_size = 0
self._md5sum_build_dir = ''
self._external_storage = '' self._external_storage = ''
self._util_wrapper = '' self._util_wrapper = ''
...@@ -782,11 +783,18 @@ class AndroidCommands(object): ...@@ -782,11 +783,18 @@ class AndroidCommands(object):
A tuple containing lists of the host and device md5sum results as A tuple containing lists of the host and device md5sum results as
created by _ParseMd5SumOutput(). created by _ParseMd5SumOutput().
""" """
md5sum_dist_path = os.path.join(constants.GetOutDirectory(), if not self._md5sum_build_dir:
'md5sum_dist') default_build_type = os.environ.get('BUILD_TYPE', 'Debug')
assert os.path.exists(md5sum_dist_path), 'Please build md5sum.' build_dir = '%s/%s/' % (
command = 'push %s %s' % (md5sum_dist_path, MD5SUM_DEVICE_FOLDER) cmd_helper.OutDirectory().get(), default_build_type)
assert _HasAdbPushSucceeded(self._adb.SendCommand(command)) md5sum_dist_path = '%s/md5sum_dist' % build_dir
if not os.path.exists(md5sum_dist_path):
build_dir = '%s/Release/' % cmd_helper.OutDirectory().get()
md5sum_dist_path = '%s/md5sum_dist' % build_dir
assert os.path.exists(md5sum_dist_path), 'Please build md5sum.'
command = 'push %s %s' % (md5sum_dist_path, MD5SUM_DEVICE_FOLDER)
assert _HasAdbPushSucceeded(self._adb.SendCommand(command))
self._md5sum_build_dir = build_dir
cmd = (MD5SUM_LD_LIBRARY_PATH + ' ' + self._util_wrapper + ' ' + cmd = (MD5SUM_LD_LIBRARY_PATH + ' ' + self._util_wrapper + ' ' +
MD5SUM_DEVICE_PATH + ' ' + device_path) MD5SUM_DEVICE_PATH + ' ' + device_path)
...@@ -794,8 +802,7 @@ class AndroidCommands(object): ...@@ -794,8 +802,7 @@ class AndroidCommands(object):
self.RunShellCommand(cmd, timeout_time=2 * 60)) self.RunShellCommand(cmd, timeout_time=2 * 60))
assert os.path.exists(host_path), 'Local path not found %s' % host_path assert os.path.exists(host_path), 'Local path not found %s' % host_path
md5sum_output = cmd_helper.GetCmdOutput( md5sum_output = cmd_helper.GetCmdOutput(
[os.path.join(constants.GetOutDirectory(), 'md5sum_bin_host'), ['%s/md5sum_bin_host' % self._md5sum_build_dir, host_path])
host_path])
host_hash_tuples = _ParseMd5SumOutput(md5sum_output.splitlines()) host_hash_tuples = _ParseMd5SumOutput(md5sum_output.splitlines())
return (host_hash_tuples, device_hash_tuples) return (host_hash_tuples, device_hash_tuples)
......
...@@ -124,7 +124,7 @@ class BaseTestRunner(object): ...@@ -124,7 +124,7 @@ class BaseTestRunner(object):
def _ForwardPorts(self, port_pairs): def _ForwardPorts(self, port_pairs):
"""Forwards a port.""" """Forwards a port."""
Forwarder.Map(port_pairs, self.adb, self.tool) Forwarder.Map(port_pairs, self.adb, constants.GetBuildType(), self.tool)
def _UnmapPorts(self, port_pairs): def _UnmapPorts(self, port_pairs):
"""Unmap previously forwarded ports.""" """Unmap previously forwarded ports."""
......
...@@ -249,7 +249,8 @@ class TestServerThread(threading.Thread): ...@@ -249,7 +249,8 @@ class TestServerThread(threading.Thread):
else: else:
self.is_ready = _CheckPortStatus(self.host_port, True) self.is_ready = _CheckPortStatus(self.host_port, True)
if self.is_ready: if self.is_ready:
Forwarder.Map([(0, self.host_port)], self.adb, self.tool) Forwarder.Map([(0, self.host_port)], self.adb, constants.GetBuildType(),
self.tool)
# Check whether the forwarder is ready on the device. # Check whether the forwarder is ready on the device.
self.is_ready = False self.is_ready = False
device_port = Forwarder.DevicePortForHostPort(self.host_port) device_port = Forwarder.DevicePortForHostPort(self.host_port)
......
...@@ -97,3 +97,14 @@ def GetCmdStatusAndOutput(args, cwd=None, shell=False): ...@@ -97,3 +97,14 @@ def GetCmdStatusAndOutput(args, cwd=None, shell=False):
logging.debug('Truncated output:') logging.debug('Truncated output:')
logging.debug(stdout[:4096]) logging.debug(stdout[:4096])
return (exit_code, stdout) return (exit_code, stdout)
class OutDirectory(object):
_out_directory = os.path.join(constants.DIR_SOURCE_ROOT,
os.environ.get('CHROMIUM_OUT_DIR','out'))
@staticmethod
def set(out_directory):
OutDirectory._out_directory = out_directory
@staticmethod
def get():
return OutDirectory._out_directory
...@@ -132,18 +132,6 @@ def SetBuildType(build_type): ...@@ -132,18 +132,6 @@ def SetBuildType(build_type):
os.environ['BUILDTYPE'] = build_type os.environ['BUILDTYPE'] = build_type
def GetOutDirectory(build_type=None):
"""Returns the out directory where the output binaries are built.
Args:
build_type: Build type, generally 'Debug' or 'Release'. Defaults to the
globally set build type environment variable BUILDTYPE.
"""
return os.path.abspath(os.path.join(
DIR_SOURCE_ROOT, os.environ.get('CHROMIUM_OUT_DIR', 'out'),
GetBuildType() if build_type is None else build_type))
def _GetADBPath(): def _GetADBPath():
if os.environ.get('ANDROID_SDK_ROOT'): if os.environ.get('ANDROID_SDK_ROOT'):
return 'adb' return 'adb'
......
...@@ -31,8 +31,9 @@ class DeviceStatsMonitor(object): ...@@ -31,8 +31,9 @@ class DeviceStatsMonitor(object):
def __init__(self, adb, hz): def __init__(self, adb, hz):
self._adb = adb self._adb = adb
host_path = os.path.join( host_path = os.path.abspath(os.path.join(
constants.GetOutDirectory(), 'device_stats_monitor') constants.DIR_SOURCE_ROOT, 'out', constants.GetBuildType(),
'device_stats_monitor'))
self._adb.PushIfNeeded(host_path, DeviceStatsMonitor.DEVICE_PATH) self._adb.PushIfNeeded(host_path, DeviceStatsMonitor.DEVICE_PATH)
self._hz = hz self._hz = hz
......
...@@ -30,7 +30,8 @@ class FakeDns(object): ...@@ -30,7 +30,8 @@ class FakeDns(object):
subprocess instance connected to the fake_dns process on the device. subprocess instance connected to the fake_dns process on the device.
""" """
self._adb.PushIfNeeded( self._adb.PushIfNeeded(
os.path.join(constants.GetOutDirectory(), 'fake_dns'), os.path.join(constants.DIR_SOURCE_ROOT, 'out', constants.GetBuildType(),
'fake_dns'),
FakeDns._FAKE_DNS_PATH) FakeDns._FAKE_DNS_PATH)
return subprocess.Popen( return subprocess.Popen(
['adb', '-s', self._adb._adb.GetSerialNumber(), ['adb', '-s', self._adb._adb.GetSerialNumber(),
......
...@@ -17,6 +17,10 @@ import constants ...@@ -17,6 +17,10 @@ import constants
from pylib import valgrind_tools from pylib import valgrind_tools
def _MakeBinaryPath(build_type, binary_name):
return os.path.join(cmd_helper.OutDirectory.get(), build_type, binary_name)
def _GetProcessStartTime(pid): def _GetProcessStartTime(pid):
return psutil.Process(pid).create_time return psutil.Process(pid).create_time
...@@ -60,7 +64,7 @@ class Forwarder(object): ...@@ -60,7 +64,7 @@ class Forwarder(object):
os.environ[Forwarder._MULTIPROCESSING_ENV_VAR] = '1' os.environ[Forwarder._MULTIPROCESSING_ENV_VAR] = '1'
@staticmethod @staticmethod
def Map(port_pairs, adb, tool=None): def Map(port_pairs, adb, build_type='Debug', tool=None):
"""Runs the forwarder. """Runs the forwarder.
Args: Args:
...@@ -79,7 +83,7 @@ class Forwarder(object): ...@@ -79,7 +83,7 @@ class Forwarder(object):
if not tool: if not tool:
tool = valgrind_tools.CreateTool(None, adb) tool = valgrind_tools.CreateTool(None, adb)
with _FileLock(Forwarder._LOCK_PATH): with _FileLock(Forwarder._LOCK_PATH):
instance = Forwarder._GetInstanceLocked(tool) instance = Forwarder._GetInstanceLocked(build_type, tool)
instance._InitDeviceLocked(adb, tool) instance._InitDeviceLocked(adb, tool)
device_serial = adb.Adb().GetSerialNumber() device_serial = adb.Adb().GetSerialNumber()
...@@ -133,7 +137,7 @@ class Forwarder(object): ...@@ -133,7 +137,7 @@ class Forwarder(object):
""" """
with _FileLock(Forwarder._LOCK_PATH): with _FileLock(Forwarder._LOCK_PATH):
port_map = Forwarder._GetInstanceLocked( port_map = Forwarder._GetInstanceLocked(
None)._device_to_host_port_map None, None)._device_to_host_port_map
adb_serial = adb.Adb().GetSerialNumber() adb_serial = adb.Adb().GetSerialNumber()
for (device_serial, device_port) in port_map.keys(): for (device_serial, device_port) in port_map.keys():
if adb_serial == device_serial: if adb_serial == device_serial:
...@@ -144,43 +148,51 @@ class Forwarder(object): ...@@ -144,43 +148,51 @@ class Forwarder(object):
"""Returns the device port that corresponds to a given host port.""" """Returns the device port that corresponds to a given host port."""
with _FileLock(Forwarder._LOCK_PATH): with _FileLock(Forwarder._LOCK_PATH):
(device_serial, device_port) = Forwarder._GetInstanceLocked( (device_serial, device_port) = Forwarder._GetInstanceLocked(
None)._host_to_device_port_map.get(host_port) None, None)._host_to_device_port_map.get(host_port)
return device_port return device_port
@staticmethod @staticmethod
def _GetInstanceLocked(tool): def _GetInstanceLocked(build_type, tool):
"""Returns the singleton instance. """Returns the singleton instance.
Note that the global lock must be acquired before calling this method. Note that the global lock must be acquired before calling this method.
Args: Args:
build_type: 'Release' or 'Debug'
tool: Tool class to use to get wrapper, if necessary, for executing the tool: Tool class to use to get wrapper, if necessary, for executing the
forwarder (see valgrind_tools.py). forwarder (see valgrind_tools.py).
""" """
if not Forwarder._instance: if not Forwarder._instance:
Forwarder._instance = Forwarder(tool) Forwarder._instance = Forwarder(build_type, tool)
return Forwarder._instance return Forwarder._instance
def __init__(self, tool): def __init__(self, build_type, tool):
"""Constructs a new instance of Forwarder. """Constructs a new instance of Forwarder.
Note that Forwarder is a singleton therefore this constructor should be Note that Forwarder is a singleton therefore this constructor should be
called only once. called only once.
Args: Args:
build_type: 'Release' or 'Debug'
tool: Tool class to use to get wrapper, if necessary, for executing the tool: Tool class to use to get wrapper, if necessary, for executing the
forwarder (see valgrind_tools.py). forwarder (see valgrind_tools.py).
""" """
assert not Forwarder._instance assert not Forwarder._instance
self._build_type = build_type
self._tool = tool self._tool = tool
self._initialized_devices = set() self._initialized_devices = set()
self._device_to_host_port_map = dict() self._device_to_host_port_map = dict()
self._host_to_device_port_map = dict() self._host_to_device_port_map = dict()
self._host_forwarder_path = os.path.join( self._host_forwarder_path = _MakeBinaryPath(
constants.GetOutDirectory(), 'host_forwarder') self._build_type, 'host_forwarder')
assert os.path.exists(self._host_forwarder_path), 'Please build forwarder2' if not os.path.exists(self._host_forwarder_path):
self._build_type = 'Release' if self._build_type == 'Debug' else 'Debug'
self._host_forwarder_path = _MakeBinaryPath(
self._build_type, 'host_forwarder')
assert os.path.exists(
self._host_forwarder_path), 'Please build forwarder2'
self._device_forwarder_path_on_host = os.path.join( self._device_forwarder_path_on_host = os.path.join(
constants.GetOutDirectory(), 'forwarder_dist') cmd_helper.OutDirectory.get(), self._build_type, 'forwarder_dist')
self._InitHostLocked() self._InitHostLocked()
@staticmethod @staticmethod
...@@ -189,7 +201,7 @@ class Forwarder(object): ...@@ -189,7 +201,7 @@ class Forwarder(object):
Note that the global lock must be acquired before calling this method. Note that the global lock must be acquired before calling this method.
""" """
instance = Forwarder._GetInstanceLocked(None) instance = Forwarder._GetInstanceLocked(None, None)
serial = adb.Adb().GetSerialNumber() serial = adb.Adb().GetSerialNumber()
serial_with_port = (serial, device_port) serial_with_port = (serial, device_port)
if not serial_with_port in instance._device_to_host_port_map: if not serial_with_port in instance._device_to_host_port_map:
......
...@@ -96,6 +96,10 @@ def _GenerateDepsDirUsingIsolate(suite_name): ...@@ -96,6 +96,10 @@ def _GenerateDepsDirUsingIsolate(suite_name):
Args: Args:
suite_name: Name of the test suite (e.g. base_unittests). suite_name: Name of the test suite (e.g. base_unittests).
""" """
product_dir = os.path.join(cmd_helper.OutDirectory.get(),
constants.GetBuildType())
assert os.path.isabs(product_dir)
if os.path.isdir(constants.ISOLATE_DEPS_DIR): if os.path.isdir(constants.ISOLATE_DEPS_DIR):
shutil.rmtree(constants.ISOLATE_DEPS_DIR) shutil.rmtree(constants.ISOLATE_DEPS_DIR)
...@@ -106,14 +110,14 @@ def _GenerateDepsDirUsingIsolate(suite_name): ...@@ -106,14 +110,14 @@ def _GenerateDepsDirUsingIsolate(suite_name):
isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path) isolate_abs_path = os.path.join(constants.DIR_SOURCE_ROOT, isolate_rel_path)
isolated_abs_path = os.path.join( isolated_abs_path = os.path.join(
constants.GetOutDirectory(), '%s.isolated' % suite_name) product_dir, '%s.isolated' % suite_name)
assert os.path.exists(isolate_abs_path) assert os.path.exists(isolate_abs_path)
isolate_cmd = [ isolate_cmd = [
'python', _ISOLATE_SCRIPT, 'python', _ISOLATE_SCRIPT,
'remap', 'remap',
'--isolate', isolate_abs_path, '--isolate', isolate_abs_path,
'--isolated', isolated_abs_path, '--isolated', isolated_abs_path,
'-V', 'PRODUCT_DIR=%s' % constants.GetOutDirectory(), '-V', 'PRODUCT_DIR=%s' % product_dir,
'-V', 'OS=android', '-V', 'OS=android',
'--outdir', constants.ISOLATE_DEPS_DIR, '--outdir', constants.ISOLATE_DEPS_DIR,
] ]
......
...@@ -29,14 +29,15 @@ class TestPackageApk(TestPackage): ...@@ -29,14 +29,15 @@ class TestPackageApk(TestPackage):
suite_name: Name of the test suite (e.g. base_unittests). suite_name: Name of the test suite (e.g. base_unittests).
""" """
TestPackage.__init__(self, suite_name) TestPackage.__init__(self, suite_name)
product_dir = os.path.join(cmd_helper.OutDirectory.get(),
constants.GetBuildType())
if suite_name == 'content_browsertests': if suite_name == 'content_browsertests':
self.suite_path = os.path.join( self.suite_path = os.path.join(
constants.GetOutDirectory(), 'apks', '%s.apk' % suite_name) product_dir, 'apks', '%s.apk' % suite_name)
self._package_info = constants.PACKAGE_INFO['content_browsertests'] self._package_info = constants.PACKAGE_INFO['content_browsertests']
else: else:
self.suite_path = os.path.join( self.suite_path = os.path.join(
constants.GetOutDirectory(), '%s_apk' % suite_name, product_dir, '%s_apk' % suite_name, '%s-debug.apk' % suite_name)
'%s-debug.apk' % suite_name)
self._package_info = constants.PACKAGE_INFO['gtest'] self._package_info = constants.PACKAGE_INFO['gtest']
def _CreateCommandLineFileOnDevice(self, adb, options): def _CreateCommandLineFileOnDevice(self, adb, options):
......
...@@ -28,9 +28,10 @@ class TestPackageExecutable(TestPackage): ...@@ -28,9 +28,10 @@ class TestPackageExecutable(TestPackage):
suite_name: Name of the test suite (e.g. base_unittests). suite_name: Name of the test suite (e.g. base_unittests).
""" """
TestPackage.__init__(self, suite_name) TestPackage.__init__(self, suite_name)
self.suite_path = os.path.join(constants.GetOutDirectory(), suite_name) product_dir = os.path.join(cmd_helper.OutDirectory.get(),
self._symbols_dir = os.path.join(constants.GetOutDirectory(), constants.GetBuildType())
'lib.target') self.suite_path = os.path.join(product_dir, suite_name)
self._symbols_dir = os.path.join(product_dir, 'lib.target')
#override #override
def GetGTestReturnCode(self, adb): def GetGTestReturnCode(self, adb):
......
...@@ -68,10 +68,9 @@ class HostDrivenTestCase(object): ...@@ -68,10 +68,9 @@ class HostDrivenTestCase(object):
def TearDown(self): def TearDown(self):
pass pass
# TODO(craigdh): Remove GetOutDir once references have been removed
# downstream.
def GetOutDir(self): def GetOutDir(self):
return constants.GetOutDirectory() return os.path.join(os.environ['CHROME_SRC'], 'out',
constants.GetBuildType())
def Run(self): def Run(self):
logging.info('Running host-driven test: %s', self.tagged_name) logging.info('Running host-driven test: %s', self.tagged_name)
......
...@@ -15,7 +15,8 @@ import flakiness_dashboard_results_uploader ...@@ -15,7 +15,8 @@ import flakiness_dashboard_results_uploader
def _LogToFile(results, test_type, suite_name): def _LogToFile(results, test_type, suite_name):
"""Log results to local files which can be used for aggregation later.""" """Log results to local files which can be used for aggregation later."""
log_file_path = os.path.join(constants.GetOutDirectory(), 'test_logs') log_file_path = os.path.join(constants.DIR_SOURCE_ROOT, 'out',
constants.GetBuildType(), 'test_logs')
if not os.path.exists(log_file_path): if not os.path.exists(log_file_path):
os.mkdir(log_file_path) os.mkdir(log_file_path)
full_file_name = os.path.join( full_file_name = os.path.join(
......
...@@ -55,7 +55,7 @@ class ReversePortForwarder(object): ...@@ -55,7 +55,7 @@ class ReversePortForwarder(object):
# Begin forwarding the device_ports to the host_ports. # Begin forwarding the device_ports to the host_ports.
forwarder.Forwarder.Map([(self._device_http, self._host_http), forwarder.Forwarder.Map([(self._device_http, self._host_http),
(self._device_https, self._host_https)], (self._device_https, self._host_https)],
self._adb, tool=None) self._adb, build_type='Release', tool=None)
def Stop(self): def Stop(self):
"""Cleans up after the start call by closing the forwarder.""" """Cleans up after the start call by closing the forwarder."""
......
...@@ -14,7 +14,7 @@ from telemetry.core import util ...@@ -14,7 +14,7 @@ from telemetry.core import util
util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android') util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
try: try:
from pylib import android_commands # pylint: disable=F0401 from pylib import android_commands # pylint: disable=F0401
from pylib import constants # pylint: disable=F0401 from pylib import cmd_helper # pylint: disable=F0401
from pylib import forwarder # pylint: disable=F0401 from pylib import forwarder # pylint: disable=F0401
from pylib import ports # pylint: disable=F0401 from pylib import ports # pylint: disable=F0401
except Exception: except Exception:
...@@ -41,6 +41,10 @@ def ResetTestServerPortAllocation(): ...@@ -41,6 +41,10 @@ def ResetTestServerPortAllocation():
return ports.ResetTestServerPortAllocation() return ports.ResetTestServerPortAllocation()
def GetOutDirectory():
return cmd_helper.OutDirectory.get()
class AdbCommands(object): class AdbCommands(object):
"""A thin wrapper around ADB""" """A thin wrapper around ADB"""
...@@ -147,11 +151,10 @@ def HasForwarder(buildtype=None): ...@@ -147,11 +151,10 @@ def HasForwarder(buildtype=None):
if not buildtype: if not buildtype:
return (HasForwarder(buildtype='Release') or return (HasForwarder(buildtype='Release') or
HasForwarder(buildtype='Debug')) HasForwarder(buildtype='Debug'))
device_forwarder = os.path.join( return (os.path.exists(os.path.join(GetOutDirectory(), buildtype,
constants.GetOutDirectory(build_type=buildtype), 'device_forwarder') 'device_forwarder')) and
host_forwarder = os.path.join( os.path.exists(os.path.join(GetOutDirectory(), buildtype,
constants.GetOutDirectory(build_type=buildtype), 'host_forwarder') 'host_forwarder')))
return os.path.exists(device_forwarder) and os.path.exists(host_forwarder)
class Forwarder(object): class Forwarder(object):
def __init__(self, adb, *port_pairs): def __init__(self, adb, *port_pairs):
...@@ -162,12 +165,6 @@ class Forwarder(object): ...@@ -162,12 +165,6 @@ class Forwarder(object):
for port_pair in port_pairs] for port_pair in port_pairs]
self._port_pairs = new_port_pairs self._port_pairs = new_port_pairs
if HasForwarder('Release'):
constants.SetBuildType('Release')
elif HasForwarder('Debug'):
constants.SetBuildType('Debug')
else:
raise Exception('Build forwarder2')
forwarder.Forwarder.Map(new_port_pairs, self._adb) forwarder.Forwarder.Map(new_port_pairs, self._adb)
@property @property
......
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