Getting Started - Developer: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
#[[Getting Started - Developer#Development tools and extensions|Install the Thunderforce development tools and extensions]] | #[[Getting Started - Developer#Development tools and extensions|Install the Thunderforce development tools and extensions]] | ||
#[[Getting Started - Developer#Thunderforce Eclipse project|Download the Thunderforce source code into a new Eclipse project]] | #[[Getting Started - Developer#Thunderforce Eclipse project|Download the Thunderforce source code into a new Eclipse project]] | ||
#[[Download and compile the Mozilla Thunderbird source code]] | #[[Getting Started - Developer#Mozilla Thunderbird debug-enabled build|Download and compile the Mozilla Thunderbird source code]] | ||
#*This is optional, but helps immensely with software development and debugging | #*This is optional, but helps immensely with software development and debugging | ||
#*If Thunderforce is crashing Thunderbird, then this optional task will likely be required to quickly and easily find out why the crash is happening | |||
#[http://www.apexdevnet.com/events/regular/registration.php Sign up for a Salesforce.com Apex Developer Network (ADN) account] to get a developer edition organization if you haven't already done so | #[http://www.apexdevnet.com/events/regular/registration.php Sign up for a Salesforce.com Apex Developer Network (ADN) account] to get a developer edition organization if you haven't already done so | ||
#*Your developer edition organization can be used to develop and test Thunderforce | #*Your developer edition organization can be used to develop and test Thunderforce | ||
#*Developer edition organizations have API access, though they are limited to 5000 API calls per 24-hour period | #*Developer edition organizations have API access, though they are limited to 5000 API calls per 24-hour period | ||
#*You can develop and test Thunderforce even if you don't have API access in your Salesforce.com organization or if you don't use Salesforce.com at all | #*You can develop and test Thunderforce even if you don't have API access in your main Salesforce.com organization or if you don't use Salesforce.com at all | ||
#[[Getting Started - Developer#Thunderforce testing profile in Thunderbird|Create and configure a Thunderforce testing profile in Thunderbird]] | #[[Getting Started - Developer#Thunderforce testing profile in Thunderbird|Create and configure a Thunderforce testing profile in Thunderbird]] | ||
#[[Getting Started - Developer#Thunderforce run and debug Eclipse targets|Create run and debug Thunderforce targets in Eclipse]] | |||
#Familiarlize yourself with [[Test framework|Thunderforce's test framework]] | #Familiarlize yourself with [[Test framework|Thunderforce's test framework]] | ||
#Grab a module and develop it (module list is pending the [[Architectural review and refinement|architectural review's]] completion) | #Grab a module and develop it (module list is pending the [[Architectural review and refinement|architectural review's]] completion) | ||
Line 22: | Line 24: | ||
##Implement your module in parallel with your unit tests | ##Implement your module in parallel with your unit tests | ||
##*When possible, create your unit test before your code and use the test framework to verify your module's operation under those test cases | ##*When possible, create your unit test before your code and use the test framework to verify your module's operation under those test cases | ||
|style="vertical-align:top; width: 30%;"| | |||
==Artifacts== | |||
*[[Requirements|Feature list]] | |||
*[[Requirements prioritization and project scope#Context_Diagram|Context diagram]] | |||
*[https://www.moonlightdesign.org/thunderforce/svn/ Subversion repository] | |||
*[https://www.moonlightdesign.org/thunderforce/shared/ Shared documents] | |||
*Releases (coming later) | |||
==Useful Development Links== | |||
*Documentation | |||
**[http://www.salesforce.com/us/developer/docs/api/index.htm Apex API 10.0] | |||
***[http://www.salesforce.com/us/developer/docs/api/Content/data_model.htm Entity-relationship diagrams (ERDs)] | |||
**[http://developer.mozilla.org/en/docs/Main_Page Mozilla platform documentation] | |||
**[http://www.sqlite.org/docs.html SQLite documentation] | |||
**[http://developer.mozilla.org/en/docs/Storage SQLite in Mozilla] | |||
**[http://developer.mozilla.org/en/docs/How_to_Build_an_XPCOM_Component_in_Javascript Implement XPCOM in JavaScript] | |||
**[http://www.xulplanet.com/ XULPlanet.com] | |||
**[http://www.mozilla.org/scriptable/components_object.html Components object] | |||
**[[Thunderforce UUIDs]] | |||
**[http://developer.mozilla.org/en/docs/Mozilla_automated_testing Mozilla testing] | |||
**[http://xulunit.mozdev.org/ XULUnit] | |||
*Thunderbird Extensions | |||
**[https://addons.mozilla.org/en-US/firefox/addon/1806 DOM Inspector] | |||
**[http://www.mozilla.org/projects/venkman/ Venkman] | |||
**[https://addons.mozilla.org/en-US/firefox/addon/776 about:about] | |||
**[http://ted.mielczarek.org/code/mozilla/extensiondev/ Extension Developer Extension] | |||
*Salesforce.com | |||
**[https://na5.salesforce.com/soap/ajax/10.0/debugshell.html AJAX Debug Shell] | |||
|} | |||
==Development tools and extensions== | ==Development tools and extensions== | ||
Line 60: | Line 94: | ||
*'''tests''' | *'''tests''' | ||
**Integration and unit tests live in this folder, which is structured as a Thunderbird extension. Because these tests are designed to test Thunderforce, this extension requires that the Thunderforce extension is also installed in a Thunderforce profile | **Integration and unit tests live in this folder, which is structured as a Thunderbird extension. Because these tests are designed to test Thunderforce, this extension requires that the Thunderforce extension is also installed in a Thunderforce profile | ||
==Mozilla Thunderbird debug-enabled build== | |||
If you are not using a Linux or Apple Mac OS X system for development, you will need to download and install CVS, GNU Make, GNU GCC, and likely other build tools. I'm using [http://www.opensuse.org/ Novell openSUSE 10.2] as my desktop at both home and work, and I haven't yet tried to compile Thunderbird on Windows. [http://www.cygwin.com/ Cygwin] might be a possible solution, and [http://gemal.dk/mozilla/build.html this page] might help with that. Please feel free to update this page if you know how to do this in Windows. If you are running Linux, please be sure to [http://kerneltrap.org/node/14148 add noatime and nodiratime to your filesystem mount options] to make handling the Mozilla codebase as fast as possible. | |||
#Create a new standard make C++ project in your Thunderforce Eclipse workspace | |||
##In the "File" menu, select New -> "Project..." and select "Standard Make C++ Project" in the C++ group | |||
##Name the project "mozilla" without the quotes (case is important in case-sensitive filesystems) and press the "Next >" button | |||
##Accept the defaults and press the "Finish" button | |||
##Close Eclipse until you are finished with the remaining steps | |||
#Download the 2.0 branch of Thunderbird using CVS in the command line | |||
#*Yes, you will need to use the command line and have cvs or cvs.exe in your path. Mozilla uses a Makefile to download the relevant parts of the tree for a given project | |||
#*This process was adapted from [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS Mozilla's CVS build instructions] | |||
##In a command prompt or shell, change the current directory to your Thunderforce Eclipse workspace's folder | |||
##*That folder should have at least two folders: Thunderforce and mozilla | |||
##Download the client.mk file with the following CVS command, exactly as it is written: | |||
##*cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r THUNDERBIRD_2_0_0_6_RELEASE mozilla/client.mk | |||
##Change the current directory to mozilla | |||
##*cd mozilla | |||
##Download Mozilla Thunderbird's source code with CVS by running the following command: | |||
##*make -f client.mk checkout MOZ_CO_PROJECT=mail | |||
#Configure Thunderbird to build with debugging options enabled | |||
##Create a new text file in the root "mozilla" folder named [http://developer.mozilla.org/en/docs/Configuring_Build_Options .mozconfig] (include the dot prefix) | |||
##*In this file, add the following items as lines of text:<br/>. mail/config/mozconfig<br/>*ac_add_options --enable-debug<br/>*ac_add_options --disable-optimize | |||
##Run the Autoconf configure script | |||
##*Linux or Cygwin: ./configure | |||
##*Windows: Please feel free to contribute this information here | |||
#Build Mozilla Thunderbird with the following command in the root "mozilla" directory: | |||
#*make | |||
#Launch Eclipse and see the "mozilla" project populated with Thunderbird's source code | |||
#*You can now easily open files with Ctrl+Shift+R, see where a definition for an identifier in a C++ file exists, find references, and other operations that you can do in Eclipse with C and C++ files | |||
==Thunderforce testing profile in Thunderbird== | ==Thunderforce testing profile in Thunderbird== | ||
Line 76: | Line 139: | ||
#*Both of these files will contain one and only one line of text | #*Both of these files will contain one and only one line of text | ||
==Thunderforce run and debug Eclipse targets== | |||
= | |||
Revision as of 19:56, 10 August 2007
To get started as a developer, you will need to install and set up various programs. It's definitely possible to use alternatives for the proposed tools, though the tools listed below are the ones that I am accustomed to in case if you have any support questions for them. The general process is outlined below:
|
Artifacts
Useful Development Links
|
Development tools and extensions
Please install and set up the following:
- Eclipse IDE for C/C++ Developers
- If you already have Eclipse installed, you can alternatively install the Eclipse C/C++ development environment (CDT) into your existing Eclipse installation
- Create and switch to a new Eclipse workspace for Thunderforce unless if you aren't using Eclipse for anything else
- This can be accomplished through File -> "Switch Workspace..."
- Optionally, you can create a shortcut to start the Thunderforce workspace directly by running eclipse or eclipse.exe with "-data" followed by your workspace folder path
- Example: eclipse.exe -vmargs -Xmx512M -data d:\Devel\Thunderforce
- Eclipse Plug-Ins
- Adobe JSEclipse
- Registration required, unfortunately
- You can use BugMeNot for the Adobe account if you want to
- Subclipse
- Installation URL for Eclipse's built-in installer is http://subclipse.tigris.org/update_1.2.x
- AnyEdit Tools
- Installation URL for Eclipse's built-in installer is http://andrei.gmxhome.de/eclipse/
- Only AnyEdit is needed. The other tools aren't needed unless if you want to install them
- Configure AnyEdit to convert all tabs into spaces
- This is in Window -> Preferences, General/Editors/AnyEdit Tools
- Installation URL for Eclipse's built-in installer is http://andrei.gmxhome.de/eclipse/
- UMLet UML editor
- Oribe XML (being deprecated; I think Eclipse has its own XML editor now..)
- Adobe JSEclipse
Thunderforce Eclipse project
The following steps walk you through the process of importing the Thunderforce Eclipse project into your workspace:
- In your Thunderforce Eclipse profile, select "Import..." from the "File" menu to begin the process
- Within the "Other" group, select "Checkout Projects from SVN" and press the "Next >" button
- Create the https://www.moonlightdesign.org/thunderforce/svn repository location if it isn't already created. Press the "Next >" button
- When asked to select the folder to be checked out from SVN, select the "trunk" folder and press "Next >"
- Eclipse should automatically detect that the project is named Thunderforce. Press the "Finish" button to complete the project setup
The Thunderforce Eclipse project is presently split into three main folders:
- architecture
- The high-level architecture and any detailed design diagrams live in here
- extension
- This is the Thunderforce extension for Thunderbird. The subfolder structure matches Mozilla's extension folder structure guidelines
- tests
- Integration and unit tests live in this folder, which is structured as a Thunderbird extension. Because these tests are designed to test Thunderforce, this extension requires that the Thunderforce extension is also installed in a Thunderforce profile
Mozilla Thunderbird debug-enabled build
If you are not using a Linux or Apple Mac OS X system for development, you will need to download and install CVS, GNU Make, GNU GCC, and likely other build tools. I'm using Novell openSUSE 10.2 as my desktop at both home and work, and I haven't yet tried to compile Thunderbird on Windows. Cygwin might be a possible solution, and this page might help with that. Please feel free to update this page if you know how to do this in Windows. If you are running Linux, please be sure to add noatime and nodiratime to your filesystem mount options to make handling the Mozilla codebase as fast as possible.
- Create a new standard make C++ project in your Thunderforce Eclipse workspace
- In the "File" menu, select New -> "Project..." and select "Standard Make C++ Project" in the C++ group
- Name the project "mozilla" without the quotes (case is important in case-sensitive filesystems) and press the "Next >" button
- Accept the defaults and press the "Finish" button
- Close Eclipse until you are finished with the remaining steps
- Download the 2.0 branch of Thunderbird using CVS in the command line
- Yes, you will need to use the command line and have cvs or cvs.exe in your path. Mozilla uses a Makefile to download the relevant parts of the tree for a given project
- This process was adapted from Mozilla's CVS build instructions
- In a command prompt or shell, change the current directory to your Thunderforce Eclipse workspace's folder
- That folder should have at least two folders: Thunderforce and mozilla
- Download the client.mk file with the following CVS command, exactly as it is written:
- cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r THUNDERBIRD_2_0_0_6_RELEASE mozilla/client.mk
- Change the current directory to mozilla
- cd mozilla
- Download Mozilla Thunderbird's source code with CVS by running the following command:
- make -f client.mk checkout MOZ_CO_PROJECT=mail
- Configure Thunderbird to build with debugging options enabled
- Create a new text file in the root "mozilla" folder named .mozconfig (include the dot prefix)
- In this file, add the following items as lines of text:
. mail/config/mozconfig
*ac_add_options --enable-debug
*ac_add_options --disable-optimize
- In this file, add the following items as lines of text:
- Run the Autoconf configure script
- Linux or Cygwin: ./configure
- Windows: Please feel free to contribute this information here
- Create a new text file in the root "mozilla" folder named .mozconfig (include the dot prefix)
- Build Mozilla Thunderbird with the following command in the root "mozilla" directory:
- make
- Launch Eclipse and see the "mozilla" project populated with Thunderbird's source code
- You can now easily open files with Ctrl+Shift+R, see where a definition for an identifier in a C++ file exists, find references, and other operations that you can do in Eclipse with C and C++ files
Thunderforce testing profile in Thunderbird
To separate your production email from Thunderforce testing, we suggest that you create a separate Thunderbird profile for Thunderforce testing. You can also use your main Thunderbird profile, but you then run the risk of damaging your email during Thunderforce development.
- Ensure that Thunderbird is not running by closing all Thunderbird windows
- Start the Thunderbird profile manager in the command line: thunderbird -no-remote -ProfileManager
- Create a new profile named ThunderforceTest and press the Exit button to close the profile manager
- The Eclipse instructions refer to the ThunderforceTest name
- Optionally create a shortcut to launch the ThunderforceTest profile, which will work even when you have your default Thunderbird profile running
- The Thunderbird command to run in this shortcut: thunderbird -no-remote -P ThunderforceTest
- In your ThunderforceTest profile's extensions subfolder, create the two following text files. The file names that you will need to use are in bold:
- thunderforce@moonlightdesign.org
- This file will contain the full absolute file path to the Thunderforce extension folder, such as d:\Devel\Thunderforce\Thunderforce\extension
- thunderforcetest@moonlightdesign.org
- This file will contain the full absolute file path to the Thunderforce tests folder, such as d:\Devel\Thunderforce\Thunderforce\tests
- Both of these files will contain one and only one line of text
- thunderforce@moonlightdesign.org