Jump to: navigation, search

Difference between revisions of "Orion/Getting the source"

m (Corrected a couple of git links, and added some more details on running the node.js backend)
 
(13 intermediate revisions by 8 users not shown)
Line 3: Line 3:
 
== What you need ==
 
== What you need ==
 
* Basic knowledge of the Git version control system. (New to Git? [http://githowto.com/ Here's an introduction]).
 
* Basic knowledge of the Git version control system. (New to Git? [http://githowto.com/ Here's an introduction]).
* (Optional) An [http://download.eclipse.org Eclipse IDE]. "Eclipse Classic" is recommended.
+
* (Optional) An [http://download.eclipse.org Eclipse IDE]. "Eclipse IDE for Eclipse Committers" is recommended.
 
* (Optional) An [http://download.eclipse.org/orion/ Orion build].
 
* (Optional) An [http://download.eclipse.org/orion/ Orion build].
 +
 +
If you're interested in contributing changes to Orion, you must do a few additional things:
 +
* [https://dev.eclipse.org/site_login/ Create an Eclipse developer account].
 +
* Sign the [https://projects.eclipse.org/user/sign/CLA Contributor License Agreement] (CLA).
 +
* Register your SSH public keys with [https://git.eclipse.org/r/#/settings/ Gerrit]. (You can use HTTPS instead, but SSH is recommended).
  
 
== Browsing the source ==
 
== Browsing the source ==
 
Just want to take a peek at our code? You can browse it on the web here:
 
Just want to take a peek at our code? You can browse it on the web here:
 
* http://git.eclipse.org/c/orion/
 
* http://git.eclipse.org/c/orion/
We also have GitHub mirrors if you prefer:
+
We also have GitHub mirrors if you prefer (see note below on how to clone these):
 
* https://github.com/eclipse/orion.client
 
* https://github.com/eclipse/orion.client
 
* https://github.com/eclipse/orion.server
 
* https://github.com/eclipse/orion.server
Line 17: Line 22:
 
* {{Git|orion|org.eclipse.orion.client.git}}
 
* {{Git|orion|org.eclipse.orion.client.git}}
 
* {{Git|orion|org.eclipse.orion.server.git}}
 
* {{Git|orion|org.eclipse.orion.server.git}}
 +
 
To checkout our repositories, you'll generally perform the following commands in your command shell:
 
To checkout our repositories, you'll generally perform the following commands in your command shell:
  git clone http://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
+
  git clone https://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
  git clone http://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git
+
  git clone https://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git
If you're running an older version of Git, the '''http''' protocol may not work. In that case, try the '''git''' protocol instead:
+
 
 +
The '''git''' protocol can be used instead of https:
 
  git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
 
  git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
 
  git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git
 
  git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git
 +
 +
If you want to contribute changes to the Orion project using Gerrit, clone the repositories using your personal Gerrit URL (replace ''username'' with your Eclipse/Gerrit username).
 +
ssh://username@git.eclipse.org:29418/orion/org.eclipse.orion.client.git
 +
ssh://username@git.eclipse.org:29418/orion/org.eclipse.orion.client.git
 +
 +
See [[Development_Resources/Contributing_via_Git#via_Gerrit|Contributing via Gerrit]] to learn how to contribute using Gerrit.
 +
 
If you are self-hosting on your local computer using an Eclipse IDE, see the section below to load the source into Eclipse.
 
If you are self-hosting on your local computer using an Eclipse IDE, see the section below to load the source into Eclipse.
=== Notes for Eclipse committers ===
+
 
This section applies only to [http://www.eclipse.org/membership/become_a_member/committer.php Eclipse Committers]. If you're not a committer, you can skip these instructions.
+
If using GitHub mirrors use this to ensure the root directories have the expected name:
* Ensure that your Git configuration uses the same email address that you've set in your [https://dev.eclipse.org/portal/myfoundation/portal/portal.php Eclipse Foundation profile]. If the addresses don't match, you won't be able to push changes (see [[Git#Committers_new_to_Git]]).
+
  git clone https://github.com/eclipse/orion.client org.eclipse.orion.client
* Committers need to use different URLs to access the Orion Git repositories. The URL includes your committer ID:
+
  git clone https://github.com/eclipse/orion.server org.eclipse.orion.server
ssh://myCommitterId@git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
+
ssh://myCommitterId@git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git
+
  
 
== Overview of self-hosting ==
 
== Overview of self-hosting ==
Line 44: Line 56:
 
Here are the steps needed to get up and running.
 
Here are the steps needed to get up and running.
 
=== Install the Eclipse SDK ===
 
=== Install the Eclipse SDK ===
* When working with the latest Orion code from master you will need a Kepler stable build of the Eclipse SDK to run the server, such as [http://download.eclipse.org/eclipse/downloads/drops4/S-4.3RC3-201305301430/ Eclipse 4.3 RC3].
+
* When working with the latest Orion code from master you will need a recent stable build of the Eclipse SDK to run the server. You can download an Eclipse SDK from [http://download.eclipse.org/eclipse/downloads/ eclipse.org].
* If you use an older version of Eclipse, such as a Eclipse 4.2.2 or earlier, you might get a warning indicating that you are attempting to launch an application that is using a newer version of Eclipse. You should be able to ignore, see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=409440 Bug 409440] for more information.
+
* If you use an older version of Eclipse, such as a Eclipse 4.2.2 or earlier, you may get a warning indicating that you are attempting to launch an application that is using a newer version of Eclipse. There are no known issues launching the server from Eclipse 4.2 Juno or 4.3 Kepler, but it is recommended you use a more recent release. See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=409440 Bug 409440] for more information.
* You should also install the [http://www.eclipse.org/egit/ Eclipse Git Team Provider] package via Help > Install New Software. Select the '''Kepler''' repository and search for 'Eclipse Git Team Provider' to find the package.
+
* You should also install the [http://www.eclipse.org/egit/ Eclipse Git Team Provider] package via Help > Install New Software. Select the '''Luna''' repository and search for 'Eclipse Git Team Provider' to find the package.
* At the same time, install the [http://www.eclipse.org/webtools/ Eclipse Web Developer Tools] package to view and edit the HTML, CSS and JavaScript source withing Eclipse.
+
* At the same time, install the [http://www.eclipse.org/webtools/ Eclipse Web Developer Tools] package to view and edit the HTML, CSS and JavaScript source within Eclipse.
 +
 
 
=== Clone the client and server Git repositories into Eclipse ===
 
=== Clone the client and server Git repositories into Eclipse ===
 
* Start Eclipse and create a new workspace.
 
* Start Eclipse and create a new workspace.
Line 53: Line 66:
 
** Open the Git Repository Exploring perspective.
 
** Open the Git Repository Exploring perspective.
 
** Select Clone a Git Repository.
 
** Select Clone a Git Repository.
** Specify the Location URI http://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git and click Next on the Source Git Repository page.
+
** Specify a Location URI https://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git and click Next on the Source Git Repository page.
 
** Click Next on the Branch Selection page to accept the defaults.
 
** Click Next on the Branch Selection page to accept the defaults.
 
** At the Local Destination page, the directory can be placed in a new git folder under your workspace folder so all your files are within the workspace tree (the default is under your user home folder).
 
** At the Local Destination page, the directory can be placed in a new git folder under your workspace folder so all your files are within the workspace tree (the default is under your user home folder).
Line 60: Line 73:
 
** Click Finish on the Local Destination page to clone the repository.
 
** Click Finish on the Local Destination page to clone the repository.
 
* Repeat the steps above to clone the Orion server repository.
 
* Repeat the steps above to clone the Orion server repository.
** Specify the Location URI http://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git .
+
** Specify the Location URI https://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git .
 
=== Specify a target to build your Orion server ===
 
=== Specify a target to build your Orion server ===
* After loading in the client and server projects, a number of the server projects will have compile errors. To resolve we need to specify a target definition for your self-hosting workspace.
+
* After loading in the client and server projects, a number of the server projects will have compile errors due to missing dependencies. We need to add the required content to the target platform. The source code includes a target definition for your self-hosting workspace.
* Go the '''org.eclipse.orion.target''' project and open '''org.eclipse.orion.target.target''' in the Eclipse Target Definition editor.
+
* Check that you have the '''org.eclipse.orion.target''' project in your workspace
* Upon opening, you will see in your progress indicator '''Resolving Target Definition'''. Eclipse is downloading the requisite plug-ins onto your workstation. This step may take some time.
+
* Open Window > Preferences > Plug-in Development > Target Platform
* Upon completion, the locations in the target definition will expand indicating plug-ins available. For example: you will see http://download.eclipse.org/eclipse/updates/4.3-I-builds 379 plugins available.
+
* Check the '''org.eclipse.orion''' target definition and press OK.
* At this point, you can select the '''Set as Target Platform''' link in the upper right corner of the editor.
+
* The requisite plug-ins will be downloaded from the repositories. This step will take some time. The progress view will have a job called '''Resolving Target Definition'''.
* A Load Target Platform dialog will appear, your target will be set and the workspace will be built.  
+
* When complete, your projects will build and the compiler errors will be resolved.
* All compiler errors have now been resolved and you may close the target editor.
+
 
 +
Alternatively, you can open the '''org.eclipse.orion.target.target''' file in the Eclipse Target Definition editor. Upon opening, the target content will be downloaded.  When complete, you can press the '''Set as Target Platform''' link in the top right corner to update the target platform.
 +
 
 
=== Set up the server configuration file ===
 
=== Set up the server configuration file ===
 
* The launch configuration we will use is associated with a [[Orion/Server_admin_guide|Orion server configuration file]] called '''web-ide.conf'''. This file controls which directories the Orion server can access on your machine, among other things.
 
* The launch configuration we will use is associated with a [[Orion/Server_admin_guide|Orion server configuration file]] called '''web-ide.conf'''. This file controls which directories the Orion server can access on your machine, among other things.
Line 94: Line 109:
 
#Run the <code>npm install</code> command to automatically download Orionode's dependencies.
 
#Run the <code>npm install</code> command to automatically download Orionode's dependencies.
 
#*If you're not interested in developing the server, you can instead run <code>npm install --production</code>, which omits the dev-time dependencies for a smaller download.
 
#*If you're not interested in developing the server, you can instead run <code>npm install --production</code>, which omits the dev-time dependencies for a smaller download.
 +
#Edit the '''modules/orionode/orion.conf''' file, adding the ''workspace'' entry: <pre>workspace=/home/orionfan/workspace/org.eclipse.orion.client</pre>
 +
#* For more information on working with the node.js server, refer to the Orion-node.js README: '''modules/orionode/README.md'''
  
 
=== Concatenation and Minification ===
 
=== Concatenation and Minification ===

Latest revision as of 16:58, 29 April 2015

This page covers how to get the Orion source code, as well as how to set up for self-hosting (changing Orion code from Orion) using an Eclipse development environment.

What you need

If you're interested in contributing changes to Orion, you must do a few additional things:

Browsing the source

Just want to take a peek at our code? You can browse it on the web here:

We also have GitHub mirrors if you prefer (see note below on how to clone these):

Getting the source onto your computer

The Orion source code lives in two Git repositories:


To checkout our repositories, you'll generally perform the following commands in your command shell:

git clone https://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
git clone https://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git

The git protocol can be used instead of https:

git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.server.git

If you want to contribute changes to the Orion project using Gerrit, clone the repositories using your personal Gerrit URL (replace username with your Eclipse/Gerrit username).

ssh://username@git.eclipse.org:29418/orion/org.eclipse.orion.client.git
ssh://username@git.eclipse.org:29418/orion/org.eclipse.orion.client.git

See Contributing via Gerrit to learn how to contribute using Gerrit.

If you are self-hosting on your local computer using an Eclipse IDE, see the section below to load the source into Eclipse.

If using GitHub mirrors use this to ensure the root directories have the expected name:

  git clone https://github.com/eclipse/orion.client org.eclipse.orion.client
  git clone https://github.com/eclipse/orion.server org.eclipse.orion.server

Overview of self-hosting

To edit Orion's own source code using Orion, there's a few different ways we can do it. Here are our options:

Pure cloud.
Using a cloud deployment of Orion (like OrionHub, a public Orion server that anyone can use), you checkout the Orion source code using Orion's built-in Git features, then edit and test it. There's no software install; all you need is a web browser. Since you don't control the server, this method only allows you to hack on the Orion client code. See Selfhosting for instructions.
Self-hosting on your local computer using Eclipse IDE.
This method requires the Eclipse IDE. On your local computer, you checkout the Orion source code from a Git repository, and launch the Orion server from your Eclipse IDE. You can develop both client-side and server-side code using this method.
Self-hosting on your local computer using Node.js
This method uses Node.js to run a local Orion server, with Orion development tools running in the browser.

Self-hosting on your local computer using Eclipse IDE

Self-hosting locally involves running an Orion server on your local workstation, pointing your Orion editor at your local Git repository, and working within Orion to make changes. Changes are committed using any Git client; for instructions on Orion's Git features, see Working with git. Here are the steps needed to get up and running.

Install the Eclipse SDK

  • When working with the latest Orion code from master you will need a recent stable build of the Eclipse SDK to run the server. You can download an Eclipse SDK from eclipse.org.
  • If you use an older version of Eclipse, such as a Eclipse 4.2.2 or earlier, you may get a warning indicating that you are attempting to launch an application that is using a newer version of Eclipse. There are no known issues launching the server from Eclipse 4.2 Juno or 4.3 Kepler, but it is recommended you use a more recent release. See Bug 409440 for more information.
  • You should also install the Eclipse Git Team Provider package via Help > Install New Software. Select the Luna repository and search for 'Eclipse Git Team Provider' to find the package.
  • At the same time, install the Eclipse Web Developer Tools package to view and edit the HTML, CSS and JavaScript source within Eclipse.

Clone the client and server Git repositories into Eclipse

  • Start Eclipse and create a new workspace.
  • Clone the Orion client repository:
    • Open the Git Repository Exploring perspective.
    • Select Clone a Git Repository.
    • Specify a Location URI https://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git and click Next on the Source Git Repository page.
    • Click Next on the Branch Selection page to accept the defaults.
    • At the Local Destination page, the directory can be placed in a new git folder under your workspace folder so all your files are within the workspace tree (the default is under your user home folder).
    • Also select Import all existing projects after clone finishes so all the projects are loaded into your workspace.
    • You may also wish to assign a working set such as orion.client to group the client projects via the Working Sets section of the page.
    • Click Finish on the Local Destination page to clone the repository.
  • Repeat the steps above to clone the Orion server repository.

Specify a target to build your Orion server

  • After loading in the client and server projects, a number of the server projects will have compile errors due to missing dependencies. We need to add the required content to the target platform. The source code includes a target definition for your self-hosting workspace.
  • Check that you have the org.eclipse.orion.target project in your workspace
  • Open Window > Preferences > Plug-in Development > Target Platform
  • Check the org.eclipse.orion target definition and press OK.
  • The requisite plug-ins will be downloaded from the repositories. This step will take some time. The progress view will have a job called Resolving Target Definition.
  • When complete, your projects will build and the compiler errors will be resolved.

Alternatively, you can open the org.eclipse.orion.target.target file in the Eclipse Target Definition editor. Upon opening, the target content will be downloaded. When complete, you can press the Set as Target Platform link in the top right corner to update the target platform.

Set up the server configuration file

  • The launch configuration we will use is associated with a Orion server configuration file called web-ide.conf. This file controls which directories the Orion server can access on your machine, among other things.
  • Since we want to use Orion to edit its own source code, we have to ensure the Orion server can access the files in your local git repo.
    • Add a line like this to web-ide.conf:
      orion.file.allowedPaths=C:\\Users\\orionfan\\workspace\\git
      The path points to under the git folder where you checked out the Orion source code. (Windows paths must be separated with double backslashes!)

Run the Orion server

  • Open the Run->Run Configurations dialog, expand OSGi Framework, and select the OSGi Framework launch called web-ide.
  • Run the launch configuration (click the Run button from the launch configuration dialog, or use the Run command on the Eclipse toolbar.)
  • Point your browser at http://localhost:8080.
  • You'll be prompted to login (create an account).
  • Once logged in, you'll see an empty Navigator view. Click the New button and choose Link to Server.
  • Type a name (for example, "Orion Client") and in the Server Path field, enter the path to the Orion code on your local machine.
    • The path must be of one of the orion.file.allowedPaths entries we created in the previous section (or a subfolder thereof).
    • For example, if you wanted to make changes to the client, you might link to the following file path:
      C:\Users\orionfan\workspace\git\org.eclipse.orion.client
  • You should see the folders show up in your Orion explorer:
    Orion-navexample30M2.jpg
  • 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!

Self-hosting on your local computer using Node.js

Installing from source

  1. Make sure you have Node.js and npm installed. See nodejs.org for details.
  2. Get the Orion source. You only need to get the client source.
  3. Open a command shell and change directory to org.eclipse.orion.client/modules/orionode.
  4. Run the npm install command to automatically download Orionode's dependencies.
    • If you're not interested in developing the server, you can instead run npm install --production, which omits the dev-time dependencies for a smaller download.
  5. Edit the modules/orionode/orion.conf file, adding the workspace entry:
    workspace=/home/orionfan/workspace/org.eclipse.orion.client
    • For more information on working with the node.js server, refer to the Orion-node.js README: modules/orionode/README.md

Concatenation and Minification

By default the pages served up by Orionode are not concatenated or minified, so they will load rather slowly. You can mitigate this by running the client-side build. To do this, just run build.js, found in the org.eclipse.orion.client/modules/orionode/build directory:

 node ./build/build.js
Warning2.png
Running the script will overwrite files in your working directory! Make sure anything important is committed to a branch first.


Clear your browser cache. The next time you load Orionode, it should be much faster.

Running tests

The Orion node server has its own test suite. See Orion/Running_the_tests#Node.js_Server_Tests for more details.

Related links

See the Releng Builds page for details on how to contribute changes to the Orion build.

See the cloud Selfhosting page for details on self-hosting purely from the browser