Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: README.md

Issue 1160563003: Reformat README.md. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: README.md
diff --git a/README.md b/README.md
index bec58a54d5df8c59ca587b435d45b938a475f87e..99daeb49601a29668409f00106210ea5460809e1 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,22 @@
Mojo
====
-Mojo is an effort to extract a common platform out of Chrome's renderer and plugin processes that can support multiple types of sandboxed content, such as HTML, Pepper, or NaCl.
+Mojo is an effort to extract a common platform out of Chrome's renderer and
+plugin processes that can support multiple types of sandboxed content, such as
+HTML, Pepper, or NaCl.
## Set up your environment
-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 gclient command from depot_tools to manage most third party dependencies.
-
-1. Download depot_tools and make sure it is in your path:<br>http://www.chromium.org/developers/how-tos/install-depot-tools<br>
+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
+gclient command from depot_tools to manage most third party dependencies.
+1. [Download
+ depot_tools](http://www.chromium.org/developers/how-tos/install-depot-tools)
+ and make sure it is in your path.
2. [Googlers only] Install Goma in ~/goma.
-
-3. Create a directory somewhere for your checkout (preferably on an SSD), cd into it, and run the following commands:
+3. Create a directory somewhere for your checkout (preferably on an SSD), cd
+ into it, and run the following commands:
```
@@ -29,9 +34,12 @@ The "fetch mojo" command does the following:
- clones the repository using git clone
- clones dependencies with gclient sync
-`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.
+`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.
-If the fetch command fails, you will need to delete the src directory and start over.
+If the fetch command fails, you will need to delete the src directory and start
+over.
## <a name="buildmojo"></a>Build Mojo
@@ -41,9 +49,12 @@ Build Mojo for Linux by running:
$ ninja -C out/Debug -j 10
```
-(If you are a Googler, see the section at the end of this document for faster builds.)
+(If you are a Googler, see the section at the end of this document for faster
+builds.)
-You can also use the mojob.py script for building. This script automatically calls ninja and sets -j to an appropriate value based on whether Goma is present. You cannot specify a target name with this script.
+You can also use the mojob.py script for building. This script automatically
+calls ninja and sets -j to an appropriate value based on whether Goma is
+present. You cannot specify a target name with this script.
```
mojo/tools/mojob.py build
```
@@ -67,19 +78,22 @@ mojo/tools/mojob.py test --release
## Update your repo
-You can update your repo like this. The order is important. You must do the `git pull` first because `gclient sync` is dependent on the current revision.
-```YOu
+You can update your repo like this. The order is important. You must do the `git
+pull` first because `gclient sync` is dependent on the current revision.
+```
# Fetch changes from upstream and rebase the current branch on top
$ git pull --rebase
# Update all modules as directed by the DEPS file
$ gclient sync
```
-You do not need to rerun `gn gen out/Debug` or `mojo/tools/mojob.py gn`. Ninja will do so automatically as needed.
+You do not need to rerun `gn gen out/Debug` or `mojo/tools/mojob.py gn`. Ninja
+will do so automatically as needed.
## Contribute
-With git you should make all your changes in a local branch. Once your change is committed, you can delete this branch.
+With git you should make all your changes in a local branch. Once your change is
+committed, you can delete this branch.
Create a local branch named "mywork" and make changes to it.
```
@@ -87,38 +101,48 @@ Create a local branch named "mywork" and make changes to it.
git new-branch mywork
vi ...
```
-Commit your change locally (this doesn't commit your change to the SVN or Git server)
+Commit your change locally. (this doesn't commit your change to the SVN or Git
+server)
```
git commit -a
```
-Fix your source code formatting
+Fix your source code formatting.
```
$ git cl format
```
-Upload your change for review
+Upload your change for review.
```
$ git cl upload
```
-Respond to review comments
+Respond to review comments.
-See <a href="http://www.chromium.org/developers/contributing-code">Contributing code</a> for more detailed git instructions, including how to update your CL when you get review comments. There's a short tutorial that might be helpful to try before your first change: <a href="http://dev.chromium.org/developers/cpp-in-chromium-101-codelab">C++ in Chromium 101</a>.
+See [Contributing code](http://www.chromium.org/developers/contributing-code)
+for more detailed git instructions, including how to update your CL when you get
+review comments. There's a short tutorial that might be helpful to try before
+making your first change: [C++ in Chromium
+101](http://dev.chromium.org/developers/cpp-in-chromium-101-codelab).
To land a change after receiving LGTM:
```
$ git cl land
```
-Don't break the build! Waterfall is here: http://build.chromium.org/p/client.mojo/waterfall
+Don't break the build! Waterfall is here:
+http://build.chromium.org/p/client.mojo/waterfall
## Android Builds
-To build for Android, first make sure you've downloaded build support for Android, which you would have done by adding --target_os=android when you ran `fetch mojo`. If you didn't do that, there's an easy fix. Edit the file .gclient in your root Mojo directory (the parent directory to src.) Add this line at the end of the file:
+To build for Android, first make sure you've downloaded build support for
+Android, which you would have done by adding `--target_os=android` when you ran
+`fetch mojo`. If you didn't do that, there's an easy fix. Edit the file .gclient
+in your root Mojo directory (the parent directory to src.) Add this line at the
+end of the file:
```
target_os = [u'android']
@@ -152,7 +176,9 @@ https://code.google.com/p/chromium/wiki/AndroidBuildInstructions#Install_Java_JD
## Dart Code
-Because the dart analyzer is a bit slow, we don't run it unless the user specifically asks for it. To run the dart analyzer against the list of dart targets in the toplevel BUILD.gn file, run:
+Because the dart analyzer is a bit slow, we don't run it unless the user
+specifically asks for it. To run the dart analyzer against the list of dart
+targets in the toplevel BUILD.gn file, run:
```
$ mojo/tools/mojob.py dartcheck
@@ -160,9 +186,12 @@ $ mojo/tools/mojob.py dartcheck
## Googlers
-If you're a Googler, you can use Goma, a distributed compiler service for open-source projects such as Chrome and Android. The instructions below assume that Goma is installed in the default location (~/goma).
+If you're a Googler, you can use Goma, a distributed compiler service for
+open-source projects such as Chrome and Android. The instructions below assume
+that Goma is installed in the default location (~/goma).
-To enable Goma, update your "args.gn" file. Open the file in your editor with this command:
+To enable Goma, update your "args.gn" file. Open the file in your editor with
+this command:
```
$ gn args out/Debug
```
@@ -172,7 +201,8 @@ Add this line to the end of the file:
use_goma = true
```
-After you close the editor, the "gn args" command will automatically run "gn gen out/Debug" again.
+After you close the editor, the `gn args` command will automatically run `gn gen
+out/Debug`` again.
Now you can dramatically increase the number of parallel tasks:
```
@@ -184,46 +214,64 @@ $ ninja -C out/Debug -j 1000
### On Android
0. Prerequisites:
- * Before you start, you'll need a device with an unlocked bootloader, otherwise 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.
- * Ensure your device is running Lollipop and has an userdebug build.
- * Set up environment for building on Android. This sets up the adb path, etc. You may need to remove /usr/bin/adb.
- ```
- source build/android/envsetup.sh
- ```
+
+* Before you start, you'll need a device with an unlocked bootloader,
+ otherwise you won't be able to run adb root (or any of the commands that
+ require root). For Googlers, [follow this
+ link](http://go/mojo-internal-build-instructions) and follow the
+ instructions before returning to this page.
+* Ensure your device is running Lollipop and has an userdebug build.
+* Set up environment for building on Android. This sets up the adb path,
+ etc. You may need to remove /usr/bin/adb.
+
+```
+source build/android/envsetup.sh
+```
1. Build changed files:
- ```
- mojo/tools/mojob.py build --android
- ```
-
-2. Run Mojo Shell on the device (this will also push the built apk to the device):
- ```
- mojo/tools/mojo_shell.py --android mojo:spinning_cube
- ```
+
+```
+mojo/tools/mojob.py build --android
+```
+
+2. Run Mojo Shell on the device (this will also push the built apk to the
+ device):
+
+```
+mojo/tools/mojo_shell.py --android mojo:spinning_cube
+```
+
If this fails and prints:
- ```
- error: closed
- error: closed
- ```
-... then you may not have a new enough build of Android on your device. You need L (Lollipop) or later.
-3. If you get a crash you won't see symbols. Use tools/android_stack_parser/stack to map back to symbols, e.g.:
- ```
- adb logcat | ./tools/android_stack_parser/stack
- ```
+```
+error: closed
+error: closed
+```
+
+... then you may not have a new enough build of Android on your device. You need
+L (Lollipop) or later.
+
+3. If you get a crash you won't see symbols. Use
+ tools/android_stack_parser/stack to map back to symbols, e.g.:
+
+```
+adb logcat | ./tools/android_stack_parser/stack
+```
### On Linux
1. Build the mojo target as described under [link](#buildmojo).
2. Run Mojo Shell:
- ```
- ./out/Debug/mojo_shell mojo:spinning_cube
- ```
+
+```
+./out/Debug/mojo_shell mojo:spinning_cube
+```
3. Optional: Run Mojo Shell with an HTTP server
- ```
- cd out/Debug
- python -m SimpleHTTPServer 4444 &
- ./mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:spinning_cube
- ```
+
+```
+cd out/Debug
+python -m SimpleHTTPServer 4444 &
+./mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:spinning_cube
+```
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698