| 1 | <?xml version="1.0"?> |
|---|
| 2 | |
|---|
| 3 | <!-- |
|---|
| 4 | |
|---|
| 5 | Client-side code is compiled by using GWTCompiler which compiles client-side Java code into |
|---|
| 6 | JavaScript. Generated files are located under WebContent/ITMILL/widgetsets/*. |
|---|
| 7 | |
|---|
| 8 | Client-side compilation is required if you create new or modify existing widgets. |
|---|
| 9 | You may use either this script or IT Mill Toolkit Hosted Mode.launch (in Eclipse) |
|---|
| 10 | to compile your client-side java code. |
|---|
| 11 | |
|---|
| 12 | By default IT Mill Toolkit first tries to serve widgetset resources from the file system, if that |
|---|
| 13 | fails then files are streamed from itmill-toolkit-5.3.0-rc9.jar. |
|---|
| 14 | |
|---|
| 15 | See configure target to adjust this buildfile. |
|---|
| 16 | |
|---|
| 17 | --> |
|---|
| 18 | |
|---|
| 19 | <project name="Widgetset compile example" basedir="." default="compile-widgetset"> |
|---|
| 20 | |
|---|
| 21 | <!-- |
|---|
| 22 | Update based on your project structure, by default this buildfile assumes that you |
|---|
| 23 | 1. use WebContent under your project's root directory |
|---|
| 24 | 2. WebContent/WEB-INF/lib/itmill-toolkit-5.3.0-rc9.jar exists |
|---|
| 25 | 3. WebContent/WEB-INF/src contains your project source files |
|---|
| 26 | 4. gwt directory contains extracted GWT distribution for your platform (windows, linux or mac) |
|---|
| 27 | --> |
|---|
| 28 | <target name="configure"> |
|---|
| 29 | |
|---|
| 30 | <!-- Path from this file to the root of the toolkit distribution package --> |
|---|
| 31 | <property name="base" value="" /> |
|---|
| 32 | |
|---|
| 33 | <!-- which platform we are in, possible values are windows, linux and mac --> |
|---|
| 34 | <property name="gwt-platform" value="oophm" /> |
|---|
| 35 | |
|---|
| 36 | <!-- where platform specific GWT distribution is located --> |
|---|
| 37 | <property name="gwt-location" value="${base}gwt" /> |
|---|
| 38 | |
|---|
| 39 | <!-- where Toolkit jar is located --> |
|---|
| 40 | <property name="toolkit-jar-location" value="${base}WebContent/WEB-INF/lib/itmill-toolkit-5.3.0.jar" /> |
|---|
| 41 | |
|---|
| 42 | <!-- where project client-side widgetset source files are located --> |
|---|
| 43 | <property name="client-side-src-location" value="${base}WebContent/WEB-INF/src" /> |
|---|
| 44 | |
|---|
| 45 | <!-- where to generate compiled javascript and theme files --> |
|---|
| 46 | <property name="client-side-destination" value="${base}WebContent/ITMILL/widgetsets" /> |
|---|
| 47 | </target> |
|---|
| 48 | |
|---|
| 49 | <target name="init" depends="configure"> |
|---|
| 50 | |
|---|
| 51 | <echo>Configured for ${gwt-platform} platform.</echo> |
|---|
| 52 | <echo>Requirements for classpath:</echo> |
|---|
| 53 | <echo> ${gwt-location}/gwt-dev-${gwt-platform}.jar</echo> |
|---|
| 54 | <echo> ${gwt-location}/gwt-user.jar</echo> |
|---|
| 55 | <echo> ${toolkit-jar-location}</echo> |
|---|
| 56 | <echo> ${client-side-src-location}</echo> |
|---|
| 57 | <echo>Output will be written into ${client-side-destination}</echo> |
|---|
| 58 | |
|---|
| 59 | <!-- Check that files exist --> |
|---|
| 60 | <fail message="Some of the required files (listed above) are missing."> |
|---|
| 61 | <condition><not><resourcecount count="3"> |
|---|
| 62 | <filelist files="${gwt-location}/gwt-dev-${gwt-platform}.jar,${gwt-location}/gwt-user.jar,${toolkit-jar-location}"/> |
|---|
| 63 | </resourcecount></not></condition> |
|---|
| 64 | </fail> |
|---|
| 65 | |
|---|
| 66 | <!-- Construct and check classpath --> |
|---|
| 67 | <path id="compile.classpath"> |
|---|
| 68 | <pathelement path="${client-side-src-location}" /> |
|---|
| 69 | <pathelement path="${toolkit-jar-location}" /> |
|---|
| 70 | <pathelement path="${gwt-location}/gwt-user.jar" /> |
|---|
| 71 | <pathelement path="${gwt-location}/gwt-dev-${gwt-platform}.jar" /> |
|---|
| 72 | </path> |
|---|
| 73 | </target> |
|---|
| 74 | |
|---|
| 75 | <!-- NOTE: Modify this example to compile your own widgetset --> |
|---|
| 76 | <target name="compile-widgetset" depends="init"> |
|---|
| 77 | <echo>Compiling SimpleGestureWidgetSet.</echo> |
|---|
| 78 | <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="256m"> |
|---|
| 79 | <arg value="-out" /> |
|---|
| 80 | <arg value="${client-side-destination}" /> |
|---|
| 81 | <arg value="com.itmill.incubator.simplegesture.gwt.SimpleGestureWidgetSet" /> |
|---|
| 82 | <jvmarg value="-Xss1024k"/> |
|---|
| 83 | <classpath> |
|---|
| 84 | <path refid="compile.classpath"/> |
|---|
| 85 | </classpath> |
|---|
| 86 | </java> |
|---|
| 87 | </target> |
|---|
| 88 | |
|---|
| 89 | </project> |
|---|