-
Notifications
You must be signed in to change notification settings - Fork 113
ContributingCode
(legacy summary: How to contribute code to Caja)
Use the following directory structure for your changes:
svn-changes
|
+----my-change-1
| |
| +----google-caja
| |
| +----src
|
+----my-change-2
|
+----google-caja
|
+----src
In this way, the myvn script you will use for creating and submitting changelists can provide a changelist name for you for common commands. For example, myvn change
will behave like gvn change -c my-change-1
if run under svn-changes/my-change-1/google-caja
as will other gvn commands like mail
, describe
and snapshot
unless a changelist name is explicitly provided.
- Create a client directory
$ mkdir -p svn-changes/my-change-name
- Checkout the src
$ cd svn-changes/my-change-name
$ myvn checkout
$ cd google-caja/
- Muck around with some source files
See Eclipse steps below
- Prepare a changelist
$ myvn change
Should pop up an editor. Check the
EDITOR
, orSVNEDITOR
environment variables if it doesn't. This is a purely local operation.
- Send it off for review
$ myvn mail
This will upload to codereview.appspot.com, send mail to the reviewers specified using
myvn change
, and automatically CC google-caja-discuss (or, if the change's Private flag is set, then it will instead be CC'd to caja-discuss-undisclosed and the core Caja team).
- Update your changes based on feedback and snapshot for review
$ myvn snapshot
- Maybe add or remove files
$ myvn change
- Commit the change
$ myvn submit
This will also cause your change to be tested before submission. You'll need a recent Firefox to run the tests.
Submitting a change places it in the public repository regardless of whether the Private flag is set. Security patches should not be submitted until they are to be publicly disclosed.
- Show the change description
$ myvn describe
- Delete the change branch
$ myvn reset
- Generate the project
$ myvn eclipse
- Open Eclipse
- Choose New Java Project
- From Existing Source
- Enter the .../svn-changes/my-change-1/google-caja/ path
- Finish
- Build some stuff
$ ant
- Test stuff
Right click on project and select "Run As" > "JUnit Test"
$ ant runtests
-
changed
- files changed in the snapshotted CL. Pipeable to xargs -
diffstats
- number of lines added/changed/removed -
files
- files changed in svn. Pipeable to xargs -
filetypes
- setssvn:mime-type
of modified files based on file suffix
See also the Contributor Licence Agreement (either the individual CLA or the corporate CLA).