Skip to content

Commit

Permalink
tests(compile): fix broken compile-devtools script (#5234)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 16, 2018
1 parent 691f8f8 commit 58ed286
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lighthouse-core/scripts/compile-against-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# usage
# yarn compile-devtools

set -x

# This the text here will override the renderer/ files in in the scripts[] array:
# https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/audits2/module.json#L20
Expand All @@ -21,10 +22,13 @@ files_to_include="\"lighthouse\/renderer\/util.js\", \"lighthouse\/renderer\/dom

# paths
local_script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
lhroot_path="$local_script_path/../../"
lhroot_path="$local_script_path/../.."
module_path="$lhroot_path/node_modules/lh-compile-devtools"

frontend_path="$lhroot_path/node_modules/temp-devtoolsfrontend"
protocol_path="$lhroot_path/node_modules/temp-devtoolsprotocol"
# extra deep frontend_path used because of the hardcoded os.pardir's here:
# https://github.com/ChromeDevTools/devtools-frontend/blob/157d472fd748/scripts/build/generate_protocol_externs.py#L39-L43
frontend_path="$module_path/two-more/almost-there/devtools-frontend"
protocol_path="$module_path/devtools-protocol"

# clone if they're not there
if [ ! -d "$frontend_path" ]; then
Expand All @@ -37,10 +41,15 @@ fi
# update to latest
cd "$frontend_path" && git reset --hard && git fetch origin master && git checkout --quiet --force origin/master
cd "$protocol_path" && git reset --hard && git fetch origin master && git checkout --quiet --force origin/master
# initialize the inspector_protocol submodule
git -C "$protocol_path" submodule update --init

# Copy it to location generate_protocol_externs.py will import the pdl module from
# https://github.com/ChromeDevTools/devtools-frontend/blob/157d472fd748/scripts/build/generate_protocol_externs.py#L39-L44
cp -fRp "$protocol_path/scripts/inspector_protocol" "$module_path"

cd "$lhroot_path" || exit 1

cd "$lhroot_path" || exit 1
# copy renderer and lh backgrond into this devtools checkout
yarn devtools "$frontend_path/front_end/"

Expand Down

0 comments on commit 58ed286

Please sign in to comment.