forked from paulirish/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromium.sh
94 lines (74 loc) · 2.01 KB
/
chromium.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# usage:
# after `git pull`, a full build is now `depsbcr`
# and after changes.. a `bcr` will recompile and relaunch chrome.
function deps () {
# --reset drops local changes. often great, but if making changes inside v8, you don't want to use --reset
env GYP_DEFINES=disable_nacl=1 gclient sync --delete_unversioned_trees --reset
}
function hooks () {
env GYP_DEFINES=disable_nacl=1 gclient runhooks
}
function b () {
local dir=./$(git rev-parse --show-cdup)/out/Default
# autoninja will automatically determine your -j number based on CPU cores
local cmd="ninja -C $(realpath $dir) -j900 -l 60 chrome"
echo " > $cmd"
eval "$cmd"
if [ $? -eq 0 ]; then
printf "\n✅ Chrome build complete!\n"
fi
}
function dtb () {
local dir_default=$(grealpath $PWD/(git rev-parse --show-cdup)out/Default/)
local cmd="autoninja -C "$dir_default""
echo " > $cmd"
eval $cmd
}
# you can also add any extra args: `cr --user-data-dir=/tmp/lol123"
function cr () {
local dir=$(git rev-parse --show-cdup)/out/Default
local cmd="./$dir/Chromium.app/Contents/MacOS/Chromium $argv"
echo " > $cmd"
eval "$cmd"
}
function dtcr () {
local crpath="$HOME/chromium-devtools/devtools-frontend/third_party/chrome/chrome-mac/Chromium.app/Contents/MacOS/Chromium"
local dtpath=$(realpath out/Default/gen/front_end)
local cmd="$crpath --custom-devtools-frontend=file://$dtpath --user-data-dir=$HOME/chromium-devtools/dt-chrome-profile"
echo " > $cmd"
eval $cmd
}
function gom () {
# these probably dont make sense for everyone.
export GOMAMAILTO=/dev/null
export GOMA_ENABLE_REMOTE_LINK=yes
goma_ctl ensure_start
}
function dtbcr () {
if dtb; then
dtcr
fi
}
function bcr () {
if b; then
cr
fi
}
function depsb () {
if deps; then
gom
b
fi
}
function depsbcr () {
if deps; then
gom
bcr
fi
}
function hooksbcr () {
if hooks; then
gom
bcr
fi
}