]> source.dussan.org Git - vaadin-framework.git/commitdiff
Build vaadin-client-compiled with maven
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Tue, 22 Mar 2016 15:19:19 +0000 (17:19 +0200)
committerTeemu Suo-Anttila <teemusa@vaadin.com>
Sun, 27 Mar 2016 19:15:02 +0000 (22:15 +0300)
Change-Id: I91ef39fec1244fdeff1ee269be39ae7800a495b3

.gitignore
client-compiled/build.xml [deleted file]
client-compiled/pom.xml [new file with mode: 0644]
ivysettings.xml
liferay/ivy.xml
pom.xml
uitest/ivy.xml

index aae0204ab74a31082123cfdd0c915948ac00932f..9237104b65492c039885138d11156511cb578e28 100644 (file)
@@ -90,6 +90,7 @@ server/target/
 client/target/
 client-compiler/target/
 buildhelpers/target/
+client-compiled/target/
 
 .sass-cache
 phantomjsdriver.log
diff --git a/client-compiled/build.xml b/client-compiled/build.xml
deleted file mode 100644 (file)
index bbcfc7b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="vaadin-client-compiled" basedir="." default="publish-local"
-    xmlns:ivy="antlib:org.apache.ivy.ant">
-    <description>
-        Compiled (JS+HTML) version of client side
-    </description>
-
-    <include file="../common.xml" as="common" />
-    <include file="../build.xml" as="vaadin" />
-    <include file="../gwt-files.xml" as="gwtfiles" />
-
-    <!-- global properties -->
-    <property name="module.name" value="vaadin-client-compiled" />
-    <property name="module.symbolic" value="com.vaadin.client-compiled" />
-    <property name="result.dir" value="result" />
-    <property name="gwtar.dir" location="${result.dir}/gwtar" />
-    <property name="work.dir" location="${result.dir}/work" />
-    <property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
-    <property name="compiled.jar"
-        location="${result.dir}/lib/${module.name}-${vaadin.version}.jar" />
-    <property name="compiled-cache.jar"
-        location="${result.dir}/lib/${module.name}-cache-${vaadin.version}.jar" />
-
-    <union id="jar.includes">
-        <fileset dir="${result.dir}">
-            <include name="VAADIN/widgetsets/com.vaadin*/**" />
-        </fileset>
-    </union>
-
-    <target name="default-widgetset-cache">
-        <antcall target="compile-module-cache">
-            <param name="module" value="com.vaadin.DefaultWidgetSet" />
-        </antcall>
-    </target>
-
-    <target name="default-widgetset">
-        <antcall target="compile-module">
-            <param name="module" value="com.vaadin.DefaultWidgetSet" />
-        </antcall>
-    </target>
-
-
-    <target name="compile-module-cache">
-        <fail unless="module"
-            message="You must give the module to compile in the 'module' parameter" />
-        <ivy:resolve log="download-only" resolveid="common"
-            conf="compile-module" />
-        <ivy:cachepath pathid="classpath.compile.widgetset"
-            conf="compile-module" />
-        <echo>Creating gwtar files for ${module} in ${gwtar.dir}</echo>
-
-        <!-- Produce gwtar files for the separate JAR -->
-        <java classname="com.google.gwt.dev.CompileModule"
-            classpathref="classpath.compile.widgetset" failonerror="yes"
-            fork="yes" maxmemory="512m">
-            <arg value="-out" />
-            <arg value="${gwtar.dir}" />
-            <arg value="-strict" />
-            <arg value="${module}" />
-
-            <jvmarg value="-Xss8M" />
-            <jvmarg value="-XX:MaxPermSize=256M" />
-            <jvmarg value="-Djava.awt.headless=true" />
-        </java>
-    </target>
-
-    <target name="compile-module">
-        <fail unless="module"
-            message="You must give the module to compile in the 'module' parameter" />
-        <property name="style" value="OBF" />
-        <property name="localWorkers" value="6" />
-        <property name="extraParams" value="" />
-
-        <ivy:resolve log="download-only" resolveid="common"
-            conf="compile-module" />
-        <ivy:cachepath pathid="classpath.compile.widgetset"
-            conf="compile-module" />
-
-        <mkdir dir="${module.output.dir}" />
-
-        <echo>Compiling ${module} to ${module.output.dir}</echo>
-
-        <!-- compile the module -->
-        <java classname="com.google.gwt.dev.Compiler" classpathref="classpath.compile.widgetset"
-            failonerror="yes" fork="yes" maxmemory="512m">
-            <classpath location="${compiled-cache.jar}" />
-            <arg value="-workDir" />
-            <arg value="${work.dir}" />
-            <arg value="-logLevel" />
-            <arg value="TRACE" />
-            <arg value="-war" />
-            <arg value="${module.output.dir}" />
-            <arg value="-style" />
-            <arg value="${style}" />
-
-            <arg value="-localWorkers" />
-            <arg value="${localWorkers}" />
-            <arg value="-strict" />
-            <!-- Disabled for now as it breaks code, e.g. ButtonWithShortcutNotRendered -->
-            <!-- <arg value="-XenableClosureCompiler" /> -->
-            <arg line="${extraParams}" />
-            <arg value="${module}" />
-
-            <sysproperty key="vFailIfNotSerializable" value="true" />
-
-            <jvmarg value="-Xss8M" />
-            <jvmarg value="-XX:MaxPermSize=256M" />
-            <jvmarg value="-Djava.awt.headless=true" />
-        </java>
-
-    </target>
-
-    <target name="client-compiled-cache.jar" depends="default-widgetset-cache">
-        <jar file="${compiled-cache.jar}" compress="true">
-            <fileset dir="${gwtar.dir}">
-                <include name="**/*.gwtar" />
-            </fileset>
-            <union refid="client-compiled-cache.gwt.includes" />
-            <!-- <fileset dir="${common.jarfiles.dir}" /> -->
-        </jar>
-    </target>
-
-    <target name="jar" depends="default-widgetset">
-        <antcall target="common.jar">
-            <param name="osgi.extra.package.prefixes" value="VAADIN/widgetsets/" />
-            <param name="osgi.includeNumberPackages" value="1" />
-            <reference torefid="extra.jar.includes" refid="jar.includes" />
-        </antcall>
-    </target>
-
-    <target name="publish-local" depends="jar">
-        <antcall target="common.publish-local">
-            <param name="conf" value="build" />
-        </antcall>
-    </target>
-
-    <target name="clean">
-        <antcall target="common.clean" />
-    </target>
-
-    <target name="checkstyle">
-        <echo>No java files in module</echo>
-    </target>
-    <target name="test" depends="checkstyle">
-        <!--<antcall target="common.test.run" /> -->
-        <echo>WHAT? No tests for ${module.name}!</echo>
-    </target>
-
-</project>
diff --git a/client-compiled/pom.xml b/client-compiled/pom.xml
new file mode 100644 (file)
index 0000000..da664fb
--- /dev/null
@@ -0,0 +1,180 @@
+<?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-root</artifactId>
+               <version>7.7.0-SNAPSHOT</version>
+       </parent>
+       <groupId>com.vaadin</groupId>
+       <artifactId>vaadin-client-compiled</artifactId>
+       <name>vaadin-client-compiled</name>
+       <packaging>jar</packaging>
+
+       <properties>
+               <widgetset.name>com.vaadin.DefaultWidgetSet</widgetset.name>
+               <widgetset.style>OBF</widgetset.style>
+               <widgetset.local.workers>6</widgetset.local.workers>
+       </properties>
+
+       <organization>
+               <name>Vaadin Ltd</name>
+       </organization>
+       <url>https://vaadin.com/</url>
+       <description>Vaadin client compiled</description>
+
+       <dependencies>
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>vaadin-server</artifactId>
+                       <version>${project.version}</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>vaadin-client</artifactId>
+                       <version>${project.version}</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>vaadin-client-compiler</artifactId>
+                       <version>${project.version}</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>${project.groupId}</groupId>
+                       <artifactId>vaadin-buildhelpers</artifactId>
+                       <version>${project.version}</version>
+                       <scope>provided</scope>
+               </dependency>
+       </dependencies>
+
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>exec-maven-plugin</artifactId>
+                               <version>1.4.0</version>
+                               <executions>
+                                       <execution>
+                                               <phase>generate-resources</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <classpathScope>compile</classpathScope>
+                                                       <executable>${java.home}/bin/java</executable>
+                                                       <arguments>
+                                                               <!-- TODO: Do we need these? -->
+                                                               <!-- <jvmarg value="-Xss8M" /> -->
+                                                               <!-- <jvmarg value="-XX:MaxPermSize=256M" /> -->
+                                                               <!-- <jvmarg value="-Djava.awt.headless=true" /> -->
+                                                               <argument>-Dgwt.persistentunitcachedir=${project.build.directory}/compile</argument>
+                                                               <argument>-DvFailIfNotSerializable=true</argument>
+
+                                                               <argument>-classpath</argument>
+                                                               <classpath />
+
+                                                               <argument>com.google.gwt.dev.Compiler</argument>
+
+                                                               <argument>-workDir</argument>
+                                                               <argument>${project.build.directory}/compile</argument>
+                                                               <argument>-logLevel</argument>
+                                                               <argument>TRACE</argument>
+                                                               <argument>-war</argument>
+                                                               <!-- This will write the result directly to target/classes for packaging -->
+                                                               <argument>${project.build.outputDirectory}/VAADIN/widgetsets/</argument>
+                                                               <argument>-style</argument>
+                                                               <argument>${widgetset.style}</argument>
+                                                               <argument>-localWorkers</argument>
+                                                               <argument>${widgetset.local.workers}</argument>
+
+                                                               <argument>-strict</argument>
+
+                                                               <!-- Move unnecessary stuff to compile folder -->
+                                                               <argument>-deploy</argument>
+                                                               <argument>${project.build.directory}/compile</argument>
+                                                               <argument>-extra</argument>
+                                                               <argument>${project.build.directory}/compile</argument>
+
+                                                               <argument>${widgetset.name}</argument>
+                                                       </arguments>
+                                               </configuration>
+                                       </execution>
+
+                                       <execution>
+                                               <id>generate-export-package</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <classpathScope>compile</classpathScope>
+                                                       <executable>${java.home}/bin/java</executable>
+                                                       <arguments>
+                                                               <argument>-Dvaadin.version=${project.version}</argument>
+                                                               <argument>-DincludeNumberPackages=1</argument>
+
+                                                               <argument>-classpath</argument>
+                                                               <classpath />
+
+                                                               <argument>com.vaadin.buildhelpers.GeneratePackageExports</argument>
+
+                                                               <argument>${project.build.directory}/${project.build.finalName}.${project.packaging}</argument>
+                                                               <argument>VAADIN/widgetsets</argument>
+                                                       </arguments>
+                                               </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 is handled in exec plugin -->
+                                               <Export-Package></Export-Package>
+                                               <Import-Package></Import-Package>
+                                       </instructions>
+                               </configuration>
+                               <executions>
+                                       <execution>
+                                               <id>bundle-manifest</id>
+                                               <phase>prepare-package</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>
+                                       <excludes>
+                                               <exclude>VAADIN/widgetsets/WEB-INF</exclude>
+                                       </excludes>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+
+</project>
index 9cf0e75720b16a0be688be22b24a27b36ce3c1c2..860d39fa759c8946f7d4f9dbf4ab0a74b4b22834 100644 (file)
@@ -48,7 +48,7 @@
         <module organisation="com.vaadin" name="vaadin-client-compiler"
             resolver="local-maven" />
         <module organisation="com.vaadin" name="vaadin-client-compiled"
