Friday, October 14, 2011

Setting up Lightning Extension Development Environment

Setting up a development Environment for Mozilla Lightning (Calendar Project)

Ok so you want to work and solve some bugs in lightning, without wasting much of your time. How do you go about doing it? And also you do not want to spend much time on building the entire Thunderbird application everytime you changed something in calUtils.cpp or calCachedCalendar.js. Well there is a solution to it. But before that, we need to pull the Code from http://hg.mozilla.org

The fundamental difference is that lightning is an extension and does not need thunderbird to be built again and again, if there are changes to lightning. Hence, you can set up a extension development environment for lightning, just like you do for firefox. Unfortunately, nothing exists for Thunderbird. I figured this out, after I was developing the code for Lightning on an Inverse branch.

Here are the steps:
  • Follow the steps at https://developer.mozilla.org/En/Simple_Thunderbird_build to get a working copy of the Thunderbird + Lightning build.
  • Open up command line in Linux or MacOS.
  • When you build TB you will notice a in your comm-central directory. This is where all the built components are stored. Using command line, navigate to "obj-x86_64-apple-darwin10.8.0/mozilla/dist/Daily.app/Contents/MacOS/extensions/". It should be something similar on Linux.
  • Delete the "{e2fda1a4-762b-4020-b5ad-a41df1933103}" directory. This is the directory where lightning components reside.
  • Now create a soft link to: comm-central/obj-x86_64-apple-darwin10.8.0/mozilla/dist/xpi-stage/lightning. On Mac and Linux you can do this by executing:
    ln -s  "../../../../xpi-stage/lightning" "{e2fda1a4-762b-4020-b5ad-a41df1933103}"
    Notice that I am using relative paths here.
  • Now you all set, change something in "comm-central/calendar/*"
  • And change your directory to "comm-central/obj-x86_64-apple-darwin10.8.0/calendar"
  • And run make, and now thunderbird should be reflecting the changes you made. 
This worked, and my dev schedule for lightning is now quite fast.

Cheers

No comments:

Post a Comment