[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [orion-dev] Changes to Orion build-time JS minification
|
I have added these instructions to the
wiki, because there is no chance I will find this email at the moment these
instructions are needed:
https://wiki.eclipse.org/Orion/Releng_Builds#Minification
John
From:
Mark Macdonald <mamacdon@xxxxxxxxx>
To:
Orion developer discussions
<orion-dev@xxxxxxxxxxx>,
Date:
03/05/2014 06:24 PM
Subject:
[orion-dev]
Changes to Orion build-time JS minification
Sent by:
orion-dev-bounces@xxxxxxxxxxx
I've released some changes to Orion's build-time
JS minification. The rationale is twofold:
1. Reduce
build times [1].
2. Reduce
duplicated logic across various builds of Orion (Maven, PDE, Node, etc),
to make it easier for developers to get new pages minified without breaking
things. [2]
After some initial problems, builds seem to
be working OK again. (If you notice any problems with build output or minification,
please open a bug and assign it to me.)
Here's a summary of the results:
1. Build
times
Proper use of r.js has reduced the minification time for Orion's client
code from 68 minutes to 12 minutes [3][4]. As the build scripts are now
shared, the PDE build has seen similar improvements. This gives us total
build times of ~21 minutes (PDE) and ~28 minutes (Hudson
, orion-client + orion-server).
2. Build
maintenance
>From now on, the only file developers should normally have to maintain
is this one in the client repo:
releng\org.eclipse.orion.client.releng\builder\scripts\orion.build.js.
This is the RequireJS build file used to minify the Orion client UI.
It contains a few additional parameters that are not standard RequireJS.
See below for Orion-developer-oriented details about the client build.
Adding a new module to the client build
There's just one step:
1. Add
an entry to the modules section of orion.build.js.
Every entry needs a name property
and a bundle, which tells the builder which bundle the minified
module should be copied back into. For example, here is the Git Commit
page's entry:
{ name: "git/git-commit",
bundle: "${buildDirectory}/bundles/org.eclipse.orion.client.git"
},
^ Ant-style property replacement is supported,
but ${buildDirectory} is all you should use there. The PDE, Hudson, and
Node builds all share orion.build.js, so your new module will be correctly
built everywhere.
Adding a new client bundle to the JS build
1. Add
an entry to the bundles section of orion.build.js.
2. If
your bundle contains any JSDocs, add an entry to the jsdocs section
of orion.build.js.
3. Add
module entries for any of the bundle's
modules you want minified (see previous section).
4. Add
an entry to the <modules> section of the client repo's top-level
pom.xml to ensure that the Maven builder finds your bundle.
Building stand-alone features (like the standalone
Orion editor)
Right now these 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.
Thanks
Mark
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=429077
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=422699
[3] https://hudson.eclipse.org/orion/job/orion-client/162/
[4] https://hudson.eclipse.org/orion/job/orion-client/167/
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev