diff options
author | Artur Signell <artur@vaadin.com> | 2013-04-17 19:16:59 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-04-17 20:09:08 +0300 |
commit | cdcdc115b79f0773c2d140e43f58cfe9cb4b1cdb (patch) | |
tree | c3bb8f44a3918c4e4a5e3db903d6cda5d070fd0e /push | |
parent | 4400b1b62587e74073aac7f3c60710ac535795a5 (diff) | |
download | vaadin-framework-cdcdc115b79f0773c2d140e43f58cfe9cb4b1cdb.tar.gz vaadin-framework-cdcdc115b79f0773c2d140e43f58cfe9cb4b1cdb.zip |
Build a minified version of vaadinPush.js in vaadin-push.jar (#11630)
* Replaced jquery and jquery.atmosphere.js with original, unmodified versions
* Added vaadinPush.js build target to ide.xml and push/build.xml
* Uses yuicompressor to compress the resulting push javascript
Change-Id: I59ba9c2bbf74e05d10325d38efdb106b638cd8e7
Diffstat (limited to 'push')
-rw-r--r-- | push/build.xml | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/push/build.xml b/push/build.xml index 3e0d5805b9..81feec3188 100644 --- a/push/build.xml +++ b/push/build.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<project name="vaadin-push" basedir="." default="publish-local"> +<project name="vaadin-push" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant"> <description> Meta package which defines dependencies needed for push </description> @@ -10,16 +10,43 @@ <property name="module.name" value="vaadin-push" /> <property name="module.symbolic" value="com.vaadin.push" /> <property name="result.dir" location="result" /> + <property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" /> <path id="classpath.compile.custom" /> - + <union id="jar.includes"> - <fileset dir="${vaadin.basedir}/WebContent"> - <include name="VAADIN/jquery-1.7.2.rebased.js" /> - <include name="VAADIN/jquery.atmosphere.rebased.js" /> + <fileset dir="${result.dir}/js"> + <include name="VAADIN/vaadinPush.js" /> </fileset> </union> - - <target name="jar"> + + <target name="vaadinPush.js"> + <mkdir dir="${result.dir}/js/VAADIN" /> + <property name="vaadinPush.js.output" location="${result.dir}/js/VAADIN/vaadinPush.js" /> + <property name="vaadinPush.js.combined.output" location="${result.dir}/js/VAADIN/push.combined.js" /> + + <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery-1.7.2.js" property="jquery.js.contents" /> + <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery.atmosphere.js" property="jquery.atmosphere.js.contents" /> + <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/vaadinPush.js.tpl" property="vaadinPush.js.contents"> + <filterchain> + <replacetokens begintoken="@" endtoken="@"> + <token key="jquery.js" value="${jquery.js.contents}" /> + <token key="jquery.atmosphere.js" value="${jquery.atmosphere.js.contents}" /> + </replacetokens> + </filterchain> + </loadfile> + <echo file="${vaadinPush.js.combined.output}">${vaadinPush.js.contents}</echo> + + <!-- Minify --> + <ivy:retrieve organisation="com.yahoo.platform.yui" module="yuicompressor" revision="2.4.7" inline="true" type="jar" pattern="${result.dir}/compressor.jar" /> + <java jar="${result.dir}/compressor.jar" fork="true"> + <arg value="-v"/> + <arg value="-o"/> + <arg file="${vaadinPush.js.output}"/> + <arg file="${vaadinPush.js.combined.output}"/> + </java> + </target> + + <target name="jar" depends="vaadinPush.js"> <property name="server.osgi.import" value="" /> <antcall target="common.jar"> <param name="require-bundle" value="" /> |