^ Ant-style property replacement is supported in the bundle field, but ${orionClient} is the only property you should use there. The PDE, Hudson, and Node builds all share orion.build.js, so your new module will be correctly built everywhere.

How optimized modules are generated

For every module {name} listed in the modules section:

The build outputs an optimized file, named built-{name}.js, with AMD dependencies inlined and code minified.

The build also determines the caller. The caller is whatever HTML page or script is responsible for calling require(["{name}.js"]) or <script data-main="{name}" ... /> to actually load the module.

The caller is modified such that the optimized file built-{name}.js is loaded rather than the original {name}.js.

For a module {name}.js, the build by convention looks for a caller named {name}.html. If the caller is not named according to convention, it must be specified in the module entry using a caller property, so that the build can locate it. As of this writing, the caller must live in the same folder as the module.

For example, this is how the JS tools web worker (which is loaded by another script file named javascriptWorkerBootstrap.js, not an HTML file) is optimized:

^ Here, the build will modify the caller javascriptWorkerBootstrap.js such that it loads the optimized module "built-javascriptPluginWorker.js" instead of "javascriptPluginWorker.js".

Adding a new client bundle to the JS build

Add an entry to the bundles section of orion.build.js.

If your bundle contains any JSDocs, add an entry to the jsdocs section of orion.build.js.

Add module entries for any of the bundle's modules you want minified (see previous section).

Add an entry to the <modules> section of the client repo's top-level pom.xml. This ensures that the Maven builder finds your bundle.

Building stand-alone features

Right now stand-alone features (such as the built-editor.min.js, the standalone Orion editor) are still handled separately by the build script. You must add logic to orion.mini.xml that invokes r.js, passing the build file for your feature. Use the standalone editor build as a reference.

PDE build

The PDE builds follow many of the same practices used by the Eclipse Platform Project. The builds are based on PDE/Build and run automatically on build.eclipse.org via cron job.

There is only one kind of build. Integration builds run daily from tagged repository versions. Map files are used to specify where a project is located in the repository and what version of that project to use in the build. The map files are located in the org.eclipse.orion.releng project. The builder itself performs the tagging so all the latest changes in "master" stream are picked up by every build. No manual tagging by committers is required.

How the build works

Bootstrap

The build is kicked off by a "bootstrap" script that is not under version control. The only purpose of this script is to fetch the real build script and invoke the build. The script is located at:

/opt/buildhomes/e4Build/bootstrap.orion.sh

The build type is passed as an argument. -I means integration build (with tagging). -N is equivalent but does not perform any tagging (in both cases the contents of master are used to perform the build).

You can also pass an -email argument to cause the build notifications to only be sent to an individual. This is useful for test builds:

bootstrap.orion.sh -I -email bob_mackenzie@example.com

The bootstrap script is typically invoked by a cron entry in the e4Build user account. For example here is a cron entry to start a build every Wednesday at 8:55am:

masterBuild.sh

The bootstrap fetches and invokes the main build script, called masterBuild.sh. This script is under version control, so you need to push any changes to this script into the master branch for them to take effect. If you scroll to the very bottom of this script you can see the steps it performs:

build log

The results of the build, including any failures from any step, can found found in the build log at:

/shared/eclipse/e4/orion/logs/current.log

This is the first place to check when the build fails. It is typically very long so it is often helpful to use tail to start near the end. This exact same log gets copied into the download directory so it is available for reference for any build we produce. For example:

Repository cache

For performance reasons, PDE build maintains a cache of fetched prerequisite bundles. This lives at /shared/eclipse/e4/orion/target/transformedRepos on the build machine. The build will pick up the newest version of each required bundle from that location. If you ever need to force the build to go back to an *older* version of a bundle, this cache needs to be cleared. Simply delete the transformedRepos directory prior to the build.

Deploying builds to orion.eclipse.org or orionhub.org

Builds are deployed using the script deploy.sh. This script should be copied to your home directory and run from there. Your home directory will contain a symlink to the downloads directory, so you can perform a deploy directly from the downloads area. The script takes a single argument which is the location of the zip containing the download. For our servers we want the Linux 64-bit build. It is useful to log the output of this script so it can be reviewed later. Example:

This script simply copies the build onto the deployment server, and invokes an upgrade script on that server - upgrade.sh. The upgrade script shuts down the old server, moves it, unzips and configures the new build, and finally starts it.

The entire deploy/upgrade process takes about 5 seconds when it runs smoothly. Occasionally there will be a communication error copying the new build onto the target machine. In this case simply re-running the script usually succeeds.

Node build

As of this writing, the Node build does not happen automatically. Members of the Orion dev team run the build manually
- to prepare Orion for publishing to the npm repository. Builds are published on a regular basis, at least once per milestone.

Running the build

Run the shell script make-publish.sh from the modules/orionode/build/ directory:

$ cd modules/orionode/build
$ ./make-publish.sh /path/to/tempDir

The script takes a single argument, which is the output directory where the minified server will be generated. Everything in tempDir gets deleted, so do not publish to an important directory.