aboutsummaryrefslogtreecommitdiffstats
path: root/build/package/build-widgetset.xml
blob: 79e7512658eeee3baf7f5434430c3d602fcbe22c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0"?>

<!-- 

Client-side code is compiled by using GWTCompiler which compiles client-side Java code into
JavaScript. Generated files are located under WebContent/ITMILL/widgetsets/*.

Client-side compilation is required if you create new or modify existing widgets.
You may use either this script or IT Mill Toolkit Hosted Mode.launch (in Eclipse)
to compile your client-side java code. 

By default IT Mill Toolkit first tries to serve widgetset resources from the file system, if that
fails then files are streamed from itmill-toolkit-<version>.jar. 

See configure target to adjust this buildfile.

-->

<project name="Widgetset compile example" basedir="." default="compile-widgetset">

	<!-- 
		Update based on your project structure, by default this buildfile assumes that you 
		1. use WebContent under your project's root directory
		2. WebContent/WEB-INF/lib/itmill-toolkit-<version>.jar exists
		3. WebContent/WEB-INF/src contains your project source files
		4. gwt directory contains extracted GWT distribution for your platform (windows, linux or mac)
	-->
	<target name="configure">
		
		<!-- Path from this file to the root of the toolkit distribution package -->
		<property name="base" value="../../../" />
		
		<!-- which platform we are in, possible values are windows, linux and mac -->
		<property name="gwt-platform" value="@platform@" />
		
		<!-- where platform specific GWT distribution is located -->
		<property name="gwt-location" value="${base}gwt" />
		
		<!-- where Toolkit jar is located -->
		<property name="toolkit-jar-location" value="${base}WebContent/WEB-INF/lib/itmill-toolkit-@version@.jar" />
		
		<!-- where project client-side widgetset source files are located -->
		<property name="client-side-src-location" value="${base}WebContent/WEB-INF/src" />
			
		<!-- where to generate compiled javascript and theme files -->
		<property name="client-side-destination" value="${base}WebContent/ITMILL/widgetsets" />
	</target>
		
	<target name="init" depends="configure">

		<echo>Configured for ${gwt-platform} platform.</echo>
		<echo>Requirements for classpath:</echo>
		<echo>  ${gwt-location}/gwt-dev-${gwt-platform}.jar</echo>
		<echo>  ${gwt-location}/gwt-user.jar</echo>
		<echo>  ${toolkit-jar-location}</echo>
		<echo>  ${client-side-src-location}</echo>
		<echo>Output will be written into ${client-side-destination}</echo>

		<!-- Check that files exist -->
		<fail message="Some of the required files (listed above) are missing.">
			<condition><not><resourcecount count="3">
				<filelist files="${gwt-location}/gwt-dev-${gwt-platform}.jar,${gwt-location}/gwt-user.jar,${toolkit-jar-location}"/>
			</resourcecount></not></condition>
		</fail>

		<!-- Construct and check classpath -->
		<path id="compile.classpath">
			<pathelement path="${client-side-src-location}" />
			<pathelement path="${toolkit-jar-location}" />
			<pathelement path="${gwt-location}/gwt-user.jar" />
			<pathelement path="${gwt-location}/gwt-dev-${gwt-platform}.jar" />
		</path>
	</target>
	
	<!-- NOTE: Modify this example to compile your own widgetset  -->
	<target name="compile-widgetset" depends="init">
		<echo>Compiling com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet.</echo>
		<echo>Modify this example ant-script to compile your own widgetsets.</echo>
		<java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="-out" />
			<arg value="${client-side-destination}" />
			<arg value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet" />
            <jvmarg value="-Xss1024k"/>
            <jvmarg value="-Djava.awt.headless=true"/>
			<classpath>
				<path refid="compile.classpath"/>
			</classpath>
		</java>
	</target>

</project>