-
Notifications
You must be signed in to change notification settings - Fork 37
Building VisibleV8 for Android
This is a step-by-step method for building VisibleV8 for Android from scratch. First step is to fetch the chromium code. The next step (optional) is to revert our codebase to an earlier version of chromium for which we wish to build VisibleV8. The final step is to apply the patch set and build the whole thing from scratch.
Fetch the code-base
-
Clone the depot_tools repository:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
-
Add
depot_tools
to the end of your PATH (you will probably want to put this in your~/.bashrc
or~/.zshrc
). Assuming you cloneddepot_tools
to/path/to/depot_tools
:export PATH="$PATH:/path/to/depot_tools"
-
Create a
chromium
directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces):mkdir ~/chromium && cd ~/chromium fetch --nohooks android
-
cd src
-
Install additional build dependencies:
build/install-build-deps-android.sh
-
gclient runhooks
-
In order to set up the build, first create ninja configuration files:
gn args out/Default
and then edit the file with the following configurations variablestarget_os = "android" target_cpu = "arm64" # See "Figuring out target_cpu" below
Reverting to chosen version of chromium
gclient sync --with_branch_heads --with_tags
git fetch
- We now checkout to the desired version. Make sure you know the branch code for the version you want to revert to. You can find it here:
git checkout -b branch_$BRANCH branch-heads/$BRANCH
gclient sync --with_branch_heads --with_tags
This concludes the second step for building chromium. We will now apply the patch set to our code base before building it.
Applying patch-set and building VisibleV8 for android
-
Find the patch-set that corresponds with the chromium version you have checked-out with. For the sake of simplification, I am going to assume that the branch code we are going to use is 4472. The patch-set for this version can be found here. But you can find the patch-sets here. Make sure you run the following command from
path/to/vv8/src/v8
:patch -p1 <$VV8/patches/c1e1dff6f551c4aab857/trace-apis.diff
-
Lastly, run the build command from
path/to/vv8/src/
:autoninja -C out/Default chrome_public_apk