1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <project name="Compile Vaadin Widgetset" default="compile-widgetset" basedir="."> |
---|
3 | <description>Compiles a combined widgetset of all Vaadin widgetsets found on the classpath.</description> |
---|
4 | |
---|
5 | <!-- |
---|
6 | Important notice!! |
---|
7 | This Ant script depends on the NetBeans project specific build-impl.xml |
---|
8 | file. If you want to use this script in some other environment, you need |
---|
9 | to manually create init and compile targets and define required properties. |
---|
10 | |
---|
11 | See also http://demo.vaadin.com/docs/example-source/build-widgetset.xml |
---|
12 | for another example script. |
---|
13 | --> |
---|
14 | <import file="nbproject/build-impl.xml"/> |
---|
15 | |
---|
16 | <target name="widgetset-init"> |
---|
17 | <!-- Name of the widget set --> |
---|
18 | <property name="widgetset" value="serpro.mailarchiver.config.MailArchiverWidgetSet"/> |
---|
19 | |
---|
20 | <!-- Path to the widgetset directory. Required only for --> |
---|
21 | <!-- generated widget sets. Must be relative to --> |
---|
22 | <!-- $src.dir, that is, under the first entry in --> |
---|
23 | <!-- classpath. --> |
---|
24 | <property name="widgetset-path" value="serpro/mailarchiver/config"/> |
---|
25 | |
---|
26 | <!-- Target where to compile the widget set --> |
---|
27 | <property name="client-side-destination" value="src/serpro/mailarchiver/config/webroot/admin/VAADIN/widgetsets"/> |
---|
28 | |
---|
29 | <!-- Define if the widget set be generated automatically --> |
---|
30 | <!-- from all widget sets included in the class path. --> |
---|
31 | <property name="generate.widgetset" value="1"/> |
---|
32 | </target> |
---|
33 | |
---|
34 | |
---|
35 | <!-- Generates a combined widget set from all widget --> |
---|
36 | <!-- sets in the class path, including project sources. --> |
---|
37 | <!-- Updates the configuration if it already exists. --> |
---|
38 | <target name="generate-widgetset" depends="widgetset-init, compile" if="generate.widgetset"> |
---|
39 | <echo>Updating ${widgetset}...</echo> |
---|
40 | <echo>Remember to define the widgetset in web.xml as follows.</echo> |
---|
41 | <echo> |
---|
42 | <init-param> |
---|
43 | <param-name>widgetset</param-name> |
---|
44 | <param-value>${widgetset}</param-value> |
---|
45 | </init-param> |
---|
46 | </echo> |
---|
47 | |
---|
48 | <!-- Create the directory if it does not already exist. --> |
---|
49 | <mkdir dir="${src.dir}/${widgetset-path}"/> |
---|
50 | |
---|
51 | <java classname="com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder" failonerror="yes" fork="yes" maxmemory="256m"> |
---|
52 | <arg value="${widgetset}"/> |
---|
53 | <jvmarg value="-Xss1024k"/> |
---|
54 | <jvmarg value="-Djava.awt.headless=true"/> |
---|
55 | <classpath> |
---|
56 | <pathelement path="${src.dir}" /> |
---|
57 | <pathelement path="${javac.classpath}" /> |
---|
58 | <pathelement path="${build.web.dir}/WEB-INF/classes" /> |
---|
59 | </classpath> |
---|
60 | </java> |
---|
61 | </target> |
---|
62 | |
---|
63 | <!-- Compiles the widget set using the GWT compiler. --> |
---|
64 | <target name="compile-widgetset" depends="init, widgetset-init, generate-widgetset"> |
---|
65 | <echo>Compiling ${widgetset} into ${client-side-destination} directory...</echo> |
---|
66 | |
---|
67 | <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="256m"> |
---|
68 | <arg value="-war" /> |
---|
69 | <arg value="${client-side-destination}" /> |
---|
70 | <arg value="${widgetset}" /> |
---|
71 | <jvmarg value="-Xss1024k"/> |
---|
72 | <jvmarg value="-Djava.awt.headless=true"/> |
---|
73 | <classpath> |
---|
74 | <pathelement path="${src.dir}" /> |
---|
75 | <pathelement path="${javac.classpath}" /> |
---|
76 | <pathelement path="${build.web.dir}/WEB-INF/classes" /> |
---|
77 | </classpath> |
---|
78 | </java> |
---|
79 | </target> |
---|
80 | |
---|
81 | </project> |
---|