mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 13:13:37 +08:00
This reverts commit 402078e2f9.
Reason for revert: run_localization_check.py breaks the PRESUBMIT for any CLs which contain json files, i.e. module.json.
Original change's description:
> Adding run_localization_check.py
>
> It will run the two localization verifications:
> - It will tell if the resource files are formatted in the correct way
> - It ill tell if any localizable resource in the code is present with the
> appropiate attributes in the resource files.
>
> This two verifications already run as part of the presubmit verifications,
> I did some refactoring to allow them to be run from an external script.
>
> Change-Id: I340e5dcfdeef7331a757adf27cef94e22302cf10
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1894913
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
TBR=lomitch@microsoft.com,vidorteg@microsoft.com
Change-Id: I0f2dfa1e071a0302414cf38ccbdf86ca772b3ec1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1926496
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
76 lines
2.1 KiB
Python
76 lines
2.1 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 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')
|