-            resolver="build-temp" />
+            resolver="local-maven" />
         <module organisation="com.vaadin" name="vaadin-themes"
             resolver="build-temp" />
         <module organisation="com.vaadin" name="vaadin-push"
index 9a26f80b4e482b7a891d3283e9a5a27794f7314f..1a1427a723ca13e384684950ecbf01364aa77720 100644 (file)
@@ -18,7 +18,7 @@
 
     <dependencies>
         <dependency org="com.vaadin" name="vaadin-client-compiled"
-            rev="${vaadin.version}" conf="deps -> build" transitive="false"/>
+            rev="${vaadin.version}" conf="deps -> default" transitive="false"/>
         <dependency org="com.vaadin" name="vaadin-themes"
             rev="${vaadin.version}" conf="deps -> build" transitive="false"/>
         <dependency org="com.vaadin" name="vaadin-push"
diff --git a/pom.xml b/pom.xml
index 300d7d75d476b169b09ffd7e612e6df38fe04ad3..86f7676d9c48404f16cd079e0e2246a8c670b16c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -58,6 +58,7 @@
                <module>server</module>
                <module>client</module>
                <module>client-compiler</module>
+               <module>client-compiled</module>
        </modules>
 
        <build>
index 7a7df5a81f1a8e082a92fd85a413f2509284e776..6ae49b7d9480f062c7aee8ef099dec66cc1f447d 100644 (file)
@@ -46,7 +46,7 @@
             <exclude type="pom" />
         </dependency>
         <dependency org="com.vaadin" name="vaadin-client-compiled"
-            rev="${vaadin.version}" conf="build->build">
+            rev="${vaadin.version}" conf="build->default">
             <exclude type="pom" />
         </dependency>
         <dependency org="com.vaadin" name="vaadin-themes"