| Summary: | Client minification in Tycho build | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> |
| Component: | Releng | Assignee: | Szymon Brandys <Szymon.Brandys> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jan.sievers, matthias.sohn, Szymon.Brandys |
| Version: | 3.0 | ||
| Target Milestone: | 3.0 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 399023 | ||
|
Description
John Arthorne
https://github.com/mcheely/requirejs-maven-plugin may be worth a try (In reply to comment #1) > https://github.com/mcheely/requirejs-maven-plugin > > may be worth a try I already tried that, but probably I did something wrong and it did not work for me :( I made some progress using a mix of ant task and the requirejs plugin. I added
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
<copy todir="./optimization">
<fileset dir="./bundles/org.eclipse.orion.client.core/web" includes="**" />
<fileset dir="./bundles/org.eclipse.orion.client.ui/web" includes="**" />
<fileset dir="./bundles/org.eclipse.orion.client.editor/web" includes="**" />
<fileset dir="./bundles/org.eclipse.orion.client.git/web" includes="**" />
<fileset dir="./bundles/org.eclipse.orion.client.users/web" includes="**" />
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
then I used
<plugin>
<groupId>com.github.mcheely</groupId>
<artifactId>requirejs-maven-plugin</artifactId>
<version>2.0.0-SNAPSHOT</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>optimize</goal>
</goals>
</execution>
</executions>
<configuration>
<configFile>
${basedir}/buildconfig.js
</configFile>
<skip>false</skip>
</configuration>
</plugin>
My build config is:
({
appDir: "./optimization",
baseUrl: '.',
dir: "./appdirectory-build",
modules: [
{
name: "index"
}
],
optimizeCss: "standard",
optimize: "uglify",
paths: {
orion: 'orion',
requirejs: 'requirejs',
text: 'requirejs/text',
i18n: 'requirejs/i18n',
domReady: 'requirejs/domReady',
gcli: 'gcli/gcli',
util: 'gcli/util'
}
})
I managed to uglify files, but did not manage to use closure optimizer yet. One more step left is to copy files back to proper locations
and then continue the Tycho build.
I am not sure if this is the right direction, but it may work. I hope it helps others looking at the issue.
I decided to do something simple regarding minification. I run the same code as we have in the old Orion build as an Ant task from Maven. It is not enabled by default. To enable it you have to run build using:
mvn clean install -DrequirejsHome=...
where requirejsHome is the same folder as in the old build. The structure is as follows:
requirejsHome
|
|_dist
} }_r.js
|
|_lib
|_closure
{ }_compiler.jar
|
{_rhino
|_js.jar
We could include this folder into Orion client repo, unless there are some license restrictions.
Thoughts?
(In reply to comment #4) > I decided to do something simple regarding minification. I run the same code > as we have in the old Orion build as an Ant task from Maven. It is not > enabled by default. To enable it you have to run build using: > > mvn clean install -DrequirejsHome=... Released to master. I raised Bug 410174 to update Orion Hudson task. |