= Sync Source Code Hacking =
== 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/
You can view this online at https://hg.mozilla.org/services/services-central/file/tip/services/sync
All of This is just the core JavaScript APIs and logic. Additional Sync code executing for integration with Firefox lives in the : /browser lives /base/content Look for files with ''sync'' in their name. Files here define the integration between Firefox and Sync. This includes all the *modules* subdirectorySync UI.
== 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:
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 =