Orion/Getting the source
This page covers how to take a look at the source, as well as how to set up for self-hosting (changing Orion code from Orion). See the Releng Builds page for details on how to contribute changes to the build.
Accessing the code
Source for Orion can be forked from our Git repositories:
Self hosting setup
We assume you are familiar with git. If not, review the Eclipsepedia Git Page. You can use EGit (the Eclipse Git client) or the command-line Git client. If you are on Windows, use msysgit if you prefer the command line git client.
Self-hosting involves running an Orion server on localhost, pointing your Orion editor at your local git repo directories, and working within Orion to make changes. Changes are committed using the command-line tools (or EGit), as a separate phase from the Orion workflow. Orion M6 will support an integrated Git workflow; see Working with git.
Here are the steps needed to get up and running.
Getting the Source onto your computer
- For e4 committers: Ensure that your user name and email are set up properly so that your email matches the foundation's email address on record. Otherwise you can't push changes. See Git#Committers_new_to_Git
- Clone the Orion client and server repositories using the URLs below. Choose a target directory that works for you. You'll be importing this code later into Eclipse in order to run your changes on the local server.
For e4 committers:
git clone ssh://myCommitterId@git.eclipse.org/gitroot/e4/org.eclipse.orion.client.git git clone ssh://myCommitterId@git.eclipse.org/gitroot/e4/org.eclipse.orion.server.git
For everybody else:
git clone http://git.eclipse.org/gitroot/e4/org.eclipse.orion.client.git git clone http://git.eclipse.org/gitroot/e4/org.eclipse.orion.server.git
Load The Source into Eclipse
- Download a stable orion build and unpack it somewhere on your harddisk. This download will be used as a so-called "target platform" when you run the server from eclipse.
- You can use any recent stable build of the Eclipse SDK to run the server. Many of us are using M4.
- Create a new workspace using your Eclipse SDK
- Use the File->Import->General->Existing Projects into Workspace wizard. In the wizard, set the root directory for the import to whatever directory you used when you cloned the Git repositories. You'll know you have the right path when you see a bunch of org.eclipse.orion.* projects in the project list.
- Ensure that Copy projects into workspace is not checked. Feel free to import just a subset of the projects (for example, just client plugins) - the remaining ones will come from the 'target platform'.
- The projects should appear in your workspace. Don't worry about compile errors just yet until after you've set up the target platform.
- Now you need to set up a target that points to the Orion build you downloaded. (Window->Preferences->Plug-in Development->Target Platform).
- Add a target
- Initialize the target definition with "Nothing", Next...
- In the Locations tab, click Add... , Select Installation, click "Next", click "Browse...", and point to the eclipse directory of the build
- Once you finish the wizard, you'll have a new target definition available in the list of targets.
- Make this the active target definition for your self-hosting workspace.
- Your workspace will be rebuilt and compile errors should disappear. There might be few errors related to unsatisfied dependencies from test plugins and you can ignore them for now.
Set up the launch to run from source
The plugin source you've loaded into Eclipse can now overwrite the plugins in the working stable build.
- Open the Run->Run Configurations dialog, expand Eclipse Application, and select the OSGi Framework launch called "web-ide"
- In the Arguments tab, set the VM argument that controls which directories the Orion server can access on your machine. You want to ensure the Orion server can update the files in your local git repo. Use whatever path format makes sense on your platform. Whatever format you use must match exactly what you type later into the "Link folder" dialog in Orion. (So if you use drive letters and back slashes on windows, you'll need to use the same format in the web client.)
- If you only want to work on the client (not the server), you can now close the server projects (5 client projects should remain).
- On "Bundles" pick "Select All". (I don't know why)
Running the Server
- Run the launch and point your browser at http://localhost:8080
- You'll be prompted to login (create an account).
- Once logged in, you'll see your navigator with some auto-generated content (a folder called "org.eclipse.e4.webide") from the M4 release. You should ignore this content. You can delete this folder.
- Push the link button and add a folder that links to your local git repos. For example, if you wanted to make changes to the client, you could link a folder named "org.eclipse.orion.client.core" to the following file path:
- Add a folder link for each bundle in the git repository that you care about.
- You should see the folders show up in your Orion explorer.
- From here, you can start editing files. As you make changes to the client code, you can simply reload the corresponding page in your browser to see the changes. We recommend you keep a browser tab open with a stable editor and stable navigator, and open a new tab for reloading and trying changes. In this way, you'll always have a couple of safe browser tabs to use to revert changes if you break something!