gwt.team.scottb | 14c5b9d | 2006-12-10 06:06:08 +0000 | [diff] [blame] | 1 | <project name="samples-common"> |
| 2 | <property name="gwt.root" location="../.." /> |
| 3 | <property name="project.tail" value="samples/${sample.root}" /> |
| 4 | <import file="${gwt.root}/common.ant.xml" /> |
| 5 | |
| 6 | <property name="sample.package" value="${sample.root}" /> |
| 7 | <property name="sample.main" value="${sample.module}" /> |
| 8 | |
| 9 | <property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" /> |
| 10 | <!-- Platform shouldn't matter here, just picking one --> |
| 11 | <property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-linux.jar" /> |
| 12 | |
| 13 | <target name="compile" description="Compile all java files"> |
| 14 | <mkdir dir="${javac.out}" /> |
| 15 | <gwt.javac> |
| 16 | <classpath> |
| 17 | <pathelement location="${gwt.user.jar}" /> |
| 18 | <pathelement location="${gwt.dev.jar}" /> |
| 19 | </classpath> |
| 20 | </gwt.javac> |
| 21 | </target> |
| 22 | |
| 23 | <target name="gwtc" description="Compile to JavaScript"> |
| 24 | <mkdir dir="${project.build}/www" /> |
| 25 | <java dir="${project.build}" classname="com.google.gwt.dev.GWTCompiler" classpath="src:${gwt.user.jar}:${gwt.dev.jar}" fork="yes" failonerror="true"> |
| 26 | <classpath> |
| 27 | <pathelement location="${src}" /> |
| 28 | <pathelement location="${gwt.user.jar}" /> |
| 29 | <pathelement location="${gwt.dev.jar}" /> |
| 30 | </classpath> |
| 31 | <arg value="-out" /> |
| 32 | <arg file="${project.build}/www" /> |
| 33 | <arg value="com.google.gwt.sample.${sample.package}.${sample.module}" /> |
| 34 | </java> |
| 35 | </target> |
| 36 | |
| 37 | <target name="antcall.script" description="Create launch scripts for a particular platform"> |
| 38 | <mkdir dir="${project.build}/scripts/${platform}" /> |
| 39 | <java classname="com.google.gwt.user.tools.ApplicationCreator" classpath="${gwt.user.jar}:${gwt.dev.jar}" failonerror="true"> |
| 40 | <!-- Relative path is important! Paths will be relative in final distro --> |
| 41 | <sysproperty key="gwt.devjar" value="../../gwt-dev-${platform}.jar" /> |
| 42 | <arg value="-ignore" /> |
| 43 | <arg value="-out" /> |
| 44 | <arg file="${project.build}/scripts/${platform}" /> |
| 45 | <arg value="com.google.gwt.sample.${sample.package}.client.${sample.main}" /> |
| 46 | </java> |
| 47 | </target> |
| 48 | |
| 49 | <target name="scripts" description="Create launch scripts"> |
| 50 | <antcall target="antcall.script"> |
| 51 | <param name="platform" value="linux" /> |
| 52 | </antcall> |
| 53 | <antcall target="antcall.script"> |
| 54 | <param name="platform" value="windows" /> |
| 55 | </antcall> |
| 56 | <antcall target="antcall.script"> |
| 57 | <param name="platform" value="mac" /> |
| 58 | </antcall> |
| 59 | </target> |
| 60 | |
| 61 | <target name="build" depends="compile, gwtc, scripts" description="Build and package this project" /> |
| 62 | |
| 63 | <target name="checkstyle" description="Static analysis of source"> |
| 64 | <gwt.checkstyle> |
| 65 | <fileset dir="src"/> |
| 66 | </gwt.checkstyle> |
| 67 | </target> |
| 68 | </project> |