How to use get_deps_dir method in autotest

Best Python code snippet using autotest_python

builders.py

Source:builders.py Github

copy

Full Screen

1import os2from SCons.Script import Environment3def get_android_api(env):4 return env["android_api_level"] if int(env["android_api_level"]) > 28 else "28"5def get_deps_dir(env):6 return env.Dir("#deps").abspath7def get_deps_build_dir(env):8 return get_deps_dir(env) + "/build/build{}.{}.dir".format(env["suffix"], "RelWithDebInfo" if env["debug_symbols"] else "Release")9def get_rtc_source_dir(env):10 return get_deps_dir(env) + "/libdatachannel"11def get_rtc_build_dir(env):12 return get_deps_build_dir(env) + "/libdatachannel"13def get_rtc_include_dir(env):14 return get_rtc_source_dir(env) + "/include"15def get_ssl_source_dir(env):16 return get_deps_dir(env) + "/openssl"17def get_ssl_build_dir(env):18 return get_deps_build_dir(env) + "/openssl"19def get_ssl_install_dir(env):20 return get_ssl_build_dir(env) + "/dest"21def get_ssl_include_dir(env):22 return get_ssl_install_dir(env) + "/include"23def ssl_emitter(target, source, env):24 build_dir = get_ssl_build_dir(env)25 libs = ["libssl.a", "libcrypto.a"]26 install_dir = get_ssl_install_dir(env)27 ssl_include = os.path.join(source[0].abspath, "include")28 return [env.File(build_dir + "/" + l) for l in libs], source29def ssl_action(target, source, env):30 build_dir = get_ssl_build_dir(env)...

Full Screen

Full Screen

build.py

Source:build.py Github

copy

Full Screen

...69 if tag:70 return 'hg up -r "%s"' % tag71 else:72 return 'hg up'73def get_deps_dir(dependencies):74 deps_dir = dependencies.get('location')75 if not os.path.isabs(deps_dir):76 deps_dir = os.path.abspath(os.path.join(CURDIR, deps_dir))77 if not os.path.exists(deps_dir):78 os.mkdir(deps_dir)79 return deps_dir80def pull_app(package, dependencies):81 type, repo, branch, tag = dependencies.get('project')82 name = os.path.basename(repo).split('.')[0]83 update_cmd = _update_cmd("", type)84 print "updating %s with: %s" % (name, update_cmd)85 _run(update_cmd)86def pull_deps(dependencies):87 """Will make sure dependencies are up-to-date"""88 location = os.getcwd()89 # do we want the latest tags ?90 try:91 deps_dir = get_deps_dir(dependencies)92 for project in dependencies.get('projects', []):93 type, repo, branch, tag = project94 name = os.path.basename(repo).split('.')[0]95 target = os.path.join(deps_dir, name)96 if not os.path.exists(target):97 print "cloning ", name98 if type == 'git':99 _run('git clone %s %s' % (repo, target))100 else:101 _run('hg clone %s %s' % (repo, target))102 os.chdir(target)103 if type == 'git' and branch:104 print "checkout branch %s for %s" % (branch, name)105 _run('git checkout %s' % branch)106 update_cmd = _update_cmd(tag, type)107 print "updating %s with: %s" % (name, update_cmd)108 _run(update_cmd)109 finally:110 os.chdir(location)111def get_package(package):112 return json.load(open(package))113def get_dependencies(dependencies):114 return json.load(open(dependencies))115def pull_release(options, package, dependencies):116 project = dependencies.get('project', [])117 project[3] = options.reltag118 pull_app(package, dependencies)119 # update dependencies now120 dependencies = get_dependencies(options.dependencies)121 pull_deps(dependencies)122def tag_release(package, dependencies):123 rel_tag = "v%(version)s" % package124 if verify_tag(rel_tag):125 raise Exception("repository already tagged for release")126 location = os.getcwd()127 # get the current revision and branch we're working with, update128 # dependencies.json, then tag the repository we're in129 import copy130 old_deps = copy.copy(dependencies)131 try:132 deps_dir = get_deps_dir(dependencies)133 for project in dependencies.get('projects', []):134 type, repo, branch, tag = project135 name = os.path.basename(repo).split('.')[0]136 target = os.path.join(deps_dir, name)137 os.chdir(target)138 # tag the repo139 if type == 'git':140 # lightweight tags for dependency repos141 p = os.popen("git log --pretty=format:'%h' -n 1")142 project[3] = p.read()143 else:144 raise Exception("tagging not implemented for ", type)145 print "tagging %s with %s" % (name, project[3])146 print dependencies...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful