As a developer, you can contribute to MavensMate in two ways:
- Contribute to the core APIs
- Develop plugins for your desired text editor(s)
Start by cloning the core MavensMate API, mm
.
MavensMate API
mm
is the python application you can use to build IDEs in various text editors. It can create new projects, compile code, move code between orgs, run apex tests, etc...and it's all JSON-based. Simply feed it JSON to provide context to your request, and it will respond in JSON. Here's an example:
Request
$ python mm.py compile_project <<< '{ "project_name" : "myproject" }'
Response
{
"success" : true,
"body" : "Your operation completed successfully"
}
For detailed information on mm
, head over to the API documentation
MavensMate Text Editor Plugins
Currently, there are two plugins that use the MavensMate APIs: MavensMate for Sublime Text 2 (no longer supported) and MavensMate for Sublime Text 3 (stable). If you're interested in developing Force.com applications in other text editors or IDEs, you can use the MavensMate core API mm
to do so.
Setting Up Your Environment (Sublime Text 3 plugin development & testing)
This guide describes a configuration for developing & testing the MavensMate for Sublime Text 3 plugin. It has been tested on Mac OSX 10.8.3 with the MavensMate-SublimeText plugin.
Prerequisites
* Mac OSX 10.7+, Windows, or Linux
* Python
* Git - git can be installed using Brew with brew install git
or the GitHub app.
* Sublime Text 3
* MavensMate for Sublime Text 3
- Make sure python is installed on your local system and is available on your Path
- Run the following command to install python dependencies:
easy_install xmltodict keyring PyYAML suds jinja2
- Clone the mm GitHub project to your local system
- From Sublime Text, set your MavensMate
mm_developer_mode
setting totrue
(MavensMate > Settings > User) - From Sublime Text, set your MavensMate
mm_python_location
setting to the location of your python install. For example,"/usr/bin/python"
- From Sublime Text, set your MavensMate
mm_mm_py_location
setting to the location ofmm.py
, which is included in the mm project you cloned to your file system in step 3. For example,"/Users/darylshaber/Development/mm/mm.py"
Now all MavensMate requests will be routed through mm.py
.
Functional and Unit Tests
To run tests for the mm
executable, navigate to the root and run python test
.
API-Specific Tests
python test --api=31.0
Unit Tests
python test --unit
UI Testing
Mac OSX
To enable the Webkit Developer Tools for the MavensMateWindowServer.app which serves the UI page, run the following from a Terminal window:
defaults write org.mavens.MavensMateWindowServer WebKitDeveloperExtras -bool true
Windows and Linux
To debug UI operations, use Chrome as your default browser and use the Webkit Inspector to debug local server calls.