svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.mkmvnproject.app / org.gvsig.mkmvnproject.app.mainplugin / src / main / resources-plugin / scripts / mkmvnproject.xml @ 41074
History | View | Annotate | Download (12.6 KB)
1 |
<?xml version="1.0" encoding="ISO-8859-1"?>
|
---|---|
2 |
<!--
|
3 |
|
4 |
gvSIG. Desktop Geographic Information System.
|
5 |
|
6 |
Copyright (C) 2007-2013 gvSIG Association.
|
7 |
|
8 |
This program is free software; you can redistribute it and/or
|
9 |
modify it under the terms of the GNU General Public License
|
10 |
as published by the Free Software Foundation; either version 3
|
11 |
of the License, or (at your option) any later version.
|
12 |
|
13 |
This program is distributed in the hope that it will be useful,
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
GNU General Public License for more details.
|
17 |
|
18 |
You should have received a copy of the GNU General Public License
|
19 |
along with this program; if not, write to the Free Software
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
21 |
MA 02110-1301, USA.
|
22 |
|
23 |
For any additional information, do not hesitate to contact us
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com.
|
25 |
|
26 |
-->
|
27 |
<project name="gvSIG-make-maven-project" default="mkproject" basedir="."> |
28 |
|
29 |
<!-- Get current file location folder -->
|
30 |
<dirname property="gvSIG-make-maven-project.basedir" file="${ant.file.gvSIG-make-maven-project}" /> |
31 |
|
32 |
<!-- Libraries folder in the gvSIG extension -->
|
33 |
<property name="lib.folder" location="${gvSIG-make-maven-project.basedir}/../lib" /> |
34 |
<!-- Templates folder in the gvSIG extension -->
|
35 |
<property name="templates.folder" location="${gvSIG-make-maven-project.basedir}/../templates" /> |
36 |
|
37 |
<property name="gvsiglogo" location="${basedir}/../gvSIG.png" /> |
38 |
|
39 |
<!-- Load some ant external utility tasks -->
|
40 |
<property name="antform.lib" location="${lib.folder}/antform-2.0.jar" /> |
41 |
<property name="antcontrib.lib" location="${lib.folder}/ant-contrib-1.0b3.jar" /> |
42 |
<property name="antelope.lib" location="${lib.folder}/antelopetasks-3.2.10.jar" /> |
43 |
|
44 |
<property name="form.width" value="700" /> |
45 |
<property name="form.height" value="550" /> |
46 |
<property name="form.columns" value="40" /> |
47 |
|
48 |
|
49 |
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
50 |
<classpath>
|
51 |
<pathelement location="${antcontrib.lib}" /> |
52 |
</classpath>
|
53 |
</taskdef>
|
54 |
|
55 |
<taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="${antform.lib}" /> |
56 |
|
57 |
<taskdef name="antmenu" classname="com.sardak.antform.AntMenu" classpath="${antform.lib}" /> |
58 |
|
59 |
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpath="${antelope.lib}" /> |
60 |
|
61 |
|
62 |
<!--
|
63 |
================ begin specific code of templates =================
|
64 |
-->
|
65 |
<property name="template.fortunecookies-basic.option" value="2 - General project based on Fortune cookies basic example project" /> |
66 |
<property name="template.fortunecookies-basic.description1" value="Create a general pourpose project with the multimodule" /> |
67 |
<property name="template.fortunecookies-basic.description2" value="structure. It has no GEO logic and is based on a basic" /> |
68 |
<property name="template.fortunecookies-basic.description3" value="API/implementation separation" /> |
69 |
|
70 |
<!--
|
71 |
<property name="template.fortunecookies-provider.option" value="3 - General project based on Fortune cookies example project" />
|
72 |
<property name="template.fortunecookies-provider.description1" value="Create a general pourpose project with the multimodule" />
|
73 |
<property name="template.fortunecookies-provider.description2" value="structure. It has no GEO logic and is based on" />
|
74 |
<property name="template.fortunecookies-provider.description3" value="API/SPI/implementation separation and providers" />
|
75 |
-->
|
76 |
<property name="template.landregistryviewer.option" value="1 - Basic plugin with spatial support" /> |
77 |
<property name="template.landregistryviewer.description1" value="Create a project based in the LandRegistryViewer example." /> |
78 |
<property name="template.landregistryviewer.description2" value="Uses access to View, MapControl and datasources." /> |
79 |
<property name="template.landregistryviewer.description3" value="" /> |
80 |
|
81 |
<!--
|
82 |
<property name="templates" value="fortunecookies-basic,fortunecookies-provider,landregistryviewer" />
|
83 |
-->
|
84 |
<property name="templates" value="fortunecookies-basic,landregistryviewer" /> |
85 |
<!--
|
86 |
================ End specific code of templates =================
|
87 |
-->
|
88 |
|
89 |
<target name="mkproject" depends="mkproject-prompt-basic-data"> |
90 |
<description>Creates a new gvSIG project</description> |
91 |
</target>
|
92 |
|
93 |
<target name="mkproject-prompt-basic-data"> |
94 |
|
95 |
<property name="project.group.id" value="org.gvsig" /> |
96 |
|
97 |
<antform title="Create project" width="${form.width}" image="${gvsiglogo}"> |
98 |
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" /> |
99 |
<textProperty label="Name : " property="project.name" required="true" /> |
100 |
<label> For the project name, use the java class naming rules.
|
101 |
Ex: FortuneCookie or LandRegistryViewer</label>
|
102 |
<textProperty label="Group Id : " property="project.group.id" required="true" /> |
103 |
|
104 |
<fileSelectionProperty label="Create project in : " property="project.folder" directoryChooser="true" editable="false" required="true" /> |
105 |
<separator /> |
106 |
<label>Select the template to use:</label> |
107 |
|
108 |
<!--
|
109 |
================ begin specific code of templates =================
|
110 |
-->
|
111 |
<checkSelectionProperty property="template.landregistryviewer.check" values="${template.landregistryviewer.option}" label="" /> |
112 |
<label> ${template.landregistryviewer.description1}
|
113 |
${template.landregistryviewer.description2} |
114 |
${template.landregistryviewer.description3}</label>
|
115 |
|
116 |
<checkSelectionProperty editable="true" property="template.fortunecookies-basic.check" values="${template.fortunecookies-basic.option}" label="" /> |
117 |
<label> ${template.fortunecookies-basic.description1}
|
118 |
${template.fortunecookies-basic.description2} |
119 |
${template.fortunecookies-basic.description3}</label>
|
120 |
<!--
|
121 |
<checkSelectionProperty editable="false" property="template.fortunecookies-provider.check" values="${template.fortunecookies-provider.option}" label="" />
|
122 |
<label> ${template.fortunecookies-provider.description1}
|
123 |
${template.fortunecookies-provider.description2}
|
124 |
${template.fortunecookies-provider.description3}</label>
|
125 |
-->
|
126 |
<!--
|
127 |
================ End specific code of templates =================
|
128 |
-->
|
129 |
<separator /> |
130 |
<controlbar>
|
131 |
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" /> |
132 |
<button type="ok" label=" Next " target="mkproject-fixnames" /> |
133 |
</controlbar>
|
134 |
</antform>
|
135 |
</target>
|
136 |
|
137 |
<target name="mkproject-fixnames"> |
138 |
|
139 |
<!-- Trim project name and group id -->
|
140 |
<stringutil string="${project.name}" property="project.name"> |
141 |
<trim /> |
142 |
</stringutil>
|
143 |
<stringutil string="${project.group.id}" property="project.group.id"> |
144 |
<trim /> |
145 |
</stringutil>
|
146 |
|
147 |
<!-- Lower case project name -->
|
148 |
<stringutil string="${project.name}" property="project.name.lowercase"> |
149 |
<lowercase /> |
150 |
</stringutil>
|
151 |
|
152 |
<!-- Capitalize project name, just in case -->
|
153 |
<stringutil string="${project.name}" property="project.name.capitalized.end"> |
154 |
<substring beginindex="1" /> |
155 |
</stringutil>
|
156 |
<stringutil string="${project.name}" property="project.name.capitalized.beginning"> |
157 |
<substring endindex="1" /> |
158 |
<uppercase /> |
159 |
</stringutil>
|
160 |
<property name="project.name.capitalized" value="${project.name.capitalized.beginning}${project.name.capitalized.end}" /> |
161 |
|
162 |
<!-- Create artifactID with project.group.id + . + project.name.lowercase -->
|
163 |
<property name="project.artifact.id" value="${project.group.id}.${project.name.lowercase}" /> |
164 |
|
165 |
<for list="${templates}" param="template"> |
166 |
<sequential>
|
167 |
<var name="template.name" value="@{template}" /> |
168 |
<var name="check.name" value="template.${template.name}.check" /> |
169 |
<propertycopy override="true" name="arg1" from="${check.name}" /> |
170 |
<propertycopy override="true" name="arg2" from="template.${template.name}.option" /> |
171 |
<if>
|
172 |
<and>
|
173 |
<isset property="selected.template" /> |
174 |
<equals arg1="${arg1}" arg2="${arg2}" /> |
175 |
</and>
|
176 |
<then>
|
177 |
<antcall target="fail"> |
178 |
<param name="message" value="Only one template can be selected" /> |
179 |
</antcall>
|
180 |
</then>
|
181 |
</if>
|
182 |
<if>
|
183 |
<equals arg1="${arg1}" arg2="${arg2}" /> |
184 |
<then>
|
185 |
<echo>selected.template = "${template.name}"</echo> |
186 |
<property name="selected.template" value="${template.name}" /> |
187 |
</then>
|
188 |
</if>
|
189 |
</sequential>
|
190 |
</for>
|
191 |
<antcall target="mkproject-confirm" inheritall="true" /> |
192 |
</target>
|
193 |
|
194 |
<target name="mkproject-confirm"> |
195 |
<antform title="Confirm the creation" width="${form.width}" image="${gvsiglogo}"> |
196 |
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" /> |
197 |
<label>The data used for the creation of project are:</label> |
198 |
<textProperty label="Project" editable="false" property="project.name" /> |
199 |
<textProperty label="Project name capitalized" editable="false" property="project.name.capitalized" /> |
200 |
<textProperty label="Project name lowercase" editable="false" property="project.name.lowercase" /> |
201 |
<textProperty label="Group Id" editable="false" property="project.group.id" /> |
202 |
<textProperty label="Artifact Id" editable="false" property="project.artifact.id" /> |
203 |
<textProperty label="Folder" editable="false" property="project.folder" /> |
204 |
<textProperty label="Template" editable="false" property="selected.template" /> |
205 |
<label>Continue ?</label> |
206 |
<separator /> |
207 |
<controlbar>
|
208 |
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" /> |
209 |
<button type="ok" label=" Previous " target="mkproject-prompt-basic-data" /> |
210 |
<button type="ok" label=" Next " target="mkproject-build" /> |
211 |
</controlbar>
|
212 |
</antform>
|
213 |
</target>
|
214 |
|
215 |
<target name="mkproject-build"> |
216 |
<echo>
|
217 |
Project name: "${project.name}" |
218 |
Project name capitalized: "${project.name.capitalized}" |
219 |
Project name lowercase: ${project.name.lowercase}" |
220 |
Group id: "${project.group.id}" |
221 |
ArtifactId: "${project.artifact.id}" |
222 |
Project folder: "${project.folder}" |
223 |
Selected template: "${selected.template}" |
224 |
</echo>
|
225 |
<!-- call specific code of the selected template -->
|
226 |
<ant antfile="${selected.template}.xml" inheritall="false"> |
227 |
<property name="project.name" value="${project.name}" /> |
228 |
<property name="project.name.capitalized" value="${project.name.capitalized}" /> |
229 |
<property name="project.name.lowercase" value="${project.name.lowercase}" /> |
230 |
<property name="project.group.id" value="${project.group.id}" /> |
231 |
<property name="project.artifact.id" value="${project.artifact.id}" /> |
232 |
<property name="project.folder" value="${project.folder}" /> |
233 |
<property name="form.width" value="${form.width}" /> |
234 |
<property name="form.height" value="${form.height}" /> |
235 |
<property name="form.columns" value="${form.columns}" /> |
236 |
</ant>
|
237 |
<if>
|
238 |
<resourceexists>
|
239 |
<file file="${project.folder}/${project.artifact.id}" /> |
240 |
</resourceexists>
|
241 |
<then>
|
242 |
<antcall target="mkproject-prepare-workspace" inheritall="true" /> |
243 |
<antcall target="mkproject-build-succesfully" inheritall="true" /> |
244 |
</then>
|
245 |
<else>
|
246 |
<antcall target="mkproject-build-cancelled" inheritall="true" /> |
247 |
</else>
|
248 |
</if>
|
249 |
</target>
|
250 |
|
251 |
<target name="mkproject-prepare-workspace"> |
252 |
<!--
|
253 |
<ant dir="${project.folder}/${project.artifact.id}" antfile="prepare-workspace.xml" target="prepare-workspace" />
|
254 |
<if>
|
255 |
<resourceexists>
|
256 |
<file file="${project.folder}/${project.artifact.id}.app" />
|
257 |
</resourceexists>
|
258 |
<then>
|
259 |
<ant dir="${project.folder}/${project.artifact.id}.app" antfile="../org.gvsig.maven.base.build/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
|
260 |
</then>
|
261 |
</if>
|
262 |
-->
|
263 |
</target>
|
264 |
|
265 |
<target name="mkproject-build-succesfully"> |
266 |
<antform title="Project creation" width="${form.width}" image="${gvsiglogo}"> |
267 |
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" /> |
268 |
<label>Project ${project.name} was created succesfully</label> |
269 |
<controlbar>
|
270 |
<button type="ok" label=" Close " /> |
271 |
</controlbar>
|
272 |
</antform>
|
273 |
</target>
|
274 |
|
275 |
<target name="mkproject-build-cancelled"> |
276 |
<antform title="Project creation cancelled" width="${form.width}" image="${gvsiglogo}"> |
277 |
<textProperty label="" editable="false" columns="40" property="form.title" /> |
278 |
<label>Creation cancelled.</label> |
279 |
<separator /> |
280 |
<controlbar>
|
281 |
<button type="cancel" label=" Close " /> |
282 |
</controlbar>
|
283 |
</antform>
|
284 |
</target>
|
285 |
|
286 |
<target name="fail"> |
287 |
<echo>${message}</echo> |
288 |
<fail message="${message}" /> |
289 |
</target>
|
290 |
|
291 |
</project>
|