73
edits
m (fixing URLs) |
(outdated info correction) |
||
(17 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
'''Note: these instructions cover development through current versions of Ubiquity, including versions 0.5.x.''' | |||
If you just want to write new commands for Ubiquity, you should read [https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial the Command Author Tutorial] instead. This page is about how to do development on the Ubiquity core. | If you just want to write new commands for Ubiquity, you should read [https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial the Command Author Tutorial] instead. This page is about how to do development on the Ubiquity core. | ||
Line 5: | Line 7: | ||
== Getting the Source == | == Getting the Source == | ||
It is pretty easy to get involved with the development of Ubiquity. Start off by introducing yourself on the irc channel #ubiquity on [http://irc.mozilla.org/ irc.mozilla.org]. | It is pretty easy to get involved with the development of Ubiquity. Start off by introducing yourself on the irc channel [irc://irc.mozilla.org/ubiquity #ubiquity] on [http://irc.mozilla.org/ irc.mozilla.org]. | ||
You will need to have [http://www.python.org Python] installed, preferably Python 2.5. (If you are on Mac OS X, you have Python already.) We use Python instead of Make for our build script. | You will need to have [http://www.python.org Python] installed, preferably Python 2.5. (If you are on Mac OS X, you have Python already.) We use Python instead of Make for our build script. | ||
Line 17: | Line 19: | ||
Once installed, you will be able to checkout the current source using the command: | Once installed, you will be able to checkout the current source using the command: | ||
hg clone | hg clone https://ubiquity.mozilla.com/hg/ubiquity-firefox | ||
This will put a copy of the Ubiquity source into the home directory on your computer. You need execute all the hg commands below from inside that directory. | |||
== Installing the Source Version of the Extension == | == Installing the Source Version of the Extension == | ||
Line 23: | Line 27: | ||
Uninstall your current version of Ubiquity from your Firefox Addons and then run: | Uninstall your current version of Ubiquity from your Firefox Addons and then run: | ||
python manage.py install | python manage.py install --profile=<profile name> | ||
(Replace <profile name> with the name of the profile into which you prefer to install the extension.) | |||
If you | If you haven't created any profiles, then the profile you are using is called 'default'. To install Ubiquity into the default profile, do this: | ||
python manage.py install | python manage.py install --profile=default | ||
This will generate a new build of the Ubiquity extension from the source checkout and install it with your local Firefox instance. | |||
Now you are all set to become a pro Ubiquity hacker! | Now you are all set to become a pro Ubiquity hacker! | ||
Line 44: | Line 48: | ||
== Building an XPI == | == Building an XPI == | ||
You generally won't need to build an XPI when doing development, unless you're working on a final version intended for release to end-users. | |||
To build an XPI for Ubiquity, just run: | To build an XPI for Ubiquity, just run: | ||
python manage.py | python manage.py xpi | ||
This will create an XPI with the name "ubiquity-<version>.xpi", where | This will create an XPI with the name "ubiquity-<version>.xpi", where | ||
Line 53: | Line 59: | ||
"ubiquity/install.rdf" file. | "ubiquity/install.rdf" file. | ||
= Development = | |||
If you want to start writing code for Ubiquity, you <b>need</b> to follow the [http://developer.mozilla.org/en/JavaScript_style_guide Mozilla's Javascript style guide] (especially with respect to indentation and variable naming). This helps to maintain consistency in Ubiquity's code. | |||
(TODO: find a style guide for HTML + CSS) | |||
The heart of the code can be found in the | The heart of the code can be found in the subdirectories: | ||
ubiquity/modules/ | |||
ubiquity/chrome/content/ | ubiquity/chrome/content/ | ||
To get started, you may want to first take a look at the built-in commands | To get started, you may want to first take a look at the built-in and standard commands, which are in the files: | ||
ubiquity/ | ubiquity/builtin-feeds/builtincmds.js | ||
ubiquity/ | ubiquity/standard-feeds/*.js | ||
ubiquity/standard-feeds/*.xhtml | |||
The feeds are dynamically loaded, so if you make any changes to them, all you have to do is save the file, then go back to Firefox and bring up Ubiquity again. Your changes will be reflected immediately. There's no need to rebuild your extension or restart Firefox. | |||
If you make changes to other files -- parts of the core | If you make changes to other files -- parts of the core such as the parser or built-in nountypes, that are not dynamically loaded -- you will have to restart Firefox. Even in this case, there is no need for you to keep on rebuilding your extension. Once you've run python manage.py for the first time to install the extension, as described above, you shouldn't need to run it again. Just save the source file and restart Firefox and whatever changes you've made will be reflected in Ubiquity. | ||
== Don't Forget to Test == | == Don't Forget to Test == | ||
Line 91: | Line 101: | ||
hg update | hg update | ||
You can also view the latest changes to the central repository on the web at [ | You can also view the latest changes to the central repository on the web at [https://ubiquity.mozilla.com/hg/ubiquity-firefox/ ubiquity.mozilla.com]. | ||
== Finding Something to Work On == | == Finding Something to Work On == | ||
We use | We use [http://wiki.mozilla.org/index.php?Ubiquity this Wiki] and [http://getsatisfaction.com/mozilla/products/mozilla_ubiquity GetSatisfaction] as places to get feature requests and bug reports. These feed into an internal Trac-based [https://ubiquity.mozilla.com/trac/report/1 ticketing system]. | ||
Login to [https://ubiquity.mozilla.com/trac/report/1 the Trac] using an OpenID account. Look for unassigned tickets (these are the ones that say "New" in the status column as opposed to "Assigned"). You can also search for the keyword "[http://ubiquity.mozilla.com/trac/search?q=good-for-beginners good-for-beginners]". Check out what needs to be done, add things appropriately, choose unassigned tickets and start hacking! | |||
== Submitting Patches == | == Submitting Patches == | ||
Line 105: | Line 114: | ||
hg diff > filename.diff | hg diff > filename.diff | ||
Note: In order for patches to be accepted, you <b>need</b> to follow the [http://developer.mozilla.org/en/JavaScript_style_guide Mozilla's Javascript style guide] (especially with respect to indentation and variable naming). This helps to maintain consistency in Ubiquity's code. | |||
Then, on the Trac ticket page, click the "Attach file" button and choose the file you just created. Add a bit of explanation about your changes, and click "Submit changes". Don't change the status of the ticket yet. | Then, on the Trac ticket page, click the "Attach file" button and choose the file you just created. Add a bit of explanation about your changes, and click "Submit changes". Don't change the status of the ticket yet. |
edits