Redo precompression of *.html,*.css when creating the WAR file
Back in 1176f4538d ("Build a standard .war file for Gerrit") we
precompressed the HTML and CSS files so Jetty can server them
as-is to the client, reducing the network and CPU required for
the very large GWT generated JavaScript. When we switched over
the build to using Maven we lost that precompression logic.
This change adds it back in, depending upon the "gzip" command
to be in the caller's $PATH.
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -288,14 +288,24 @@ limitations under the License.
|
||||
<phase>process-classes</phase>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<move todir="${basedir}/target/${project.name}-${project.version}">
|
||||
<fileset dir="${basedir}/target/${project.name}-${project.version}/com.google.gerrit.Gerrit">
|
||||
<property name="d" location="${basedir}/target/${project.name}-${project.version}"/>
|
||||
<move todir="${d}">
|
||||
<fileset dir="${d}/com.google.gerrit.Gerrit">
|
||||
<exclude name="Gerrit.html" />
|
||||
<exclude name="SetCookie.html" />
|
||||
<exclude name="hosted.html" />
|
||||
</fileset>
|
||||
</move>
|
||||
<delete dir="${basedir}/target/${project.name}-${project.version}/com.google.gerrit.Gerrit" />
|
||||
<delete dir="${d}/com.google.gerrit.Gerrit" />
|
||||
<apply executable="gzip" addsourcefile="false">
|
||||
<arg value="-9"/>
|
||||
<fileset dir="${d}"
|
||||
includes="**/*.html,**/*.css"/>
|
||||
<redirector>
|
||||
<inputmapper type="glob" from="*" to="${d}/*"/>
|
||||
<outputmapper type="glob" from="*" to="${d}/*.gz"/>
|
||||
</redirector>
|
||||
</apply>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
||||
Reference in New Issue
Block a user