Files
react-native-devtools-frontend/scripts/devtools_paths.py
T
Andrey Kosyakov fff69a79f9 Reland "Update roll & type check scripts with new browser_protocol.pdl location"
This reverts commit db38f98828.

Reason for revert: re-landing as upstream change appears to stick this time.

Original change's description:
> Revert "Update roll & type check scripts with new browser_protocol.pdl location"
> 
> This reverts commit a4d8446198.
> 
> Reason for revert: Upstream change that this depends on got reverted: https://chromium-review.googlesource.com/c/chromium/src/+/1935479
> 
> Original change's description:
> > Update roll & type check scripts with new browser_protocol.pdl location
> > 
> > This is a follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/1898538
> > to update the location of the browser_protocol.pdl.
> > 
> > NOPRESUBMIT=true
> > Bug: https://crbug.com/1018108
> > Change-Id: Id21b5bc65d6af472b55151a458beca34dabc6d1d
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1904098
> > Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> 
> TBR=caseq@chromium.org,yangguo@chromium.org
> 
> Change-Id: I276ca14aa57ed6dcfd76946c8bee9ea580643b6b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://crbug.com/1018108
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1936211
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>

TBR=caseq@chromium.org,yangguo@chromium.org

Change-Id: Icb1d908317514f15a80fb8edc84974045309487e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://crbug.com/1018108
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1938351
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
2019-11-27 01:32:58 +00:00

87 lines
2.5 KiB
Python

# Copyright 2019 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.
"""
Helper to find the path to the correct third_party directory
"""
from os import path
import sys
# Find the root path of the checkout.
# In the Chromium repository, this is the src/chromium directory.
# In the external repository, standalone build, this is the devtools-frontend directory.
# In the external repository, integrated build, this is the src/chromium directory.
def root_path():
SCRIPTS_PATH = path.dirname(path.abspath(__file__))
ABS_DEVTOOLS_PATH = path.dirname(SCRIPTS_PATH)
PARENT_PATH = path.dirname(ABS_DEVTOOLS_PATH)
# TODO(1011259): remove Chromium repository handling
if path.basename(PARENT_PATH) == 'renderer':
# Chromium repository
return path.dirname(path.dirname(path.dirname(PARENT_PATH)))
elif path.basename(PARENT_PATH) == 'devtools-frontend':
# External repository, integrated build
return path.dirname(path.dirname(PARENT_PATH))
else:
# External repository, standalone build
return ABS_DEVTOOLS_PATH
# This is the third_party path relative to the root of the checkout.
def third_party_path():
return path.join(root_path(), 'third_party')
# This points to the node binary downloaded as part of the checkout.
def node_path():
try:
old_sys_path = sys.path[:]
sys.path.append(path.join(third_party_path(), 'node'))
import node
finally:
sys.path = old_sys_path
return node.GetBinaryPath()
def devtools_root_path():
return path.dirname((path.dirname(path.abspath(__file__))))
def node_modules_path():
return path.join(devtools_root_path(), 'node_modules')
def eslint_path():
return path.join(node_modules_path(), 'eslint', 'bin', 'eslint.js')
def check_localizable_resources_path():
return path.join(devtools_root_path(), 'scripts', 'check_localizable_resources.js')
def check_localized_strings_path():
return path.join(devtools_root_path(), 'scripts', 'check_localizability.js')
def karma_path():
return path.join(node_modules_path(), 'karma', 'bin', 'karma')
def rollup_path():
return path.join(
node_modules_path(),
'rollup',
'dist',
'bin',
'rollup',
)
def package_json_path():
return path.join(devtools_root_path(), 'package.json')
def browser_protocol_path():
return path.join(third_party_path(), 'blink', 'public', 'devtools_protocol', 'browser_protocol.pdl')