OLD | NEW |
---|---|
1 Android | 1 Android |
2 ======= | 2 ======= |
3 | 3 |
4 Prerequisites | 4 Prerequisites |
5 ------------- | 5 ------------- |
6 | 6 |
7 _Currently we only support building Skia for Android on a Linux or Mac host! In addition, | 7 _Currently we only support building Skia for Android on a Linux or Mac host! In addition, |
8 we only use the Mac build for local development. All shipping variants are comp iled on | 8 we only use the Mac build for local development. All shipping variants are comp iled on |
9 Linux for performance reasons._ | 9 Linux for performance reasons._ |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 many other Android add-ons or APIs as you want, but you only are required to | 42 many other Android add-ons or APIs as you want, but you only are required to |
43 have this one in order to complete the Skia build process. | 43 have this one in order to complete the Skia build process. |
44 | 44 |
45 Setup Environment for Android | 45 Setup Environment for Android |
46 ----------------------------- | 46 ----------------------------- |
47 | 47 |
48 The Android build needs to set up some specific variables needed by both GYP | 48 The Android build needs to set up some specific variables needed by both GYP |
49 and Make. We make this setup easy for developers by encapsulating all the | 49 and Make. We make this setup easy for developers by encapsulating all the |
50 details into a custom script that acts as a replacement for make. | 50 details into a custom script that acts as a replacement for make. |
51 | 51 |
52 Syncing the Source | |
53 ----------------------------- | |
54 We use the gclient utility, provided by depot_tools, to sync both our git reposi tory | |
55 as well as any third-party dependencies. If you are an expert user you can setu p | |
56 a .gclient file on your own, but for everyone else it is recommended that you us e | |
57 `bin/sync-and-gyp` to create a .gclient file for the first time. | |
58 | |
59 After the initial setup you only need to run `gclient sync` to get the latest | |
60 sources. | |
61 | |
62 Further, we use the open-source gyp tool to generate build files from our | |
63 multi-platform "gyp" files. While most other platforms encourage you to | |
64 regenerate these files using `./gyp_skia` or `bin/sync-and-gyp` it is | |
65 recommended that you do NOT do this for Android. Instead you can rely | |
66 on it being run automatically by android_ninja. | |
scroggo
2016/04/25 19:02:05
It's weird that we have a different process here.
| |
67 | |
52 Custom Android Build Script | 68 Custom Android Build Script |
53 --------------------------- | 69 --------------------------- |
54 | 70 |
55 The android_ninja script is a wrapper for the ninja command (provided by | 71 The android_ninja script is a wrapper for the ninja command (provided by |
56 depot_tools) and is specifically designed to work with the Skia's build | 72 depot_tools) and is specifically designed to work with the Skia's build |
57 system. To use the script you need to call it from Skia's trunk directory with | 73 system. To use the script you need to call it from Skia's trunk directory with |
58 the -d option plus any of the options or arguments you would normally pass to | 74 the -d option plus any of the options or arguments you would normally pass to |
59 ninja (see descriptions of some of the other flags here). | 75 ninja (see descriptions of some of the other flags here). |
60 | 76 |
61 export ANDROID_SDK_ROOT=/path/to/android/sdk | 77 export ANDROID_SDK_ROOT=/path/to/android/sdk |
62 export ANDROID_HOME=/path/to/android/sdk | 78 export ANDROID_HOME=/path/to/android/sdk |
63 export PATH=$PATH:/path/to/depot_tools | 79 export PATH=$PATH:/path/to/depot_tools |
64 | 80 |
65 cd skia | 81 cd skia |
66 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_ nexus, etc... | 82 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_ nexus, etc... |
67 | 83 |
68 The -d option enables the build system to target the build to a specific | 84 The -d option enables the build system to target the build to a specific |
69 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device | 85 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device |
70 specific flavors for Nexus devices). This in turn allows Skia to take | 86 specific flavors for Nexus devices). This in turn allows Skia to take |
71 advantage of specific device optimizations (e.g. NEON instructions). | 87 advantage of specific device optimizations (e.g. NEON instructions). |
72 | 88 |
73 Generate build file from GYP | |
74 ---------------------------- | |
75 | |
76 We use the open-source gyp tool to generate build files from our | |
77 multi-platform "gyp" files. While most other platforms enable you to | |
78 regenerate these files using `./gyp_skia` or `bin/sync-and-gyp` it is | |
79 recommended that you do NOT do this for Android. Instead you can rely | |
80 on it being run automatically by android_ninja. | |
81 | |
82 Faster rebuilds | 89 Faster rebuilds |
83 --------------- | 90 --------------- |
84 | 91 |
85 You can use ccache to improve the speed of rebuilding: | 92 You can use ccache to improve the speed of rebuilding: |
86 | 93 |
87 # You may want to add this export to your shell's .bash_profile or .profile | 94 # You may want to add this export to your shell's .bash_profile or .profile |
88 export ANDROID_MAKE_CCACHE=[ccache] | 95 export ANDROID_MAKE_CCACHE=[ccache] |
89 | 96 |
90 Build and run executables on the device | 97 Build and run executables on the device |
91 --------------------------------------- | 98 --------------------------------------- |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 # COMMAND LINE APPS | 205 # COMMAND LINE APPS |
199 # include additional arguments in quotes (e.g. "dm --nopdf") | 206 # include additional arguments in quotes (e.g. "dm --nopdf") |
200 ./platform_tools/android/bin/android_gdb_native dm | 207 ./platform_tools/android/bin/android_gdb_native dm |
201 | 208 |
202 # SAMPLE APP | 209 # SAMPLE APP |
203 # make sure you've installed the app on the device first | 210 # make sure you've installed the app on the device first |
204 ./platform_tools/android/bin/android_gdb_app [-d device_id] | 211 ./platform_tools/android/bin/android_gdb_app [-d device_id] |
205 | 212 |
206 When the gdb client is ready, insert a breakpoint, and continue to let the | 213 When the gdb client is ready, insert a breakpoint, and continue to let the |
207 program resume execution. | 214 program resume execution. |
OLD | NEW |