Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 Mojo | 1 Mojo |
| 2 ==== | 2 ==== |
| 3 | 3 |
| 4 Mojo is an effort to extract a common platform out of Chrome's renderer and plug in processes that can support multiple types of sandboxed content, such as HTML, Pepper, or NaCl. | 4 Mojo is an effort to extract a common platform out of Chrome's renderer and plug in processes that can support multiple types of sandboxed content, such as HTML, Pepper, or NaCl. |
| 5 | 5 |
| 6 ## Set up your environment | 6 ## Set up your environment |
| 7 | 7 |
| 8 The instructions below only need to be done once. Note that a simple "git clone" command is not sufficient to build the source code because this repo uses the g client command from depot_tools to manage most third party dependencies. | 8 The instructions below only need to be done once. Note that a simple "git clone" command is not sufficient to build the source code because this repo uses the g client command from depot_tools to manage most third party dependencies. |
| 9 | 9 |
| 10 1. Download depot_tools and make sure it is in your path:<br>http://www.chromium .org/developers/how-tos/install-depot-tools<br> | 10 1. Download depot_tools and make sure it is in your path:<br>http://www.chromium .org/developers/how-tos/install-depot-tools<br> |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 The "fetch mojo" command does the following: | 24 The "fetch mojo" command does the following: |
| 25 - creates a directory called 'src' under your checkout directory | 25 - creates a directory called 'src' under your checkout directory |
| 26 - clones the repository using git clone | 26 - clones the repository using git clone |
| 27 - clones dependencies with gclient sync | 27 - clones dependencies with gclient sync |
| 28 | 28 |
| 29 `install-build-deps.sh` installs any packages needed to build, then `mojo/tools/ mojob.py gn` runs `gn args` and configures the build directory, out/Debug. | 29 `install-build-deps.sh` installs any packages needed to build, then `mojo/tools/ mojob.py gn` runs `gn args` and configures the build directory, out/Debug. |
| 30 | 30 |
| 31 If the fetch command fails, you will need to delete the src directory and start over. | 31 If the fetch command fails, you will need to delete the src directory and start over. |
| 32 | 32 |
| 33 ## Build Mojo | 33 ## <a name="buildmojo"></a>Build Mojo |
| 34 | 34 |
| 35 Build Mojo by running: | 35 Build Mojo for Linux by running: |
| 36 | 36 |
| 37 ``` | 37 ``` |
| 38 $ ninja -C out/Debug -j 10 | 38 $ ninja -C out/Debug -j 10 |
|
jamesr
2015/02/13 22:27:22
can you update this too?
jimbe
2015/02/14 00:44:50
I'm happy to update it, but can you clarify what y
| |
| 39 ``` | 39 ``` |
| 40 | 40 |
| 41 (If you are a Googler, see the section at the end of this document for faster bu ilds.) | 41 (If you are a Googler, see the section at the end of this document for faster bu ilds.) |
| 42 | 42 |
| 43 You can also use the mojob.py script for building. This script automatically cal ls ninja and sets -j to an appropriate value based on whether Goma is present. Y ou cannot specify a target name with this script. | 43 You can also use the mojob.py script for building. This script automatically cal ls ninja and sets -j to an appropriate value based on whether Goma is present. Y ou cannot specify a target name with this script. |
| 44 ``` | 44 ``` |
| 45 mojo/tools/mojob.py build | 45 mojo/tools/mojob.py build |
| 46 ``` | 46 ``` |
| 47 | 47 |
| 48 Run a demo: | 48 Run a demo: |
| 49 ``` | 49 ``` |
| 50 mojo/tools/mojo_demo.py --browser | 50 mojo/tools/mojo_demo.py --browser |
| 51 ``` | 51 ``` |
| 52 | 52 |
| 53 Run the tests: | 53 Run the tests: |
| 54 ``` | 54 ``` |
| 55 mojo/tools/mojob.py test | 55 mojo/tools/mojob.py test |
| 56 ``` | 56 ``` |
| 57 | 57 |
| 58 Create a release build: | |
| 59 ``` | |
| 60 mojo/tools/mojob.py gn --release | |
| 61 mojo/tools/mojob.py build --release | |
| 62 mojo/tools/mojob.py test --release | |
| 63 ``` | |
| 64 | |
| 58 ## Update your repo | 65 ## Update your repo |
| 59 | 66 |
| 60 You can update your repo like this: | 67 You can update your repo like this: |
| 61 ``` | 68 ``` |
| 62 $ git pull --rebase | 69 $ git pull --rebase |
| 63 (fetch changes from upstream and rebase the current branch on top) | 70 (fetch changes from upstream and rebase the current branch on top) |
| 64 $ gclient sync | 71 $ gclient sync |
| 65 (update all modules as directed by the DEPS file) | 72 (update all modules as directed by the DEPS file) |
| 66 ``` | 73 ``` |
| 67 | 74 |
| 68 You do not need to rerun "gn gen out/Debug". Ninja will do so automatically as n eeded. | 75 You do not need to rerun `gn gen out/Debug` or `mojo/tools/mojob.py gn`. Ninja w ill do so automatically as needed. |
| 69 | 76 |
| 70 ## Contribute | 77 ## Contribute |
| 71 | 78 |
| 72 With git you should make all your changes in a local branch. Once your change is committed, you can delete this branch. | 79 With git you should make all your changes in a local branch. Once your change is committed, you can delete this branch. |
| 73 | 80 |
| 74 Create a local branch named "mywork" and make changes to it. | 81 Create a local branch named "mywork" and make changes to it. |
| 75 ``` | 82 ``` |
| 76 cd src | 83 cd src |
| 77 git new-branch mywork | 84 git new-branch mywork |
| 78 vi ... | 85 vi ... |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 | 123 |
| 117 Pull down all of the packages with this command: | 124 Pull down all of the packages with this command: |
| 118 | 125 |
| 119 ``` | 126 ``` |
| 120 $ gclient sync | 127 $ gclient sync |
| 121 ``` | 128 ``` |
| 122 | 129 |
| 123 Prepare the build directory for Android: | 130 Prepare the build directory for Android: |
| 124 | 131 |
| 125 ``` | 132 ``` |
| 126 $ src/mojo/tools/mojob.py gn --android | 133 $ mojo/tools/mojob.py gn --android |
| 127 ``` | 134 ``` |
| 128 | 135 |
| 129 Finally, perform the build. The result will be in out/android_Debug: | 136 Finally, perform the build. The result will be in out/android_Debug: |
| 130 | 137 |
| 131 ``` | 138 ``` |
| 132 $ src/mojo/tools/mojob.py build --android | 139 $ mojo/tools/mojob.py build --android |
| 133 ``` | 140 ``` |
| 134 | 141 |
| 135 If you see javac compile errors, make sure you have an up-to-date JDK: | 142 If you see javac compile errors, make sure you have an up-to-date JDK: |
| 136 https://code.google.com/p/chromium/wiki/AndroidBuildInstructions#Install_Java_JD K | 143 https://code.google.com/p/chromium/wiki/AndroidBuildInstructions#Install_Java_JD K |
| 137 | 144 |
| 138 ## Googlers | 145 ## Googlers |
| 139 | 146 |
| 140 If you're a Googler, you can use Goma, a distributed compiler service for open-s ource projects such as Chrome and Android. The instructions below assume that Go ma is installed in the default location (~/goma). | 147 If you're a Googler, you can use Goma, a distributed compiler service for open-s ource projects such as Chrome and Android. The instructions below assume that Go ma is installed in the default location (~/goma). |
| 141 | 148 |
| 142 To enable Goma, update your "args.gn" file. Open the file in your editor with th is command: | 149 To enable Goma, update your "args.gn" file. Open the file in your editor with th is command: |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 163 0. Prerequisites: | 170 0. Prerequisites: |
| 164 * Before you start, you'll need a device with an unlocked bootloader, otherw ise you won't be able to run adb root (or any of the commands that require root) . For Googlers, <a href="http://go/mojo-internal-build-instructions">follow this link</a> and follow the instructions before returning to this page. | 171 * Before you start, you'll need a device with an unlocked bootloader, otherw ise you won't be able to run adb root (or any of the commands that require root) . For Googlers, <a href="http://go/mojo-internal-build-instructions">follow this link</a> and follow the instructions before returning to this page. |
| 165 * Ensure your device is running Lollipop and has an userdebug build. | 172 * Ensure your device is running Lollipop and has an userdebug build. |
| 166 * Set up environment for building on Android. This sets up the adb path, etc . You may need to remove /usr/bin/adb. | 173 * Set up environment for building on Android. This sets up the adb path, etc . You may need to remove /usr/bin/adb. |
| 167 ``` | 174 ``` |
| 168 source build/android/envsetup.sh | 175 source build/android/envsetup.sh |
| 169 ``` | 176 ``` |
| 170 | 177 |
| 171 1. Build changed files: | 178 1. Build changed files: |
| 172 ``` | 179 ``` |
| 173 mojob.py build --android | 180 mojo/tools/mojob.py build --android |
| 174 ``` | 181 ``` |
| 175 | 182 |
| 176 2. Push mojo_shell to to your device: | 183 2. Push mojo_shell to to your device: |
| 177 ``` | 184 ``` |
| 178 adb install -r out/android_Debug/apks/MojoShell.apk | 185 adb install -r out/android_Debug/apks/MojoShell.apk |
| 179 ``` | 186 ``` |
| 180 | 187 |
| 181 3. Run Mojo Shell on the device: | 188 3. Run Mojo Shell on the device: |
| 182 ``` | 189 ``` |
| 183 ./mojo/tools/android_mojo_shell.py mojo:sample_app | 190 mojo/tools/android_mojo_shell.py mojo:sample_app |
| 184 ``` | 191 ``` |
| 185 | 192 |
| 186 4. If you get a crash you won't see symbols. Use tools/android_stack_parser/stac k to map back to symbols, e.g.: | 193 4. If you get a crash you won't see symbols. Use tools/android_stack_parser/stac k to map back to symbols, e.g.: |
| 187 ``` | 194 ``` |
| 188 adb logcat | ./tools/android_stack_parser/stack | 195 adb logcat | ./tools/android_stack_parser/stack |
| 189 ``` | 196 ``` |
| 190 | 197 |
| 191 ### On Linux | 198 ### On Linux |
| 192 | 199 |
| 193 1. Build the mojo target, which builds the shell and all examples: | 200 1. Build the mojo target as described under [link](#buildmojo). |
| 194 ``` | |
| 195 ninja -C out/Release mojo | |
| 196 ``` | |
| 197 | 201 |
| 198 2. Run Mojo Shell: | 202 2. Run Mojo Shell: |
| 199 ``` | 203 ``` |
| 200 ./out/Release/mojo_shell mojo:sample_app | 204 ./out/Debug/mojo_shell mojo:sample_app |
| 201 ``` | 205 ``` |
| 202 | 206 |
| 203 3. Optional: Run Mojo Shell with an HTTP server | 207 3. Optional: Run Mojo Shell with an HTTP server |
| 204 ``` | 208 ``` |
| 205 cd out/Release | 209 cd out/Debug |
| 206 python -m SimpleHTTPServer 4444 & | 210 python -m SimpleHTTPServer 4444 & |
| 207 ./mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:mojo_sample _app | 211 ./mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:mojo_sample _app |
| 208 ``` | 212 ``` |
| OLD | NEW |