Change structure of deps file and tool for adding chromium dep.

Change structure of chromium owned dependencies file to JSON to
simplify work with it in different tools. Also add tool to check in
new chromium owned dep with single command like this:
./tools_webrtc/autoroller/checkin_chromium_dep.py -d <dep name>

Introduce separate file with list of webrtc owned dependencies.



Bug: webrtc:8366
Change-Id: I30a828af34cd105ce7e6bc76d6b5889e6bf7574d
Reviewed-on: https://webrtc-review.googlesource.com/76840
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23270}
This commit is contained in:
Artem Titov
2018-05-17 10:00:20 +02:00
committed by Commit Bot
parent ff1de0af6b
commit c47c9c0234
17 changed files with 490 additions and 126 deletions

View File

@ -12,6 +12,7 @@
import argparse
import base64
import collections
import json
import logging
import os
import re
@ -414,12 +415,9 @@ def UpdateDepsFile(deps_filename, rev_update, changed_deps):
def _LoadThirdPartyDepsAndFiles(filename):
third_party_deps = {}
with open(filename, 'rb') as f:
deps_content = f.read()
global_scope = {}
exec (deps_content, global_scope, third_party_deps)
return third_party_deps.get('DEPS', [])
data = json.load(f)
return data.get('dependencies', [])
def UpdateThirdPartyDeps(new_rev, dest_dir, source_dir,
@ -613,10 +611,12 @@ def main():
logging.debug('Commit message:\n%s', commit_msg)
_CreateRollBranch(opts.dry_run)
third_party_chromium_deps_list = os.path.join(
CHECKOUT_SRC_DIR, 'THIRD_PARTY_CHROMIUM_DEPS.json')
UpdateThirdPartyDeps(rev_update.new_third_party_rev,
os.path.join(CHECKOUT_SRC_DIR, 'third_party'),
cr_3p_repo,
os.path.join(CHECKOUT_SRC_DIR, 'THIRD_PARTY_DEPS'))
third_party_chromium_deps_list)
UpdateDepsFile(deps_filename, rev_update, changed_deps)
if _IsTreeClean():
logging.info("No DEPS changes detected, skipping CL creation.")