diff options
author | Henri Sara <hesara@vaadin.com> | 2016-02-26 15:10:26 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2016-02-29 13:16:49 +0200 |
commit | 16eae732958e7a5841e3f46a5968fa85833da05b (patch) | |
tree | e90349ac0dd1264597cd8abbcfefd3d65e2bf3a4 /push | |
parent | 0dee5602cacb46e1120bc2339464c89bea34ddaa (diff) | |
download | vaadin-framework-16eae732958e7a5841e3f46a5968fa85833da05b.tar.gz vaadin-framework-16eae732958e7a5841e3f46a5968fa85833da05b.zip |
Use Maven to build vaadin-push
Change-Id: I244182abfe3b72c59786b520eafb663b5c1e5918
Diffstat (limited to 'push')
-rw-r--r-- | push/build.xml | 109 | ||||
-rw-r--r-- | push/ivy.xml | 44 | ||||
-rw-r--r-- | push/pom.xml | 220 | ||||
-rw-r--r-- | push/src/main/templates/jquery-1.11.0.js (renamed from push/lib/jquery/jquery-1.11.0.js) | 0 | ||||
-rw-r--r-- | push/src/main/templates/vaadinPush.js.tpl | 10 |
5 files changed, 230 insertions, 153 deletions
diff --git a/push/build.xml b/push/build.xml deleted file mode 100644 index 3a3329c0fe..0000000000 --- a/push/build.xml +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0"?> - -<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> - <include file="../build.xml" as="vaadin" /> - <include file="../common.xml" as="common" /> - - <property name="module.name" value="vaadin-push" /> - <property name="module.symbolic" value="com.vaadin.push" /> - <property name="result.dir" location="result" /> - <property name="temp.dir" location="${result.dir}/temp" /> - <property name="jquery.unpack" location="${temp.dir}/jquery" /> - <property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" /> - <property name="vaadinPush.debug.js" - location="${result.dir}/js/VAADIN/vaadinPush.debug.js" /> - - <!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java --> - <property name="atmosphere.runtime.version" value="2.2.7.vaadin1" /> - <property name="jquery.js" location="lib/jquery/jquery-1.11.0.js" /> - - <path id="classpath.compile.custom" /> - - <union id="jar.includes"> - <fileset dir="${result.dir}/js"> - <include name="VAADIN/vaadinPush.js" /> - <include name="VAADIN/vaadinPush.js.gz" /> - <include name="VAADIN/vaadinPush.debug.js" /> - <include name="VAADIN/vaadinPush.debug.js.gz" /> - </fileset> - </union> - - <target name="vaadinPush.js"> - <mkdir dir="${result.dir}/js/VAADIN" /> - <ivy:resolve log="download-only" file="ivy.xml" - conf="push.js" /> - <ivy:cachepath pathid="atmosphere.jquery.deps" - conf="push.js" /> - - <delete dir="${temp.dir}" /> - <copy flatten="true" tofile="${temp.dir}/jquery.war"> - <path refid="atmosphere.jquery.deps" /> - </copy> - - <!-- Unzip to temp dir --> - <unzip src="${temp.dir}/jquery.war" dest="${jquery.unpack}"> - <patternset> - <include name="**/jquery.atmosphere.js" /> - </patternset> - <mapper type="flatten" /> - </unzip> - <loadfile srcfile="${jquery.js}" property="jquery.js.contents" /> - <loadfile srcfile="${jquery.unpack}/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> - - <!-- Non-obfuscated version for debugging --> - <echo file="${vaadinPush.debug.js}">${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}" /> - <arg file="${vaadinPush.debug.js}" /> - </java> - - <!-- Gzipped versions --> - <gzip src="${vaadinPush.js}" destfile="${vaadinPush.js}.gz" /> - <gzip src="${vaadinPush.debug.js}" destfile="${vaadinPush.debug.js}.gz" /> - </target> - - <target name="jar" depends="vaadinPush.js"> - <antcall target="common.jar"> - <param name="osgi.extra.package.prefixes" value="VAADIN" /> - <param name="require-bundle" - value="com.vaadin.external.atmosphere.runtime;bundle-version="${atmosphere.runtime.version}";visibility:=reexport" /> - <reference torefid="extra.jar.includes" refid="jar.includes" /> - </antcall> - </target> - - <target name="publish-local" depends="jar"> - <antcall target="common.publish-local" /> - </target> - - <target name="clean"> - <antcall target="common.clean" /> - </target> - <target name="checkstyle"> - </target> - - <target name="test" depends="checkstyle"> - </target> -</project> diff --git a/push/ivy.xml b/push/ivy.xml deleted file mode 100644 index b5e34e616e..0000000000 --- a/push/ivy.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE ivy-module [ -<!-- Keep the version number in sync with build.xml --> - <!ENTITY atmosphere.runtime.version "2.2.7.vaadin1"> - - <!ENTITY atmosphere.js.version "2.2.13.vaadin3"> -]> -<ivy-module version="2.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" - xmlns:m="http://ant.apache.org/ivy/maven"> - - <info organisation="com.vaadin" module="vaadin-push" revision="${vaadin.version}" /> - - <configurations> - <conf name="build" /> - <conf name="build-provided" /> - <conf name="ide" visibility="private" /> - <conf name="test" visibility="private" /> - <!-- Used for building push.js only --> - <conf name="push.js" visibility="private" /> - </configurations> - <publications> - <artifact type="jar" ext="jar" /> - <!-- <artifact type="source" ext="jar" m:classifier="sources" /> - <artifact type="javadoc" ext="jar" m:classifier="javadoc" /> --> - <artifact type="pom" ext="pom" /> - </publications> - <dependencies> - <!-- API DEPENDENCIES --> - - <!-- @WebListener is used for JSR356 websockets so we need to compile with servlet 3 API --> - <dependency org="javax.servlet" name="javax.servlet-api" - rev="3.0.1" conf="build-provided,ide,test -> default" /> - - <!-- Atmosphere --> - <dependency org="com.vaadin.external.atmosphere" - name="atmosphere-runtime" rev="&atmosphere.runtime.version;" - conf="build,ide,test -> default" /> - <dependency org="com.vaadin.external.atmosphere.client" - name="jquery" rev="&atmosphere.js.version;" conf="push.js -> default" /> - </dependencies> - -</ivy-module> diff --git a/push/pom.xml b/push/pom.xml new file mode 100644 index 0000000000..3bbdc931c5 --- /dev/null +++ b/push/pom.xml @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-parent</artifactId> + <version>1.0.0</version> + </parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-push</artifactId> + <name>Vaadin Push</name> + <packaging>jar</packaging> + <version>7.7.0-SNAPSHOT</version> + <properties> + <atmosphere.runtime.version>2.2.7.vaadin1</atmosphere.runtime.version> + <atmosphere.js.version>2.2.6.vaadin4</atmosphere.js.version> + </properties> + + <organization> + <name>Vaadin Ltd</name> + </organization> + <url>https://vaadin.com/</url> + <description>Vaadin server push support</description> + + <dependencies> + <!-- Atmosphere --> + <dependency> + <groupId>com.vaadin.external.atmosphere</groupId> + <artifactId>atmosphere-runtime</artifactId> + <version>${atmosphere.runtime.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin.external.atmosphere.client</groupId> + <artifactId>jquery</artifactId> + <version>${atmosphere.js.version}</version> + <type>war</type> + <scope>provided</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>default-cli</id> + <phase>generate-resources</phase> + <goals> + <goal>run</goal> + </goals> + <!-- <inherited>false</inherited> --> + <configuration> + <target> + <property name="jquery.unpack" location="${project.build.directory}/temp" /> + <property name="vaadinPush.js" + location="${project.build.outputDirectory}/VAADIN/vaadinPush.debug.js" /> + <property name="templates.dir" + location="${project.build.sourceDirectory}/../templates" /> + + <!-- Unzip to temp dir --> + <unzip + src="${maven.dependency.com.vaadin.external.atmosphere.client.jquery.war.path}" + dest="${jquery.unpack}"> + <patternset> + <include name="**/jquery.atmosphere.js" /> + </patternset> + <mapper type="flatten" /> + </unzip> + <loadfile srcfile="${templates.dir}/jquery-1.11.0.js" + property="jquery.js.contents" /> + <loadfile srcfile="${jquery.unpack}/jquery.atmosphere.js" + property="jquery.atmosphere.js.contents" /> + + <loadfile srcfile="${templates.dir}/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> + <!-- Non-obfuscated version for debugging --> + <echo file="${vaadinPush.js}">${vaadinPush.js.contents}</echo> + + </target> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>net.alchim31.maven</groupId> + <artifactId>yuicompressor-maven-plugin</artifactId> + <version>1.5.1</version> + <executions> + <execution> + <id>minifyjs</id> + <phase>process-resources</phase> + <goals> + <goal>compress</goal> + </goals> + </execution> + </executions> + <configuration> + <sourceDirectory>${project.build.outputDirectory}/VAADIN</sourceDirectory> + <includes> + <include>vaadinPush.debug.js</include> + </includes> + <outputDirectory>${project.build.outputDirectory}/VAADIN</outputDirectory> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>compresspush</id> + <phase>compile</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <property name="vaadinPush.debug.js" + location="${project.build.outputDirectory}/VAADIN/vaadinPush.debug.js" /> + <property name="vaadinPush-min.js" + location="${project.build.outputDirectory}/VAADIN/vaadinPush.debug-min.js" /> + <property name="vaadinPush.js" + location="${project.build.outputDirectory}/VAADIN/vaadinPush.js" /> + + <move file="${vaadinPush-min.js}" tofile="${vaadinPush.js}" /> + + <!-- Gzipped versions --> + <gzip src="${vaadinPush.debug.js}" destfile="${vaadinPush.debug.js}.gz" /> + <gzip src="${vaadinPush.js}" destfile="${vaadinPush.js}.gz" /> + </target> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment> + <Export-Package>VAADIN</Export-Package> + <Require-Bundle>com.vaadin.external.atmosphere.runtime;bundle-version="${atmosphere.runtime.version}";visibility:=reexport</Require-Bundle> + </instructions> + </configuration> + <executions> + <execution> + <id>bundle-manifest</id> + <phase>process-classes</phase> + <goals> + <goal>manifest</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.6</version> + <configuration> + <archive> + <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> + <index>false</index> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings + only. It has no influence on the Maven build itself. --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId> + org.apache.maven.plugins + </groupId> + <artifactId> + maven-antrun-plugin + </artifactId> + <versionRange> + [1.8,) + </versionRange> + <goals> + <goal>run</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project>
\ No newline at end of file diff --git a/push/lib/jquery/jquery-1.11.0.js b/push/src/main/templates/jquery-1.11.0.js index 3c88fa8b7f..3c88fa8b7f 100644 --- a/push/lib/jquery/jquery-1.11.0.js +++ b/push/src/main/templates/jquery-1.11.0.js diff --git a/push/src/main/templates/vaadinPush.js.tpl b/push/src/main/templates/vaadinPush.js.tpl new file mode 100644 index 0000000000..3b2fb788f9 --- /dev/null +++ b/push/src/main/templates/vaadinPush.js.tpl @@ -0,0 +1,10 @@ +(function(define) { +@jquery.js@ +window.jQueryVaadin = window.jQuery.noConflict(true); +(function(jQuery, undefined) { + @jquery.atmosphere.js@ +})(jQueryVaadin); +if (window.console) { + window.console.log("Vaadin push loaded"); +} +})(); |