David Olivier's Data Matrix improvements
[zxing.git] / zxing.appspot.com / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (C) 2008 ZXing authors
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9      http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
17 <project name="zxing.appspot.com" default="build">
18   <property file="../build.properties"/>
19
20   <!-- Properties -->
21   <property name="outdir" value="build"/>
22   <property name="outdir-site" value="${outdir}/site"/>
23   <property name="yaml-file" value="app.yaml"/>
24   <property name="redirect-script" value="redirect.py"/>
25   <property name="generator-package" value="com.google.zxing.web.generator.Generator"/>
26
27   <!-- Contains pre-built jars like gwt-incubator.jar -->
28   <property name="external-libs" value="generator/libs"/>
29
30   <!-- Create the output directories if they don't exist yet. -->
31   <target name="create-dirs">
32     <echo>Creating output directories if needed...</echo>
33     <mkdir dir="${outdir}"/>
34     <mkdir dir="${outdir-site}"/>
35   </target>
36
37   <!-- Generate the HTML and JS from the Java source. -->
38   <target name="compile" depends="create-dirs">
39     <java classname="com.google.gwt.dev.GWTCompiler" fork="true" failonerror="true">
40       <jvmarg value="-Xmx256M"/>
41       <classpath>
42         <pathelement path="generator/src"/>
43         <fileset dir="${GWT-home}" includes="*.jar"/>
44         <fileset dir="${external-libs}" includes="*.jar"/>
45       </classpath>
46       <arg line="-out ${outdir-site}"/>
47       <arg value="${generator-package}"/>
48     </java>
49   </target>
50
51   <!-- Part of copying all the needed pieces into ${outdir-site} so it can be uploaded. -->
52   <target name="copy-static-files" depends="create-dirs">
53     <echo>Copying static files...</echo>
54     <copy file="${yaml-file}" todir="${outdir}"/>
55     <copy file="${redirect-script}" todir="${outdir}"/>
56     <copy todir="${outdir-site}">
57       <fileset dir="static"/>
58     </copy>
59   </target>
60
61   <!--
62   The GWTCompiler adds the package name to the output directory, but we want to change that to
63   mirror the user-perceived site layout. We also want to rename the main HTML file.
64   -->
65   <target name="rename-generator" depends="compile">
66     <echo>Renaming generator output...</echo>
67     <move file="${outdir-site}/${generator-package}" tofile="${outdir-site}/generator"/>
68     <move file="${outdir-site}/generator/Generator.html" tofile="${outdir-site}/generator/index.html"/>
69   </target>
70
71   <target name="build" depends="compile,copy-static-files,rename-generator">
72
73   </target>
74
75   <target name="clean">
76     <delete dir="${outdir}"/>
77   </target>
78
79 </project>