gvsig-raster / org.gvsig.raster.tools / trunk / templates / rasterTaskProjectTemplate / basictask.xml @ 9681
History | View | Annotate | Download (10.1 KB)
1 | 1843 | nbrodin | <project name="Basic task" default="fullbasictask" basedir="."> |
---|---|---|---|
2 | <property name="basetemplatedir" value="alg_template"/> |
||
3 | |||
4 | <target name="fullbasictask" |
||
5 | 1870 | nbrodin | description="Creates a raster task project with the sources for a full structure" |
6 | 1843 | nbrodin | depends="create-dirs, |
7 | 1870 | nbrodin | generate-translations,
|
8 | 1843 | nbrodin | generate-poms,
|
9 | generate-sources,
|
||
10 | create-config,
|
||
11 | 1981 | nbrodin | create-assembly,
|
12 | 1843 | nbrodin | create-library-launcher,
|
13 | create-buildnumber,
|
||
14 | create-images"
|
||
15 | />
|
||
16 | |||
17 | <target name="basictask" |
||
18 | 1870 | nbrodin | description="Creates a raster task project without the sources for other kind of projects" |
19 | 1843 | nbrodin | depends="create-dirs, |
20 | 1870 | nbrodin | generate-translations,
|
21 | 1843 | nbrodin | generate-poms,
|
22 | create-config,
|
||
23 | 1981 | nbrodin | create-assembly,
|
24 | 1843 | nbrodin | create-library-launcher,
|
25 | create-buildnumber,
|
||
26 | create-images"
|
||
27 | />
|
||
28 | |||
29 | <target name="checkos"> |
||
30 | <condition property="isWindows"> |
||
31 | <os family="windows" /> |
||
32 | </condition>
|
||
33 | |||
34 | <condition property="isLinux"> |
||
35 | <os family="unix" /> |
||
36 | </condition>
|
||
37 | </target>
|
||
38 | |||
39 | <!--************************************************-->
|
||
40 | <!--************* STRUCTURE ****************-->
|
||
41 | <!--************************************************-->
|
||
42 | |||
43 | <target name="create-dirs"> |
||
44 | <!--ALGORITHM-->
|
||
45 | <mkdir dir="${algorithm-srcdir}"/> |
||
46 | <mkdir dir="${base}.algorithm${testdir}/algorithm"/> |
||
47 | <mkdir dir="${algorithm-translationdir}"/> |
||
48 | <mkdir dir="${algorithm-metainfdir}"/> |
||
49 | <mkdir dir="${base}.algorithm${imagesactiondir}"/> |
||
50 | <mkdir dir="${base}.algorithm${imagescursordir}"/> |
||
51 | |||
52 | <!--PLUGIN-->
|
||
53 | 1981 | nbrodin | <mkdir dir="${assemblydir}"/> |
54 | 1843 | nbrodin | <mkdir dir="${app-srcdir}"/> |
55 | <mkdir dir="${base}.app/${dirplugin}.app.client${testdir}/app"/> |
||
56 | <mkdir dir="${app-translationdir}"/> |
||
57 | <mkdir dir="${base}.app/${dirplugin}.app.client${imagesactiondir}"/> |
||
58 | <mkdir dir="${base}.app/${dirplugin}.app.client${imagescursordir}"/> |
||
59 | 1981 | nbrodin | <mkdir dir="${base}.app/${dirplugin}.app.client${resourcesdir}"/> |
60 | 1843 | nbrodin | |
61 | <!--LIBRARY-->
|
||
62 | <mkdir dir="${libapi-srcdir}"/> |
||
63 | <mkdir dir="${base}.lib/${dirplugin}.lib.api${testdir}/lib"/> |
||
64 | <mkdir dir="${libapi-metainfdir}"/> |
||
65 | |||
66 | <mkdir dir="${libimpl-srcdir}"/> |
||
67 | <mkdir dir="${base}.lib/${dirplugin}.lib.impl${testdir}/lib/impl"/> |
||
68 | <mkdir dir="${libimpl-metainfdir}"/> |
||
69 | <mkdir dir="${lib-translationdir}"/> |
||
70 | |||
71 | <!--SWING-->
|
||
72 | <mkdir dir="${swingapi-srcdir}"/> |
||
73 | <mkdir dir="${base}.swing/${dirplugin}.swing.api${testdir}/swing"/> |
||
74 | <mkdir dir="${swingapi-metainfdir}"/> |
||
75 | |||
76 | <mkdir dir="${swingimpl-srcdir}"/> |
||
77 | <mkdir dir="${base}.swing/${dirplugin}.swing.impl${testdir}/swing/impl"/> |
||
78 | <mkdir dir="${swingimpl-metainfdir}"/> |
||
79 | <mkdir dir="${swing-translationdir}"/> |
||
80 | </target>
|
||
81 | 1870 | nbrodin | |
82 | <!--************************************************-->
|
||
83 | <!--************** TRANSLATION ****************-->
|
||
84 | <!--************************************************-->
|
||
85 | 1843 | nbrodin | |
86 | 1870 | nbrodin | <target name="generate-translations"> |
87 | 1843 | nbrodin | <property name="dest-dirs" value="algorithm-translationdir,app-translationdir,lib-translationdir,swing-translationdir"/> |
88 | |||
89 | <!--Para cada directorio de traducciones se crea un fichero de texto de cada idioma-->
|
||
90 | <for list="${dest-dirs}" param="destination"> |
||
91 | <sequential>
|
||
92 | <touch file = "${@{destination}}/text.properties"/> |
||
93 | <for list="${languages}" param="lan"> |
||
94 | <sequential>
|
||
95 | <touch file = "${@{destination}}/text_@{lan}.properties"/> |
||
96 | </sequential>
|
||
97 | </for>
|
||
98 | </sequential>
|
||
99 | </for>
|
||
100 | |||
101 | </target>
|
||
102 | |||
103 | <!--************************************************-->
|
||
104 | <!--******************* POM ****************-->
|
||
105 | <!--************************************************-->
|
||
106 | |||
107 | <target name="generate-poms"> |
||
108 | <property name="pom" value="${basetemplatedir}/pom"/> |
||
109 | |||
110 | <!--Copia del pom base -->
|
||
111 | <copy file="${pom}/base.xml" tofile="pom.xml" overwrite="yes"/> |
||
112 | <replace file="pom.xml" value="${project}"> |
||
113 | <replacefilter token="${tokenin1}"/> |
||
114 | </replace>
|
||
115 | <move file="pom.xml" todir="${dirplugin}" overwrite="yes"/> |
||
116 | |||
117 | <copy file="${pom}/app.client" tofile="pom.xml" overwrite="yes"/> |
||
118 | <replace file="pom.xml" value="${project}"> |
||
119 | <replacefilter token="${tokenin1}"/> |
||
120 | </replace>
|
||
121 | <move file="pom.xml" todir="${base}.app/${dirplugin}.app.client/" overwrite="yes"/> |
||
122 | |||
123 | <property name="pomlist" value="algorithm,app,lib,swing"/> |
||
124 | <for list="${pomlist}" param="suffix"> |
||
125 | <sequential>
|
||
126 | <copy file="${pom}/@{suffix}" tofile="pom.xml" overwrite="yes"/> |
||
127 | <replace file="pom.xml" value="${project}"> |
||
128 | <replacefilter token="${tokenin1}"/> |
||
129 | </replace>
|
||
130 | <move file="pom.xml" todir="${base}.@{suffix}" overwrite="yes"/> |
||
131 | </sequential>
|
||
132 | </for>
|
||
133 | |||
134 | <copy file="${pom}/swing.api" tofile="pom.xml" overwrite="yes"/> |
||
135 | <replace file="pom.xml" value="${project}"> |
||
136 | <replacefilter token="${tokenin1}"/> |
||
137 | </replace>
|
||
138 | <move file="pom.xml" todir="${base}.swing/${dirplugin}.swing.api/" overwrite="yes"/> |
||
139 | |||
140 | <copy file="${pom}/swing.impl" tofile="pom.xml" overwrite="yes"/> |
||
141 | <replace file="pom.xml" value="${project}"> |
||
142 | <replacefilter token="${tokenin1}"/> |
||
143 | </replace>
|
||
144 | <move file="pom.xml" todir="${base}.swing/${dirplugin}.swing.impl/" overwrite="yes"/> |
||
145 | |||
146 | <copy file="${pom}/lib.api" tofile="pom.xml" overwrite="yes"/> |
||
147 | <replace file="pom.xml" value="${project}"> |
||
148 | <replacefilter token="${tokenin1}"/> |
||
149 | </replace>
|
||
150 | <move file="pom.xml" todir="${base}.lib/${dirplugin}.lib.api/" overwrite="yes"/> |
||
151 | |||
152 | <copy file="${pom}/lib.impl" tofile="pom.xml" overwrite="yes"/> |
||
153 | <replace file="pom.xml" value="${project}"> |
||
154 | <replacefilter token="${tokenin1}"/> |
||
155 | </replace>
|
||
156 | <move file="pom.xml" todir="${base}.lib/${dirplugin}.lib.impl/" overwrite="yes"/> |
||
157 | </target>
|
||
158 | |||
159 | <!--************************************************-->
|
||
160 | <!--****************** SOURCES ****************-->
|
||
161 | <!--************************************************-->
|
||
162 | |||
163 | <target name="generate-sources"> |
||
164 | <property name="dirsrclist" value="algorithm,app,libapi,libimpl,swingapi,swingimpl"/> |
||
165 | |||
166 | <mkdir dir="tmp"/> |
||
167 | |||
168 | <for list="${dirsrclist}" param="dir"> |
||
169 | <sequential>
|
||
170 | <!--Copia fuentes a un temporal-->
|
||
171 | <copy todir="./tmp" overwrite="yes"> |
||
172 | <fileset dir="${basetemplatedir}/sources/@{dir}" includes="*.java"/> |
||
173 | </copy>
|
||
174 | |||
175 | <!--Reemplazo de cadenas-->
|
||
176 | <replace dir="tmp" value="${project}"> |
||
177 | <replacefilter token="${tokenin1}"/> |
||
178 | <replacefilter token="${tokenin2}" value="${token}"/> |
||
179 | </replace>
|
||
180 | |||
181 | <!--Cambio de nombre de ficheros-->
|
||
182 | <move todir="./tmp" includeemptydirs="false"> |
||
183 | <fileset dir="./tmp"/> |
||
184 | <mapper type="regexp" from="(.*)${tokenin2}(.*)$" to="\1${token}\2"/> |
||
185 | </move>
|
||
186 | |||
187 | <!--Mover a su sitio-->
|
||
188 | |||
189 | <move todir="${@{dir}-srcdir}" overwrite="yes"> |
||
190 | <fileset dir="tmp" includes="*.java"/> |
||
191 | </move>
|
||
192 | |||
193 | </sequential>
|
||
194 | </for>
|
||
195 | |||
196 | <delete dir="tmp"/> |
||
197 | </target>
|
||
198 | |||
199 | <!--************************************************-->
|
||
200 | <!--***************** CONFIG ***************-->
|
||
201 | <!--************************************************-->
|
||
202 | |||
203 | <target name="create-config"> |
||
204 | <copy file="${basetemplatedir}/config/config.xml" tofile="config.xml" overwrite="yes"/> |
||
205 | <replace file="config.xml" value="${project}"> |
||
206 | <replacefilter token="${tokenin1}"/> |
||
207 | <replacefilter token="${tokenin2}" value="${token}"/> |
||
208 | </replace>
|
||
209 | 1981 | nbrodin | <move file="config.xml" todir="${base}.app/${dirplugin}.app.client${resourcesplugindir}" overwrite="yes"/> |
210 | 1843 | nbrodin | </target>
|
211 | |||
212 | <!--************************************************-->
|
||
213 | 1981 | nbrodin | <!--************ ASSEMBLY **************-->
|
214 | 1843 | nbrodin | <!--************************************************-->
|
215 | |||
216 | 1981 | nbrodin | <target name="create-assembly"> |
217 | <property name="assembly" value="${basetemplatedir}/assembly"/> |
||
218 | 1843 | nbrodin | |
219 | 1981 | nbrodin | <copy file="${assembly}/app_client.xml" todir="${assemblydir}" overwrite="yes" /> |
220 | <move file="${assemblydir}/app_client.xml" tofile="${assemblydir}/gvsig-plugin-package.xml" /> |
||
221 | 1843 | nbrodin | |
222 | 1981 | nbrodin | <replace file="${assemblydir}/gvsig-plugin-package.xml" value="${project}"> |
223 | 1843 | nbrodin | <replacefilter token="${tokenin1}"/> |
224 | <replacefilter token="${tokenin2}" value="${token}"/> |
||
225 | </replace>
|
||
226 | </target>
|
||
227 | |||
228 | <!--************************************************-->
|
||
229 | <!--************** LAUNCHER ****************-->
|
||
230 | <!--************************************************-->
|
||
231 | |||
232 | <target name="create-library-launcher"> |
||
233 | <property name="dirlauncherlist" value="algorithm,libapi,libimpl,swingapi,swingimpl"/> |
||
234 | |||
235 | <mkdir dir="tmp"/> |
||
236 | |||
237 | <for list="${dirlauncherlist}" param="dir"> |
||
238 | <sequential>
|
||
239 | <!--Copia de fichero a un temporal-->
|
||
240 | <copy file="${basetemplatedir}/launcher/@{dir}" todir="./tmp"/> |
||
241 | |||
242 | <!--Reemplazo de cadenas-->
|
||
243 | <replace dir="tmp" value="${project}"> |
||
244 | <replacefilter token="${tokenin1}"/> |
||
245 | <replacefilter token="${tokenin2}" value="${token}"/> |
||
246 | </replace>
|
||
247 | |||
248 | <!--Cambio de nombre de ficheros-->
|
||
249 | <move file="tmp/@{dir}" tofile="tmp/org.gvsig.tools.library.Library" /> |
||
250 | |||
251 | <!--Mover a su sitio-->
|
||
252 | <move file="tmp/org.gvsig.tools.library.Library" todir="${@{dir}-metainfdir}"/> |
||
253 | |||
254 | </sequential>
|
||
255 | </for>
|
||
256 | |||
257 | <delete dir="tmp"/> |
||
258 | |||
259 | </target>
|
||
260 | |||
261 | <!--************************************************-->
|
||
262 | <!--************** BUILDNUMBER ****************-->
|
||
263 | <!--************************************************-->
|
||
264 | |||
265 | <target name="create-buildnumber"> |
||
266 | <copy file="${basetemplatedir}/config/buildNumber.properties" todir="${base}.app/${dirplugin}.app.client" overwrite="yes"/> |
||
267 | </target>
|
||
268 | |||
269 | <!--************************************************-->
|
||
270 | 1870 | nbrodin | <!--************** IMAGES ****************-->
|
271 | 1843 | nbrodin | <!--************************************************-->
|
272 | |||
273 | <target name="create-images"> |
||
274 | 1981 | nbrodin | <copy file="${basetemplatedir}/images/gvsig-icon.png" todir="${base}.app/${dirplugin}.app.client${resourcesplugindir}/images" overwrite="yes"/> |
275 | 1843 | nbrodin | </target>
|
276 | 2354 | nbrodin | |
277 | 1843 | nbrodin | </project> |