1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)# Copyright 2014 The Chromium Authors. All rights reserved. 2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be 3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)# found in the LICENSE file. 4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)import os 6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)import sys 7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) 10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)def RegisterAllBackends(): 13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) """Registers all the known backends.""" 141320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci from memory_inspector.backends import android_backend 15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) from memory_inspector.core import backends 16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) backends.Register(android_backend.AndroidBackend()) 17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)def _IncludeDeps(): 20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) """Imports all the project dependencies.""" 21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) chromium_dir = os.path.abspath(os.path.join(ROOT_DIR, os.pardir, os.pardir)) 22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) assert(os.path.isdir(chromium_dir)), 'Cannot find chromium ' + chromium_dir 23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) sys.path += [ 25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) ROOT_DIR, 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) # Include all dependencies. 28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) os.path.join(chromium_dir, 'build', 'android'), # For pylib. 29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) ] 30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)_IncludeDeps()