最近发现 chromium 开源项目可以编译出来一个 shell 了,看来离 chrome for android 的正式开源的日期越来越近。
今天就整理一下如何下载源码、编译、运行
以下内容在 ubuntu 12.04 64-bit 上面实践,工作目录在 Public
获取源码
1. git 要安装的。
2. chromium 的源码管理使用了自定义的一组工具,先把它抓下来
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
3. Adddepot_tools
to
yourPATH:
-
$ export PATH="$PATH":
`pwd`/depot_tools
- You may want to add this to your
.bashrc
file or your shell's equivalent so that you don’t need to reset your $PATH manually each time you open a new shell.
Now tell git about yourself.
git config --global user.name "My Name"
git config --global user.email "my@email"
git config --global core.autocrlf false
git config --global core.filemode false
Initial checkout
First, have gclient create its configuration file.
gclient config https://chromium.googlesource.com/chromium/src.git --git-deps
源码中默认有很多内容是我们暂时不需要的,为了尽快完成获取源码,请按照以下步骤:
Edit your.gclientfile to avoid checking out the enormous set of WebKit layout tests (unless, of course, you need them).
Add to the "custom_deps" dictionary:
"src/third_party/WebKit/LayoutTests": None,
"src/content/test/data/layout_tests/LayoutTests": None,
Other things that are large and that you probably won't need that you can put there:
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome_frame/tools/test/reference_build/chrome_win": None,
"src/chrome/test/data/perf/third_party/octane": None,
"src/chrome/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
在最后面添加一行,来设定我们要获取能够编译android 版本。
target_os = ['android']
Checkout
you should avoid running gclient hooks when syncing for the first time, as the setup for these tools is not complete until build/android/envsetup.sh has been run.
gclient sync --nohooks
这一步要等比较久
. build/android/envsetup.sh
gclient runhooks
后面就可以准备开始编译了。
编译和运行结果看下一篇
http://blog.csdn.net/yajun0601/article/details/8583320
分享到:
相关推荐
chromium for android
chromium for android系列文章用图
源码参考,欢迎下载
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
Android Studio作为开发环境,从Chromium for Android从chrome模块源代码加入Android项目。 在Chrome环境中构建本机代码,因此将文件加入Android项目 在Chrome环境中将基本模块(基础,内容,网络等)构建到jar包中...
C# 使用chromium内核浏览器源码 When I hit a web site which I can not access because of a web filter, one of my options is to use the original Tor Browser which is a custom version of Firefox and I can...
谷歌浏览器安卓版源码项目,本项目是世界级的安卓架构。
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
断断续续下载chromium代码花了1周左右,代码约15G左右,其中遇到power shell的问题,遇到python的问题。最终编译花了11:30分。相比于Linux下的编译慢很多,系统运行的稳定性和速度也差很多。打算研究源码,一起分享...
chromium编译工具gn源码
安卓版Chromium的源码,适用于需要定制浏览器开发的场景,代码比较庞大,完整的Chromium浏览器内核。
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...
1. ./build/install-build-deps-android.sh 2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default ...