1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <!--************************************************************************* |
---|
3 | Filename : build.xml |
---|
4 | Project : proj4js |
---|
5 | Document Type : XML |
---|
6 | Purpose : build file for ant tool |
---|
7 | |
---|
8 | Author Date Description |
---|
9 | M.Adair 17-Dec-2001 initial version copied from mapbuilder |
---|
10 | |
---|
11 | $Id: build.xml 2955 2007-07-09 12:12:27Z steven $ |
---|
12 | ***************************************************************************--><!-- |
---|
13 | --> |
---|
14 | <!-- A "project" describes a set of targets that may be requested |
---|
15 | when Ant is executed. The "default" attribute defines the |
---|
16 | target which is executed if no specific target is requested, |
---|
17 | and the "basedir" attribute defines the current working directory |
---|
18 | from which Ant executes the requested task. This is normally |
---|
19 | set to the current working directory. |
---|
20 | --> |
---|
21 | <project basedir=".." default="dist" name="proj4js"> |
---|
22 | |
---|
23 | <!-- ===================== Property Definitions =========================== --> |
---|
24 | <!-- |
---|
25 | Each of the following properties are used in the build script. |
---|
26 | Values for these properties are set by the first place they are |
---|
27 | defined, from the following list: |
---|
28 | |
---|
29 | * Definitions on the "ant" command line (ant -Dfoo=bar compile). |
---|
30 | |
---|
31 | * Definitions from a "build.properties" file in the top level |
---|
32 | source directory of this application. |
---|
33 | |
---|
34 | * Definitions from a "build.properties" file in the developer's |
---|
35 | home directory. |
---|
36 | |
---|
37 | * Default definitions in this build.xml file. |
---|
38 | |
---|
39 | You will note below that property values can be composed based on the |
---|
40 | contents of previously defined properties. This is a powerful technique |
---|
41 | that helps you minimize the number of changes required when your development |
---|
42 | environment is modified. Note that property composition is allowed within |
---|
43 | "build.properties" files as well as in the "build.xml" script. |
---|
44 | --> |
---|
45 | <property file="build.properties"/> |
---|
46 | <property file="${user.home}/build.properties"/> |
---|
47 | <property file="default.properties"/> |
---|
48 | |
---|
49 | <!-- ==================== File and Directory Names ======================== --> |
---|
50 | <!-- |
---|
51 | |
---|
52 | These properties generally define file and directory names (or paths) that |
---|
53 | affect where the build process stores its outputs. |
---|
54 | |
---|
55 | app.name Base name of this application, used to |
---|
56 | construct filenames and directories. |
---|
57 | Defaults to "myapp". |
---|
58 | |
---|
59 | app.path Context path to which this application should be |
---|
60 | deployed (defaults to "/" plus the value of the |
---|
61 | "app.name" property). |
---|
62 | |
---|
63 | app.version Version number of this iteration of the application. |
---|
64 | |
---|
65 | build.home The directory into which the "prepare" and |
---|
66 | "compile" targets will generate their output. |
---|
67 | Defaults to "build". |
---|
68 | |
---|
69 | dist.home The name of the base directory in which |
---|
70 | distribution files are created. |
---|
71 | Defaults to "dist". |
---|
72 | --> |
---|
73 | |
---|
74 | <property environment="env"/> |
---|
75 | <property name="app.name" value="proj4js"/> |
---|
76 | <property name="app.path" value="/${app.name}"/> |
---|
77 | <property name="app.version" value="1.0.2"/> |
---|
78 | <property name="build.home" value="${basedir}/tempBuild"/> |
---|
79 | <property name="dist.home" value="${basedir}/dist"/> |
---|
80 | <property name="docs.home" value="${build.home}/docs"/> |
---|
81 | |
---|
82 | |
---|
83 | <!-- ==================== Prepare Target ================================== --> |
---|
84 | <!-- |
---|
85 | The "prepare" target is used to create the "build" destination directory, |
---|
86 | and copy the static contents of your web application to it. If you need |
---|
87 | to copy static files from external dependencies, you can customize the |
---|
88 | contents of this task. |
---|
89 | |
---|
90 | Normally, this task is executed indirectly when needed. |
---|
91 | |
---|
92 | --> |
---|
93 | |
---|
94 | <target name="prepare"> |
---|
95 | <!-- Create build directories as needed --> |
---|
96 | <mkdir dir="${build.home}"/> |
---|
97 | <!-- Copy static content of the mapbuilder project --> |
---|
98 | <copy todir="${build.home}"> |
---|
99 | <fileset dir="${basedir}" excludes="tools/*.pyc " |
---|
100 | includes="index.html |
---|
101 | lib/proj4js.js, |
---|
102 | lib/proj4js-combined.js |
---|
103 | lib/proj4js-compressed.js |
---|
104 | lib/defs/** |
---|
105 | lib/projCode/** |
---|
106 | build/** |
---|
107 | demo/** |
---|
108 | test/** |
---|
109 | tools/**" |
---|
110 | /> |
---|
111 | </copy> |
---|
112 | </target> |
---|
113 | |
---|
114 | |
---|
115 | <!-- ==================== Clean Target ==================================== --> |
---|
116 | <!-- |
---|
117 | |
---|
118 | The "clean" target deletes any previous "build" and "dist" directory, |
---|
119 | so that you can be ensured the application can be built from scratch. |
---|
120 | |
---|
121 | --> |
---|
122 | |
---|
123 | <target description="Delete old build and dist directories" name="clean"> |
---|
124 | <delete dir="${build.home}"/> |
---|
125 | <delete dir="${dist.home}"/> |
---|
126 | </target> |
---|
127 | |
---|
128 | |
---|
129 | <!-- ==================== Documentation =================================== --> |
---|
130 | |
---|
131 | <target description="Create documentation" name="docs" depends="prepare"> |
---|
132 | |
---|
133 | <mkdir dir="${build.home}/docs"/> |
---|
134 | <mkdir dir="${build.home}/docs/NaturalDocs"/> |
---|
135 | |
---|
136 | <echo message="Generating documentation"/> |
---|
137 | <exec executable="cmd" os="Windows XP" dir="${build.home}"> |
---|
138 | <arg line="/c perl C:\Progra~1\NaturalDocs\NaturalDocs -i ./lib -o html ./docs/NaturalDocs -p ./docs/NaturalDocs -r"/> |
---|
139 | </exec> |
---|
140 | </target> |
---|
141 | |
---|
142 | |
---|
143 | <!-- ==================== Dist Target ===================================== --> |
---|
144 | <!-- |
---|
145 | The "dist" target creates the zip file distribution for the Apache/PHP |
---|
146 | environment. |
---|
147 | --> |
---|
148 | <target name="dist" description="Create binary distribution" depends="clean,prepare,docs"> |
---|
149 | |
---|
150 | <mkdir dir="${dist.home}"/> |
---|
151 | |
---|
152 | <!-- Create application zip file --> |
---|
153 | <zip destfile="${dist.home}/${app.name}-${app.version}.zip" update="true"> |
---|
154 | <zipfileset dir="${build.home}" prefix="proj4js"/> |
---|
155 | </zip> |
---|
156 | |
---|
157 | </target> |
---|
158 | |
---|
159 | </project> |
---|