summaryrefslogtreecommitdiffstats
path: root/build/package/build-widgetsets.xml
blob: 1e24a949e3eb0ad87840c93cd5d6d08de4b9c496 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?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="IT Mill Toolkit Widgetset" basedir="." default="compile-all-widgetsets">

	<!-- 
		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">
		<!-- which platform we are in, possible values are windows, linux and mac -->
		<property name="gwt-platform" value="<platform></platform>" />
		
		<!-- where platform specific GWT distribution is located -->
		<property name="gwt-location" value="gwt" />
		
		<!-- where Toolkit jar is located -->
		<property name="toolkit-jar-location" value="WebContent/WEB-INF/lib/itmill-toolkit-<version></version>.jar" />
		
		<!-- where project client-side widgetset source files are located -->
		<property name="client-side-src-location" value="WebContent/WEB-INF/src" />
			
		<!-- where to generate compiled javascript and theme files -->
		<property name="client-side-destination" value="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>
		<echo>Note, if you have created your own widgetset, please modify target compile-my-widgetset first.</echo>

		<!-- Construct 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: use this template to compile your own widgetset -->
	<target name="compile-my-widgetset" depends="init">
		<fail message="Please open build-widgetset.xml and update your widgetset's package name to enable this target" />
		<!-- remove upper fail message -->
		<java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="256m">
			<arg value="-out" />
			<arg value="${client-side-destination}" />
			<!-- NOTE: Update line below and tell package name to your own widgetset -->
			<arg value="com.myexample.gwt.MyWidgetSet" />
			<classpath>
				<path refid="compile.classpath"/>
			</classpath>
		</java>
	</target>
	
	<!-- NOTE: used only in demos, execute after changes to colorpicker demo's client-side source code  -->
	<target name="compile-colorpicker_demo-widgetset" depends="init">
		<echo>com.itmill.toolkit.demo.colorpicker.gwt.ColorPickerWidgetSet</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.itmill.toolkit.demo.colorpicker.gwt.ColorPickerWidgetSet" />
			<classpath>
				<path refid="compile.classpath"/>
			</classpath>
		</java>
	</target>
	
	<!-- NOTE: used only in demos, execute changes to reservation demo's client-side source code -->
	<target name="compile-reservation_demo-widgetset" depends="init">
		<echo>com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet</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.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet" />
			<classpath>
				<path refid="compile.classpath"/>
				<pathelement location="WebContent/demo/lib/reservr/gwt-maps.jar" />
			</classpath>
		</java>
	</target>
	
	<!-- NOTE: only required if you extract Toolkit sources and change default widgetset -->
	<target name="compile-default-widgetset" depends="init">
		<echo>com.itmill.toolkit.terminal.gwt.DefaultWidgetSet</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.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
			<classpath>
				<path refid="compile.classpath"/>
			</classpath>
		</java>
	</target>
	
	<target name="compile-all-widgetsets" depends="compile-default-widgetset, compile-colorpicker_demo-widgetset, compile-reservation_demo-widgetset" />
	
</project>