canmove, Confirmed users
409
edits
m (→Debugging Sync) |
m (create hacking section) |
||
Line 1: | Line 1: | ||
= | = Hacking = | ||
Once you have a copy of the Mozilla source tree (read below for how to obtain a copy), you can find the Sync source code in: | == Source Code == | ||
Once you have a copy of the Mozilla source tree (read below for how to obtain a copy), you can find the core Sync source code in: | |||
/services/sync/ | /services/sync/ | ||
Line 7: | Line 9: | ||
You can view this online at https://hg.mozilla.org/services/services-central/file/tip/services/sync | You can view this online at https://hg.mozilla.org/services/services-central/file/tip/services/sync | ||
This is just the core JavaScript APIs and logic. Additional Sync code for integration with Firefox lives in: | |||
/browser/base/content | |||
Look for files with ''sync'' in their name. Files here define the integration between Firefox and Sync. This includes all the Sync UI. | |||
= Debugging Sync = | == Debugging Sync == | ||
If you are debugging Sync in your browser, the first thing you want to do is crank up the logging. In about:config, set the following preferences: | If you are debugging Sync in your browser, the first thing you want to do is crank up the logging. In about:config, set the following preferences: | ||
Line 29: | Line 35: | ||
You can view full sync logs by opening '''about:sync-log''' in Firefox. | You can view full sync logs by opening '''about:sync-log''' in Firefox. | ||
== Building Sync == | |||
The party line to rebuild the tree after making changes is to run: | |||
$ make -f client.mk build | |||
or from the object directory: | |||
$ make | |||
However, this is slow. If you have simply changed a JS file in ''services/sync/'', it is sufficient to run the following from your object directory: | |||
$ make -C services/sync | |||
The xpcshell tests will pick up changes immediately. However, if you launch Firefox, your changes '''won't''' be reflected. For that, you'll also need to rebuild the browser component: | |||
$ make -C services/sync && make -C browser | |||
A handy alias to have around is: | |||
$ alias sync-launch make -C services/sync && make -C browser && dist/bin/firefox -no-remote -ProfileManager | |||
Or, on OS X: | |||
$ alias sync-launch make -C services/sync && make -C browser && dist/NightlyDebug.app/Contents/MacOS/ -no-remote -ProfileManager | |||
= Using Bugzilla = | = Using Bugzilla = |