Revision 34224
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/package.info | ||
---|---|---|
1 |
# |
|
2 |
#Tue Nov 23 14:56:57 CET 2010 |
|
3 |
state=devel |
|
4 |
name=org.gvsig.mkmvnproject |
|
5 |
official=true |
|
6 |
code=org.gvsig.mkmvnproject |
|
7 |
operating-system=all |
|
8 |
architecture=all |
|
9 |
java-version=j1_5 |
|
10 |
gvSIG-version=2.0.0 |
|
11 |
version=2.0-SNAPSHOT |
|
12 |
type=plugin |
|
13 |
build=2023 |
|
14 |
description=Utilities and gvSIG plugin to create new gvSIG projects from a template |
|
15 |
model-version=1.0.0 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/resources/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.app" /> |
|
4 |
<resourceBundle name="text"/> |
|
5 |
<libraries library-dir="lib"/> |
|
6 |
<extensions> |
|
7 |
<extension class-name="org.gvsig.mkmvnproject.MakeMavenProjectExtension" |
|
8 |
description="" |
|
9 |
active="true" |
|
10 |
priority="1"> |
|
11 |
<menu text="tools/Development/Create Plugin" |
|
12 |
position="11" |
|
13 |
action-command="gvSIGProjectWizard"/> |
|
14 |
</extension> |
|
15 |
</extensions> |
|
16 |
</plugin-config> |
|
0 | 17 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/resources/scripts/mkmvnproject.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project name="gvSIG-make-maven-project" default="mkproject" basedir="."> |
|
3 |
|
|
4 |
<!-- Get current file location folder --> |
|
5 |
<dirname property="gvSIG-make-maven-project.basedir" |
|
6 |
file="${ant.file.gvSIG-make-maven-project}" /> |
|
7 |
|
|
8 |
<!-- Libraries folder in the gvSIG extension --> |
|
9 |
<property name="lib.folder" |
|
10 |
location="${gvSIG-make-maven-project.basedir}/../lib" /> |
|
11 |
<!-- Templates folder in the gvSIG extension --> |
|
12 |
<property name="templates.folder" |
|
13 |
location="${gvSIG-make-maven-project.basedir}/../templates" /> |
|
14 |
|
|
15 |
<property name="gvsiglogo" location="${basedir}/../gvSIG.png" /> |
|
16 |
|
|
17 |
<!-- Load some ant external utility tasks --> |
|
18 |
<property name="antform.lib" location="${lib.folder}/antform-2.0.jar" /> |
|
19 |
<property name="antcontrib.lib" |
|
20 |
location="${lib.folder}/ant-contrib-1.0b3.jar" /> |
|
21 |
<property name="antelope.lib" |
|
22 |
location="${lib.folder}/antelopetasks-3.2.10.jar" /> |
|
23 |
|
|
24 |
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
|
25 |
<classpath> |
|
26 |
<pathelement location="${antcontrib.lib}" /> |
|
27 |
</classpath> |
|
28 |
</taskdef> |
|
29 |
|
|
30 |
<taskdef name="antform" |
|
31 |
classname="com.sardak.antform.AntForm" |
|
32 |
classpath="${antform.lib}" /> |
|
33 |
|
|
34 |
<taskdef name="antmenu" |
|
35 |
classname="com.sardak.antform.AntMenu" |
|
36 |
classpath="${antform.lib}" /> |
|
37 |
|
|
38 |
<taskdef name="stringutil" |
|
39 |
classname="ise.antelope.tasks.StringUtilTask" |
|
40 |
classpath="${antelope.lib}" /> |
|
41 |
|
|
42 |
<property name="confirm.message" value="Please confirm:" /> |
|
43 |
|
|
44 |
<target name="mkproject"> |
|
45 |
<description>Creates a new gvSIG project</description> |
|
46 |
|
|
47 |
<property name="project.type" value="1" /> |
|
48 |
<property name="create.app" value="true" /> |
|
49 |
<property name="create.ui.library" value="true" /> |
|
50 |
<property name="create.extension" value="false" /> |
|
51 |
<property name="project.group.id" value="org.gvsig" /> |
|
52 |
|
|
53 |
<antform title="Create Maven project" image="${gvsiglogo}"> |
|
54 |
<label>Select the project properties:</label> |
|
55 |
<textProperty label="Name : " |
|
56 |
property="project.name" |
|
57 |
required="true" /> |
|
58 |
<label>For the project name, use the java class naming rules. Ex: FortuneCookie</label> |
|
59 |
<textProperty label="Group Id : " property="project.group.id" /> |
|
60 |
<fileSelectionProperty label="Create project in : " |
|
61 |
property="project.save.on" |
|
62 |
directoryChooser="true" |
|
63 |
editable="false" |
|
64 |
required="true" /> |
|
65 |
<separator /> |
|
66 |
<radioSelectionProperty property="project.type" |
|
67 |
separator="#" |
|
68 |
values="1- Basic, API separated of the implementation#2- With providers, implementation requires provider services" |
|
69 |
editable="true" |
|
70 |
label="Choose project type :" /> |
|
71 |
<separator /> |
|
72 |
<booleanProperty property="create.app" |
|
73 |
editable="true" |
|
74 |
label="Create test application" /> |
|
75 |
<separator /> |
|
76 |
<booleanProperty property="create.ui.library" |
|
77 |
editable="true" |
|
78 |
label="Create swing library projects" /> |
|
79 |
<separator /> |
|
80 |
<booleanProperty property="create.extension" |
|
81 |
editable="true" |
|
82 |
label="Create gvSIG plugin" /> |
|
83 |
<separator /> |
|
84 |
<controlbar> |
|
85 |
<button type="cancel" |
|
86 |
label="Cancel" |
|
87 |
target="project-cancelled" /> |
|
88 |
<button type="ok" label="Next" target="mkproject-redirect" /> |
|
89 |
</controlbar> |
|
90 |
</antform> |
|
91 |
</target> |
|
92 |
|
|
93 |
<target name="mkproject-redirect"> |
|
94 |
|
|
95 |
<!-- Trim project name and group id --> |
|
96 |
<stringutil string="${project.name}" property="project.name"> |
|
97 |
<trim /> |
|
98 |
</stringutil> |
|
99 |
<stringutil string="${project.group.id}" property="project.group.id"> |
|
100 |
<trim /> |
|
101 |
</stringutil> |
|
102 |
|
|
103 |
<!-- Lower case project name --> |
|
104 |
<stringutil string="${project.name}" property="project.name.lowercase"> |
|
105 |
<lowercase /> |
|
106 |
</stringutil> |
|
107 |
|
|
108 |
<!-- Capitalize project name, just in case --> |
|
109 |
<stringutil string="${project.name}" |
|
110 |
property="project.name.capitalized.end"> |
|
111 |
<substring beginindex="1" /> |
|
112 |
</stringutil> |
|
113 |
<stringutil string="${project.name}" |
|
114 |
property="project.name.capitalized.beginning"> |
|
115 |
<substring endindex="1" /> |
|
116 |
<uppercase /> |
|
117 |
</stringutil> |
|
118 |
<property name="project.name.capitalized" |
|
119 |
value="${project.name.capitalized.beginning}${project.name.capitalized.end}" /> |
|
120 |
|
|
121 |
<echo> |
|
122 |
Project name: ${project.name} |
|
123 |
Project name capitalized beg: ${project.name.capitalized.beginning} |
|
124 |
Project name capitalized end: ${project.name.capitalized.end} |
|
125 |
Project name capitalized: ${project.name.capitalized} |
|
126 |
</echo> |
|
127 |
|
|
128 |
|
|
129 |
<!-- Create artifactID with project.group.id + . + project.name.lowercase --> |
|
130 |
<property name="project.artifact.id" |
|
131 |
value="${project.group.id}.${project.name.lowercase}" /> |
|
132 |
|
|
133 |
<!-- Create project depending on the selected project type --> |
|
134 |
<propertyregex property="value.project.type" |
|
135 |
input="${project.type}" |
|
136 |
regexp="([1-5]).*" |
|
137 |
select="\1" |
|
138 |
defaultvalue="1" /> |
|
139 |
<if> |
|
140 |
<equals arg1="${value.project.type}" arg2="1" /> |
|
141 |
<then> |
|
142 |
<antcall target="mkproject-basic" /> |
|
143 |
</then> |
|
144 |
<else> |
|
145 |
<antcall target="mkproject-spi" /> |
|
146 |
</else> |
|
147 |
</if> |
|
148 |
</target> |
|
149 |
|
|
150 |
<target name="mkproject-basic"> |
|
151 |
<antform title="Confirm the creation" |
|
152 |
image="${gvsiglogo}" |
|
153 |
height="400" |
|
154 |
width="500"> |
|
155 |
<textProperty label="" |
|
156 |
property="confirm.message" |
|
157 |
editable="false" |
|
158 |
columns="28" /> |
|
159 |
<label>The project |
|
160 |
"${project.name}" |
|
161 |
will be created from the |
|
162 |
basic API/implementation |
|
163 |
template on the folder |
|
164 |
${project.save.on} |
|
165 |
with: |
|
166 |
- groupID = ${project.group.id} |
|
167 |
- artifactID = ${project.artifact.id} |
|
168 |
- Swing library subproject? ${create.ui.library} |
|
169 |
- Lib test application subproject? ${create.app} |
|
170 |
- gvSIG plugin subproject? ${create.extension} |
|
171 |
</label> |
|
172 |
<controlbar> |
|
173 |
<button type="cancel" |
|
174 |
label="Cancel" |
|
175 |
target="project-cancelled" /> |
|
176 |
<button type="ok" label="Previous" target="mkproject" /> |
|
177 |
<button type="ok" label="Create" target="get-api-project" /> |
|
178 |
</controlbar> |
|
179 |
</antform> |
|
180 |
</target> |
|
181 |
|
|
182 |
<target name="mkproject-spi"> |
|
183 |
<antform title="Confirm the creation" |
|
184 |
image="${gvsiglogo}" |
|
185 |
height="400" |
|
186 |
width="500"> |
|
187 |
<textProperty label="" |
|
188 |
property="confirm.message" |
|
189 |
editable="false" |
|
190 |
columns="28" /> |
|
191 |
<label>The project |
|
192 |
"${project.name}" |
|
193 |
will be created from the |
|
194 |
implementation with providers |
|
195 |
template on the folder |
|
196 |
${project.save.on} |
|
197 |
with: |
|
198 |
- groupID = ${project.group.id} |
|
199 |
- artifactID = ${project.artifact.id} |
|
200 |
- Swing library subproject? ${create.ui.library} |
|
201 |
- Lib test application subproject? ${create.app} |
|
202 |
- gvSIG plugin subproject? ${create.extension} |
|
203 |
</label> |
|
204 |
<controlbar> |
|
205 |
<button type="cancel" |
|
206 |
label="Cancel" |
|
207 |
target="project-cancelled" /> |
|
208 |
<button type="ok" label="Previous" target="mkproject" /> |
|
209 |
<button type="ok" label="Create" target="get-spi-project" /> |
|
210 |
</controlbar> |
|
211 |
</antform> |
|
212 |
</target> |
|
213 |
|
|
214 |
<target name="get-api-project"> |
|
215 |
<echo>Unzipping the basic template project</echo> |
|
216 |
<unzip src="${templates.folder}/template-basic.zip" |
|
217 |
dest="${project.save.on}" /> |
|
218 |
<antcall target="prepare-project" /> |
|
219 |
</target> |
|
220 |
|
|
221 |
<target name="get-spi-project"> |
|
222 |
<echo>Unzipping the provider based implementation template project</echo> |
|
223 |
<unzip src="${templates.folder}/template-pbi.zip" |
|
224 |
dest="${project.save.on}" /> |
|
225 |
<antcall target="prepare-project" /> |
|
226 |
</target> |
|
227 |
|
|
228 |
<target name="prepare-project"> |
|
229 |
<!-- Calculate the project artifact id as PATH --> |
|
230 |
<propertyregex property="project.artifact.id.folder" |
|
231 |
input="${project.artifact.id}" |
|
232 |
regexp="([^\.]*).([^\.]*)" |
|
233 |
replace="\1${file.separator}\2" /> |
|
234 |
|
|
235 |
|
|
236 |
<echo>Remove non wanted projects</echo> |
|
237 |
<if> |
|
238 |
<equals arg1="${create.extension}" arg2="false" /> |
|
239 |
<then> |
|
240 |
<echo>Remove the gvSIG extension projects</echo> |
|
241 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies.app.noswinglib" /> |
|
242 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies.app" /> |
|
243 |
</then> |
|
244 |
</if> |
|
245 |
<if> |
|
246 |
<equals arg1="${create.app}" arg2="false" /> |
|
247 |
<then> |
|
248 |
<echo>Remove the library test main project</echo> |
|
249 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" /> |
|
250 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/pom.xml" |
|
251 |
token="<module>org.gvsig.fortunecookies.main</module>" |
|
252 |
value="" /> |
|
253 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/pom.xml" |
|
254 |
token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" |
|
255 |
value="" /> |
|
256 |
</then> |
|
257 |
</if> |
|
258 |
<if> |
|
259 |
<equals arg1="${create.ui.library}" arg2="false" /> |
|
260 |
<then> |
|
261 |
<echo>Remove the Swing library</echo> |
|
262 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.swing" /> |
|
263 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/pom.xml" |
|
264 |
token="<module>org.gvsig.fortunecookies.swing</module>" |
|
265 |
value="" /> |
|
266 |
<if> |
|
267 |
<equals arg1="${create.extension}" arg2="true" /> |
|
268 |
<then> |
|
269 |
<echo>Leave only the extension which depends on the swing components</echo> |
|
270 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies.app" /> |
|
271 |
<move todir="${project.save.on}/org.gvsig.fortunecookies.app"> |
|
272 |
<fileset dir="${project.save.on}/org.gvsig.fortunecookies.app.noswinglib" /> |
|
273 |
</move> |
|
274 |
</then> |
|
275 |
</if> |
|
276 |
<if> |
|
277 |
<equals arg1="${create.app}" arg2="true" /> |
|
278 |
<then> |
|
279 |
<echo>Leave only the Main class which not depends on the swing components</echo> |
|
280 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" /> |
|
281 |
<move todir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main"> |
|
282 |
<fileset dir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" /> |
|
283 |
</move> |
|
284 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/pom.xml" |
|
285 |
token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" |
|
286 |
value="" /> |
|
287 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main/pom.xml" |
|
288 |
token="org.gvsig.fortunecookies.main.noswinglib" |
|
289 |
value="org.gvsig.fortunecookies.main" /> |
|
290 |
</then> |
|
291 |
</if> |
|
292 |
</then> |
|
293 |
<else> |
|
294 |
<!-- Let the Swing library and use the extension which uses that library --> |
|
295 |
<if> |
|
296 |
<equals arg1="${create.extension}" arg2="true" /> |
|
297 |
<then> |
|
298 |
<echo>Leave only the extension which not depends on the swing components</echo> |
|
299 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies.app.noswinglib" /> |
|
300 |
</then> |
|
301 |
</if> |
|
302 |
<if> |
|
303 |
<equals arg1="${create.app}" arg2="true" /> |
|
304 |
<then> |
|
305 |
<echo>Leave only the Main class which depends on the swing components</echo> |
|
306 |
<delete dir="${project.save.on}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" /> |
|
307 |
<replace file="${project.save.on}/org.gvsig.fortunecookies/pom.xml" |
|
308 |
token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" |
|
309 |
value="" /> |
|
310 |
</then> |
|
311 |
</if> |
|
312 |
</else> |
|
313 |
</if> |
|
314 |
|
|
315 |
<echo>Renaming folder ${project.save.on}/org.gvsig.fortunecookies to |
|
316 |
${project.save.on}/${project.artifact.id}</echo> |
|
317 |
<move todir="${project.save.on}"> |
|
318 |
<fileset dir="${project.save.on}"> |
|
319 |
<include name="org.gvsig.fortunecookies/**" /> |
|
320 |
<include name="org.gvsig.fortunecookies.app/**" /> |
|
321 |
</fileset> |
|
322 |
<mapper> |
|
323 |
<filtermapper> |
|
324 |
<replacestring from="org.gvsig.fortunecookies" |
|
325 |
to="${project.artifact.id}" /> |
|
326 |
<replacestring from="org${file.separator}gvsig${file.separator}fortunecookies" |
|
327 |
to="${project.artifact.id.folder}" /> |
|
328 |
<replacestring from="FortuneCookie" |
|
329 |
to="${project.name.capitalized}" /> |
|
330 |
</filtermapper> |
|
331 |
</mapper> |
|
332 |
<filterchain> |
|
333 |
<tokenfilter> |
|
334 |
<!-- Replace fortune cookie server url as it contains the FortuneCookie word in it. --> |
|
335 |
<replacestring from="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" |
|
336 |
to="FC_URL_TO_PRESERVE" /> |
|
337 |
</tokenfilter> |
|
338 |
<tokenfilter> |
|
339 |
<replacestring from="org.gvsig.fortunecookies" |
|
340 |
to="${project.artifact.id}" /> |
|
341 |
</tokenfilter> |
|
342 |
<tokenfilter> |
|
343 |
<replacestring from="FortuneCookies" |
|
344 |
to="${project.name.capitalized}" /> |
|
345 |
<replacestring from="Fortune Cookies" |
|
346 |
to="${project.name.capitalized}" /> |
|
347 |
<replacestring from="Fortune cookies" |
|
348 |
to="${project.name.capitalized}" /> |
|
349 |
<replacestring from="fortune cookies" |
|
350 |
to="${project.name.capitalized}" /> |
|
351 |
<replacestring from="gvsig-fortunecookies" |
|
352 |
to="gvsig-${project.name.lowercase}" /> |
|
353 |
<replacestring from="fortunecookies" |
|
354 |
to="${project.name.capitalized}" /> |
|
355 |
</tokenfilter> |
|
356 |
<tokenfilter> |
|
357 |
<replacestring from="FortuneCookie" |
|
358 |
to="${project.name.capitalized}" /> |
|
359 |
<replacestring from="Fortune Cookie" |
|
360 |
to="${project.name.capitalized}" /> |
|
361 |
<replacestring from="Fortune cookie" |
|
362 |
to="${project.name.capitalized}" /> |
|
363 |
<replacestring from="fortune cookie" |
|
364 |
to="${project.name.capitalized}" /> |
|
365 |
<replacestring from="gvsig-fortunecookie" |
|
366 |
to="gvsig-${project.name.lowercase}" /> |
|
367 |
<replacestring from="fortunecookie" |
|
368 |
to="${project.name.capitalized}" /> |
|
369 |
</tokenfilter> |
|
370 |
<tokenfilter> |
|
371 |
<!-- Restore the fortune cookie server URL --> |
|
372 |
<replacestring from="FC_URL_TO_PRESERVE" |
|
373 |
to="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" /> |
|
374 |
</tokenfilter> |
|
375 |
</filterchain> |
|
376 |
</move> |
|
377 |
|
|
378 |
<antcall target="prepare-workspace" /> |
|
379 |
</target> |
|
380 |
|
|
381 |
<target name="prepare-workspace"> |
|
382 |
<ant dir="${project.save.on}/${project.artifact.id}" |
|
383 |
antfile="prepare-workspace.xml" |
|
384 |
target="prepare-workspace" /> |
|
385 |
<if> |
|
386 |
<equals arg1="${create.extension}" arg2="true" /> |
|
387 |
<then> |
|
388 |
<ant dir="${project.save.on}/${project.artifact.id}.app" |
|
389 |
antfile="../org.gvsig.maven.base.build/maven-goals.xml" |
|
390 |
target="mvn-install-and-eclipse-eclipse" /> |
|
391 |
<antcall target="project-created-succesfully" /> |
|
392 |
</then> |
|
393 |
</if> |
|
394 |
</target> |
|
395 |
|
|
396 |
<target name="project-created-succesfully"> |
|
397 |
<antform title="Project created succesfully" image="${gvsiglogo}"> |
|
398 |
<label>Project ${project.name} was created succesfully</label> |
|
399 |
<controlbar> |
|
400 |
<button type="cancel" label="Ok" /> |
|
401 |
</controlbar> |
|
402 |
</antform> |
|
403 |
</target> |
|
404 |
|
|
405 |
<target name="project-cancelled"> |
|
406 |
<property name="cancel.message" |
|
407 |
value="Project creation cancelled by the user" /> |
|
408 |
<antform title="Project creation cancelled" |
|
409 |
image="${gvsiglogo}" |
|
410 |
height="200" |
|
411 |
width="400"> |
|
412 |
<textProperty label="" |
|
413 |
property="cancel.message" |
|
414 |
editable="false" |
|
415 |
columns="24" /> |
|
416 |
<controlbar> |
|
417 |
<button type="cancel" label="Ok" /> |
|
418 |
</controlbar> |
|
419 |
</antform> |
|
420 |
</target> |
|
421 |
|
|
422 |
</project> |
|
0 | 423 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/java/org/gvsig/mkmvnproject/CreatePluginConsolePanel.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.mkmvnproject; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Color; |
|
26 |
import java.awt.Dimension; |
|
27 |
import java.io.BufferedReader; |
|
28 |
import java.io.IOException; |
|
29 |
import java.io.InputStreamReader; |
|
30 |
import java.io.PipedInputStream; |
|
31 |
import java.io.PipedOutputStream; |
|
32 |
import java.io.PrintStream; |
|
33 |
|
|
34 |
import javax.swing.JPanel; |
|
35 |
import javax.swing.JScrollPane; |
|
36 |
import javax.swing.JTextArea; |
|
37 |
import javax.swing.SwingUtilities; |
|
38 |
|
|
39 |
import org.slf4j.Logger; |
|
40 |
import org.slf4j.LoggerFactory; |
|
41 |
|
|
42 |
/** |
|
43 |
* A panel which shows the execution log messages of the create plugin process. |
|
44 |
* |
|
45 |
* @author gvSIG Team |
|
46 |
* @version $Id$ |
|
47 |
*/ |
|
48 |
public class CreatePluginConsolePanel extends JPanel { |
|
49 |
|
|
50 |
private static final long serialVersionUID = -7213048219847956909L; |
|
51 |
|
|
52 |
private static final Logger LOG = LoggerFactory |
|
53 |
.getLogger(CreatePluginConsolePanel.class); |
|
54 |
|
|
55 |
private JTextArea console; |
|
56 |
|
|
57 |
private PrintStream printStream; |
|
58 |
private PipedOutputStream pipedos; |
|
59 |
private PipedInputStream pipedis; |
|
60 |
private Thread consoleThread; |
|
61 |
|
|
62 |
/** |
|
63 |
* Constructor. |
|
64 |
* |
|
65 |
* @throws IOException |
|
66 |
* if there is an error creating the console streams |
|
67 |
*/ |
|
68 |
public CreatePluginConsolePanel() throws IOException { |
|
69 |
super(); |
|
70 |
initialize(); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Constructor. |
|
75 |
* |
|
76 |
* @param isDoubleBuffered |
|
77 |
* if the panel must be double buffered. |
|
78 |
* @throws IOException |
|
79 |
* if there is an error creating the console streams |
|
80 |
*/ |
|
81 |
public CreatePluginConsolePanel(boolean isDoubleBuffered) |
|
82 |
throws IOException { |
|
83 |
super(isDoubleBuffered); |
|
84 |
initialize(); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* Initializes the panel GUI. |
|
89 |
* |
|
90 |
* @throws IOException |
|
91 |
*/ |
|
92 |
private void initialize() throws IOException { |
|
93 |
Dimension dimension = new Dimension(600, 200); |
|
94 |
setSize(dimension); |
|
95 |
setLayout(new BorderLayout()); |
|
96 |
|
|
97 |
console = new JTextArea(); |
|
98 |
console.setEditable(false); |
|
99 |
// console.setColumns(20); |
|
100 |
// console.setRows(5); |
|
101 |
console.setBackground(Color.WHITE); |
|
102 |
console.setLineWrap(true); |
|
103 |
console.setWrapStyleWord(true); |
|
104 |
|
|
105 |
JScrollPane consoleScrollPane = new JScrollPane(console); |
|
106 |
add(consoleScrollPane, BorderLayout.CENTER); |
|
107 |
|
|
108 |
pipedis = new PipedInputStream(); |
|
109 |
|
|
110 |
pipedos = new PipedOutputStream(pipedis); |
|
111 |
|
|
112 |
printStream = new PrintStream(pipedos); |
|
113 |
consoleThread = new ConsoleThread(pipedis, console); |
|
114 |
consoleThread.start(); |
|
115 |
} |
|
116 |
|
|
117 |
/** |
|
118 |
* Returns a {@link PrintStream} which allows to write messages to the |
|
119 |
* console. |
|
120 |
* |
|
121 |
* @return a {@link PrintStream} which allows to write messages to the |
|
122 |
* console |
|
123 |
*/ |
|
124 |
public PrintStream getPrintStream() { |
|
125 |
return printStream; |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* Returns a {@link PrintStream} which allows to write error messages to the |
|
130 |
* console. |
|
131 |
* |
|
132 |
* @return a {@link PrintStream} which allows to write error messages to the |
|
133 |
* console |
|
134 |
*/ |
|
135 |
public PrintStream getErrorPrintStream() { |
|
136 |
return getPrintStream(); |
|
137 |
} |
|
138 |
|
|
139 |
/** |
|
140 |
* Closes the console. Once this method is called, any more calls to the |
|
141 |
* console {@link PrintStream} will throw an exception. |
|
142 |
*/ |
|
143 |
public void closeConsole() { |
|
144 |
printStream.flush(); |
|
145 |
printStream.close(); |
|
146 |
try { |
|
147 |
pipedos.close(); |
|
148 |
pipedis.close(); |
|
149 |
// Wait for the thread to finish |
|
150 |
consoleThread.join(500); |
|
151 |
} catch (IOException e) { |
|
152 |
LOG.warn("Error closing the internal piped streams", e); |
|
153 |
} catch (InterruptedException e) { |
|
154 |
// Nothing special to do |
|
155 |
LOG.debug("Console thread interrupted while waiting to finish", e); |
|
156 |
} |
|
157 |
} |
|
158 |
|
|
159 |
private static final class ConsoleThread extends Thread { |
|
160 |
|
|
161 |
private final PipedInputStream pipedis; |
|
162 |
private final JTextArea console; |
|
163 |
|
|
164 |
/** |
|
165 |
* Constructor. |
|
166 |
*/ |
|
167 |
public ConsoleThread(PipedInputStream pipedis, JTextArea console) { |
|
168 |
super("Create plugin console update thread"); |
|
169 |
setDaemon(true); |
|
170 |
this.pipedis = pipedis; |
|
171 |
this.console = console; |
|
172 |
} |
|
173 |
|
|
174 |
@Override |
|
175 |
public void run() { |
|
176 |
try { |
|
177 |
BufferedReader reader = new BufferedReader( |
|
178 |
new InputStreamReader(pipedis)); |
|
179 |
String line; |
|
180 |
while ((line = reader.readLine()) != null) { |
|
181 |
SwingUtilities.invokeLater(new ConsoleUpdateRunnable( |
|
182 |
console, line)); |
|
183 |
} |
|
184 |
LOG.debug("Console input stream end, finish reading"); |
|
185 |
reader.close(); |
|
186 |
} catch (IOException e) { |
|
187 |
LOG.error("Error reading from the console string", e); |
|
188 |
} |
|
189 |
} |
|
190 |
|
|
191 |
} |
|
192 |
|
|
193 |
/** |
|
194 |
* Runnable used to update the console text field. |
|
195 |
* |
|
196 |
* @author gvSIG Team |
|
197 |
* @version $Id$ |
|
198 |
*/ |
|
199 |
private static final class ConsoleUpdateRunnable implements Runnable { |
|
200 |
private final String newLine; |
|
201 |
private final JTextArea console; |
|
202 |
|
|
203 |
/** |
|
204 |
* Constructor. |
|
205 |
*/ |
|
206 |
public ConsoleUpdateRunnable(JTextArea console, String newLine) { |
|
207 |
this.console = console; |
|
208 |
this.newLine = newLine; |
|
209 |
} |
|
210 |
|
|
211 |
public void run() { |
|
212 |
console.append(newLine); |
|
213 |
console.append("\n"); |
|
214 |
} |
|
215 |
} |
|
216 |
} |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/java/org/gvsig/mkmvnproject/MakeMavenProjectExtension.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.mkmvnproject; |
|
23 |
|
|
24 |
import java.io.File; |
|
25 |
import java.io.IOException; |
|
26 |
import java.net.URL; |
|
27 |
|
|
28 |
import org.apache.tools.ant.DefaultLogger; |
|
29 |
import org.apache.tools.ant.Project; |
|
30 |
import org.apache.tools.ant.ProjectHelper; |
|
31 |
import org.slf4j.Logger; |
|
32 |
import org.slf4j.LoggerFactory; |
|
33 |
|
|
34 |
import org.gvsig.andami.PluginServices; |
|
35 |
import org.gvsig.andami.messages.NotificationManager; |
|
36 |
import org.gvsig.andami.plugins.Extension; |
|
37 |
|
|
38 |
/** |
|
39 |
* Extension to launch the project creation from templates. |
|
40 |
* |
|
41 |
* @author gvSIG team |
|
42 |
* @version $Id$ |
|
43 |
*/ |
|
44 |
public class MakeMavenProjectExtension extends Extension { |
|
45 |
|
|
46 |
private static final String ANT_BUILD_FILE = "mkmvnproject.xml"; |
|
47 |
|
|
48 |
private static final String ANT_TARGET = "mkproject"; |
|
49 |
|
|
50 |
private static final Logger LOG = LoggerFactory |
|
51 |
.getLogger(MakeMavenProjectExtension.class); |
|
52 |
|
|
53 |
private boolean enabled = true; |
|
54 |
|
|
55 |
private final Object lock = new Object(); |
|
56 |
|
|
57 |
public void execute(String actionCommand) { |
|
58 |
// TODO: add support to parallel executions in Andami?? |
|
59 |
|
|
60 |
// Create messages console |
|
61 |
CreatePluginConsoleWindow console = null; |
|
62 |
try { |
|
63 |
console = new CreatePluginConsoleWindow(); |
|
64 |
PluginServices.getMDIManager().addCentredWindow(console); |
|
65 |
} catch (IOException e) { |
|
66 |
NotificationManager.addWarning("Error creating the console", e); |
|
67 |
} |
|
68 |
|
|
69 |
try { |
|
70 |
// Disable extension so it can't be executed again. |
|
71 |
synchronized (lock) { |
|
72 |
enabled = false; |
|
73 |
} |
|
74 |
new CreatePluginThread(console).start(); |
|
75 |
} finally { |
|
76 |
synchronized (lock) { |
|
77 |
// create plugin process finish. Enable extension. |
|
78 |
enabled = true; |
|
79 |
} |
|
80 |
} |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* Thread to launch the ant base plugin creation project. |
|
85 |
* |
|
86 |
* @author gvSIG Team |
|
87 |
* @version $Id$ |
|
88 |
*/ |
|
89 |
private static final class CreatePluginThread extends Thread { |
|
90 |
|
|
91 |
private final CreatePluginConsoleWindow console; |
|
92 |
|
|
93 |
/** |
|
94 |
* Constructor. |
|
95 |
* |
|
96 |
* @param console |
|
97 |
*/ |
|
98 |
public CreatePluginThread(CreatePluginConsoleWindow console) { |
|
99 |
this.console = console; |
|
100 |
setName("Create plugin execution thread"); |
|
101 |
setDaemon(true); |
|
102 |
} |
|
103 |
|
|
104 |
@Override |
|
105 |
public void run() { |
|
106 |
DefaultLogger log = new DefaultLogger(); |
|
107 |
log.setMessageOutputLevel(Project.MSG_INFO); |
|
108 |
|
|
109 |
if (console != null) { |
|
110 |
log.setErrorPrintStream(console.getErrorPrintStream()); |
|
111 |
log.setOutputPrintStream(console.getPrintStream()); |
|
112 |
} else { |
|
113 |
LOG.warn("Console window not available, will use the default console for Ant"); |
|
114 |
log.setErrorPrintStream(System.err); |
|
115 |
log.setOutputPrintStream(System.out); |
|
116 |
} |
|
117 |
|
|
118 |
ClassLoader loader = this.getClass().getClassLoader(); |
|
119 |
URL build = loader.getResource("scripts/" + ANT_BUILD_FILE); |
|
120 |
File file = new File(build.getFile()); |
|
121 |
|
|
122 |
final Project ant = new Project(); |
|
123 |
ant.addBuildListener(log); |
|
124 |
ant.setUserProperty("ant.file", file.getAbsolutePath()); |
|
125 |
ant.init(); |
|
126 |
ProjectHelper.getProjectHelper().parse(ant, file); |
|
127 |
|
|
128 |
LOG.info("Starting ant task with the file {} and the target {}", |
|
129 |
file, ANT_TARGET); |
|
130 |
ant.executeTarget(ANT_TARGET); |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
public void initialize() { |
|
135 |
// Nothing to do |
|
136 |
} |
|
137 |
|
|
138 |
public boolean isEnabled() { |
|
139 |
return enabled; |
|
140 |
} |
|
141 |
|
|
142 |
public boolean isVisible() { |
|
143 |
return true; |
|
144 |
} |
|
145 |
|
|
146 |
} |
|
0 | 147 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/java/org/gvsig/mkmvnproject/CreatePluginConsoleWindow.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.mkmvnproject; |
|
23 |
|
|
24 |
import java.awt.Dimension; |
|
25 |
import java.io.IOException; |
|
26 |
|
|
27 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
28 |
import org.gvsig.andami.ui.mdiManager.IWindowListener; |
|
29 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
30 |
|
|
31 |
/** |
|
32 |
* A gvSIG window which shows the execution log messages of the create plugin |
|
33 |
* process. |
|
34 |
* |
|
35 |
* @author gvSIG Team |
|
36 |
* @version $Id$ |
|
37 |
*/ |
|
38 |
public class CreatePluginConsoleWindow extends CreatePluginConsolePanel |
|
39 |
implements IWindow, IWindowListener { |
|
40 |
|
|
41 |
private static final long serialVersionUID = -5589080107545290284L; |
|
42 |
|
|
43 |
private WindowInfo info; |
|
44 |
|
|
45 |
private Object profile = WindowInfo.EDITOR_PROFILE; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor. |
|
49 |
* |
|
50 |
* @throws IOException |
|
51 |
* if there is an error creating the console streams |
|
52 |
*/ |
|
53 |
public CreatePluginConsoleWindow() throws IOException { |
|
54 |
super(); |
|
55 |
initializeWindow(); |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Constructor. |
|
60 |
* |
|
61 |
* @param isDoubleBuffered |
|
62 |
* if the panel must be double buffered. |
|
63 |
* @throws IOException |
|
64 |
* if there is an error creating the console streams |
|
65 |
*/ |
|
66 |
public CreatePluginConsoleWindow(boolean isDoubleBuffered) throws IOException { |
|
67 |
super(isDoubleBuffered); |
|
68 |
initializeWindow(); |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* Initializes the window. |
|
73 |
*/ |
|
74 |
private void initializeWindow() { |
|
75 |
Dimension dimension = new Dimension(600, 300); |
|
76 |
setSize(dimension); |
|
77 |
int code = WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE |
|
78 |
| WindowInfo.RESIZABLE | WindowInfo.MODELESSDIALOG; |
|
79 |
profile = WindowInfo.EDITOR_PROFILE; |
|
80 |
info = new WindowInfo(code); |
|
81 |
info.setTitle("Console"); |
|
82 |
info.setMinimumSize(dimension); |
|
83 |
} |
|
84 |
|
|
85 |
public WindowInfo getWindowInfo() { |
|
86 |
return info; |
|
87 |
} |
|
88 |
|
|
89 |
public Object getWindowProfile() { |
|
90 |
return profile; |
|
91 |
} |
|
92 |
|
|
93 |
public void windowActivated() { |
|
94 |
// Nothing to do |
|
95 |
} |
|
96 |
|
|
97 |
public void windowClosed() { |
|
98 |
super.closeConsole(); |
|
99 |
} |
|
100 |
|
|
101 |
} |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/src/main/java/org/gvsig/mkmvnproject/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.fortunecookies package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>gvSIG Project creation from templates plugins.</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
It allows to create new development projects for gvSIG from templates. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/prepare-templates.xml | ||
---|---|---|
1 |
<project name="prepare-templates.build" default="prepare-templates"> |
|
2 |
|
|
3 |
<dirname property="prepare-templates.build.basedir" |
|
4 |
file="${ant.file.prepare-templates.build}" /> |
|
5 |
|
|
6 |
<target name="check-templates"> |
|
7 |
<available file="${prepare-templates.build.basedir}/target/templates" |
|
8 |
type="dir" |
|
9 |
property="templates.downloaded" /> |
|
10 |
</target> |
|
11 |
|
|
12 |
<target name="download-templates" |
|
13 |
depends="check-templates" |
|
14 |
unless="templates.downloaded"> |
|
15 |
<echo>Downloading project templates...</echo> |
|
16 |
<mkdir dir="${prepare-templates.build.basedir}/target/templates/downloads" /> |
|
17 |
<mkdir dir="${prepare-templates.build.basedir}/target/templates-zips" /> |
|
18 |
|
|
19 |
<java classname="org.tmatesoft.svn.cli.SVN" |
|
20 |
classpath="${runtime_classpath}" |
|
21 |
dir="${prepare-templates.build.basedir}/target/templates/downloads/" |
|
22 |
fork="true" |
|
23 |
failonerror="true"> |
|
24 |
<arg value="export" /> |
|
25 |
<arg value="https://svn.forge.osor.eu/svn/gvsig-fortuneco/org.gvsig.fortunecookies/trunk/basic-with-user-interface" /> |
|
26 |
</java> |
|
27 |
<java classname="org.tmatesoft.svn.cli.SVN" |
|
28 |
classpath="${runtime_classpath}" |
|
29 |
dir="${prepare-templates.build.basedir}/target/templates/downloads/" |
|
30 |
fork="true" |
|
31 |
failonerror="true"> |
|
32 |
<arg value="export" /> |
|
33 |
<arg value="https://svn.forge.osor.eu/svn/gvsig-fortuneco/org.gvsig.fortunecookies/trunk/provider-based-implementation-with-user-interface" /> |
|
34 |
</java> |
|
35 |
</target> |
|
36 |
|
|
37 |
<target name="prepare-templates" depends="download-templates"> |
|
38 |
<echo>Zipping templates...</echo> |
|
39 |
<zip destfile="${prepare-templates.build.basedir}/target/templates-zips/template-basic.zip" |
|
40 |
basedir="${prepare-templates.build.basedir}/target/templates/downloads/basic-with-user-interface/" |
|
41 |
includes="**/*" /> |
|
42 |
<zip destfile="${prepare-templates.build.basedir}/target/templates-zips/template-pbi.zip" |
|
43 |
basedir="${prepare-templates.build.basedir}/target/templates/downloads/provider-based-implementation-with-user-interface/" |
|
44 |
includes="**/*" /> |
|
45 |
</target> |
|
46 |
|
|
47 |
</project> |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/prepare-workspace.xml | ||
---|---|---|
1 |
<project name="org.gvsig.initial.build" default="prepare-workspace"> |
|
2 |
|
|
3 |
<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}"/> |
|
4 |
|
|
5 |
<property name="workspace.basedir" |
|
6 |
value="${org.gvsig.initial.build.basedir}/.."/> |
|
7 |
<property name="build.basedir" |
|
8 |
value="${workspace.basedir}/org.gvsig.maven.base.build" |
|
9 |
description="Eclipse workspace location"/> |
|
10 |
<property name="build.jar.version" |
|
11 |
value="1.0.6-SNAPSHOT" /> |
|
12 |
<property name="build.jar.file" |
|
13 |
value="org.gvsig.maven.base.build-${build.jar.version}.jar" /> |
|
14 |
|
|
15 |
<target name="prepare-workspace"> |
|
16 |
|
|
17 |
<mkdir dir="target"/> |
|
18 |
|
|
19 |
<!-- Get the build jar file --> |
|
20 |
<get src="http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" |
|
21 |
dest="target/${build.jar.file}" |
|
22 |
verbose="true"/> |
|
23 |
|
|
24 |
<!-- Unzip de build jar file into the workspace root folder --> |
|
25 |
<unzip src="target/${build.jar.file}" |
|
26 |
dest="${workspace.basedir}"> |
|
27 |
<patternset> |
|
28 |
<exclude name="META-INF/**"/> |
|
29 |
</patternset> |
|
30 |
</unzip> |
|
31 |
|
|
32 |
<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug"/> |
|
33 |
|
|
34 |
<!-- Copy the maven launchers to the workspace metadata folder --> |
|
35 |
<copy todir="${workspace.basedir}/.metadata"> |
|
36 |
<fileset dir="${build.basedir}/eclipse-launchers"/> |
|
37 |
</copy> |
|
38 |
|
|
39 |
<!-- Configure the eclipse workspace --> |
|
40 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace"/> |
|
41 |
|
|
42 |
<!-- Configure the gvSIG profile --> |
|
43 |
<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize"/> |
|
44 |
|
|
45 |
<!-- Compile, install and generate eclipse projects --> |
|
46 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse"/> |
|
47 |
|
|
48 |
<echo>INFORMATION!!!</echo> |
|
49 |
<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo> |
|
50 |
|
|
51 |
<!-- TODO: copiar al proyecto de configuración general --> |
|
52 |
</target> |
|
53 |
|
|
54 |
<target name="clean"> |
|
55 |
<delete dir="target"/> |
|
56 |
</target> |
|
57 |
|
|
58 |
</project> |
|
0 | 59 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<groupId>org.gvsig</groupId> |
|
7 |
<artifactId>org.gvsig.mkmvnproject</artifactId> |
|
8 |
<packaging>jar</packaging> |
|
9 |
<version>2.0-SNAPSHOT</version> |
|
10 |
<name>org.gvsig.mkmvnproject</name> |
|
11 |
<description> |
|
12 |
Utilities and gvSIG plugin to create new gvSIG projects from a template |
|
13 |
</description> |
|
14 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.fortunecookies/${pom.version}/basic/org.gvsig.mkmvnproject</url> |
|
15 |
<parent> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.maven.base.extension.pom</artifactId> |
|
18 |
<version>1.0.6-SNAPSHOT</version> |
|
19 |
</parent> |
|
20 |
|
|
21 |
<scm> |
|
22 |
<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.mkmvnproject</connection> |
|
23 |
<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-desktop/branches/v2_0_0_prep/extensions/org.gvsig.mkmvnproject</developerConnection> |
|
24 |
<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/branches/v2_0_0_prep/extensions/org.gvsig.mkmvnproject/?root=gvsig-desktop</url> |
|
25 |
</scm> |
|
26 |
|
|
27 |
<developers> |
|
28 |
<developer> |
|
29 |
<id>jjdelcerro</id> |
|
30 |
<name>Joaqu?n Jos? del Cerro</name> |
|
31 |
<email>jjdelcerro@gvsig.org</email> |
|
32 |
<roles> |
|
33 |
<role>Architect</role> |
|
34 |
<role>Developer</role> |
|
35 |
</roles> |
|
36 |
</developer> |
|
37 |
<developer> |
|
38 |
<id>jbadia</id> |
|
39 |
<name>Jos? Bad?a</name> |
|
40 |
<email>badia_jos@gva.es</email> |
|
41 |
<roles> |
|
42 |
<role>Developer</role> |
|
43 |
</roles> |
|
44 |
</developer> |
|
45 |
<developer> |
|
46 |
<id>cordinyana</id> |
|
47 |
<name>C?sar Ordi?ana</name> |
|
48 |
<email>cordinyana@gvsig.com</email> |
|
49 |
<roles> |
|
50 |
<role>Architect</role> |
|
51 |
<role>Developer</role> |
|
52 |
</roles> |
|
53 |
</developer> |
|
54 |
</developers> |
|
55 |
|
|
56 |
<distributionManagement> |
|
57 |
<site> |
|
58 |
<id>gvsig-repository</id> |
|
59 |
<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.mkmvnproject/${pom.version}</url> |
|
60 |
</site> |
|
61 |
</distributionManagement> |
|
62 |
<repositories> |
|
63 |
<repository> |
|
64 |
<id>gvsig-public-http-repository</id> |
|
65 |
<name>gvSIG maven public HTTP repository</name> |
|
66 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url> |
|
67 |
<releases> |
|
68 |
<enabled>true</enabled> |
|
69 |
<updatePolicy>daily</updatePolicy> |
|
70 |
<checksumPolicy>warn</checksumPolicy> |
|
71 |
</releases> |
|
72 |
<snapshots> |
|
73 |
<enabled>true</enabled> |
|
74 |
<updatePolicy>daily</updatePolicy> |
|
75 |
<checksumPolicy>warn</checksumPolicy> |
|
76 |
</snapshots> |
|
77 |
</repository> |
|
78 |
</repositories> |
|
79 |
|
|
80 |
<dependencyManagement> |
|
81 |
<dependencies> |
|
82 |
<dependency> |
|
83 |
<groupId>org.apache.ant</groupId> |
|
84 |
<artifactId>ant</artifactId> |
|
85 |
<version>1.8.1</version> |
|
86 |
</dependency> |
|
87 |
<dependency> |
|
88 |
<groupId>org.apache.ant</groupId> |
|
89 |
<artifactId>ant-apache-oro</artifactId> |
|
90 |
<version>1.8.1</version> |
|
91 |
</dependency> |
|
92 |
<dependency> |
|
93 |
<groupId>ant-contrib</groupId> |
|
94 |
<artifactId>ant-contrib</artifactId> |
|
95 |
<version>1.0b3</version> |
|
96 |
</dependency> |
|
97 |
<dependency> |
|
98 |
<groupId>org.apache.ant</groupId> |
|
99 |
<artifactId>ant-launcher</artifactId> |
|
100 |
<version>1.8.1</version> |
|
101 |
</dependency> |
|
102 |
<dependency> |
|
103 |
<groupId>org.apache.ant</groupId> |
|
104 |
<artifactId>ant-nodeps</artifactId> |
|
105 |
<version>1.8.1</version> |
|
106 |
</dependency> |
|
107 |
<dependency> |
|
108 |
<groupId>org.tigris.antelope</groupId> |
|
109 |
<artifactId>antelopetasks</artifactId> |
|
110 |
<version>3.2.10</version> |
|
111 |
</dependency> |
|
112 |
<dependency> |
|
113 |
<groupId>com.sardak</groupId> |
|
114 |
<artifactId>antform</artifactId> |
|
115 |
<version>2.0</version> |
|
116 |
</dependency> |
|
117 |
<dependency> |
|
118 |
<groupId>org.gvsig</groupId> |
|
119 |
<artifactId>org.gvsig.andami</artifactId> |
|
120 |
<version>2.0-SNAPSHOT</version> |
|
121 |
</dependency> |
|
122 |
<dependency> |
|
123 |
<groupId>org.gvsig</groupId> |
|
124 |
<artifactId>org.gvsig.core.maven.dependencies</artifactId> |
|
125 |
<version>2.0.0-SNAPSHOT</version> |
|
126 |
<type>pom</type> |
|
127 |
<scope>import</scope> |
|
128 |
</dependency> |
|
129 |
<dependency> |
|
130 |
<groupId>org.gvsig</groupId> |
|
131 |
<artifactId>org.gvsig.maven.base.build</artifactId> |
|
132 |
<version>1.0.6-SNAPSHOT</version> |
|
133 |
</dependency> |
|
134 |
<dependency> |
|
135 |
<groupId>org.gvsig</groupId> |
|
136 |
<artifactId>org.gvsig.i18n</artifactId> |
|
137 |
<version>2.0-SNAPSHOT</version> |
|
138 |
</dependency> |
|
139 |
<dependency> |
|
140 |
<groupId>org.tmatesoft.svnkit</groupId> |
|
141 |
<artifactId>svnkit</artifactId> |
|
142 |
<version>1.3.3</version> |
|
143 |
<scope>runtime</scope> |
|
144 |
</dependency> |
|
145 |
<dependency> |
|
146 |
<groupId>org.tmatesoft.svnkit</groupId> |
|
147 |
<artifactId>svnkit-cli</artifactId> |
|
148 |
<version>1.3.3</version> |
|
149 |
<scope>runtime</scope> |
|
150 |
</dependency> |
|
151 |
</dependencies> |
|
152 |
</dependencyManagement> |
|
153 |
<dependencies> |
|
154 |
<dependency> |
|
155 |
<groupId>org.apache.ant</groupId> |
|
156 |
<artifactId>ant</artifactId> |
|
157 |
</dependency> |
|
158 |
<dependency> |
|
159 |
<groupId>org.apache.ant</groupId> |
|
160 |
<artifactId>ant-apache-oro</artifactId> |
|
161 |
</dependency> |
|
162 |
<dependency> |
|
163 |
<groupId>ant-contrib</groupId> |
|
164 |
<artifactId>ant-contrib</artifactId> |
|
165 |
</dependency> |
|
166 |
<dependency> |
|
167 |
<groupId>org.apache.ant</groupId> |
|
168 |
<artifactId>ant-launcher</artifactId> |
|
169 |
</dependency> |
|
170 |
<dependency> |
|
171 |
<groupId>org.apache.ant</groupId> |
|
172 |
<artifactId>ant-nodeps</artifactId> |
|
173 |
</dependency> |
|
174 |
<dependency> |
|
175 |
<groupId>org.tigris.antelope</groupId> |
|
176 |
<artifactId>antelopetasks</artifactId> |
|
177 |
</dependency> |
|
178 |
<dependency> |
|
179 |
<groupId>com.sardak</groupId> |
|
180 |
<artifactId>antform</artifactId> |
|
181 |
</dependency> |
|
182 |
<dependency> |
|
183 |
<groupId>org.gvsig</groupId> |
|
184 |
<artifactId>org.gvsig.andami</artifactId> |
|
185 |
</dependency> |
|
186 |
<dependency> |
|
187 |
<groupId>org.gvsig</groupId> |
|
188 |
<artifactId>org.gvsig.maven.base.build</artifactId> |
|
189 |
</dependency> |
|
190 |
<dependency> |
|
191 |
<groupId>org.gvsig</groupId> |
|
192 |
<artifactId>org.gvsig.i18n</artifactId> |
|
193 |
</dependency> |
|
194 |
<dependency> |
|
195 |
<groupId>org.tmatesoft.svnkit</groupId> |
|
196 |
<artifactId>svnkit</artifactId> |
|
197 |
<scope>runtime</scope> |
|
198 |
</dependency> |
|
199 |
<dependency> |
|
200 |
<groupId>org.tmatesoft.svnkit</groupId> |
|
201 |
<artifactId>svnkit-cli</artifactId> |
|
202 |
<scope>runtime</scope> |
|
203 |
</dependency> |
|
204 |
</dependencies> |
|
205 |
<build> |
|
206 |
<resources> |
|
207 |
<resource> |
|
208 |
<directory>src/main/resources</directory> |
|
209 |
<excludes> |
|
210 |
<exclude>config.xml</exclude> |
|
211 |
<exclude>gvSIG.png</exclude> |
|
212 |
<exclude>scripts/**</exclude> |
|
213 |
</excludes> |
|
214 |
</resource> |
|
215 |
</resources> |
|
216 |
|
|
217 |
<plugins> |
|
218 |
<plugin> |
|
219 |
<groupId>org.apache.maven.plugins</groupId> |
|
220 |
<artifactId>maven-release-plugin</artifactId> |
|
221 |
<configuration> |
|
222 |
<tagBase>https://svn.forge.osor.eu/svn/gvsig-desktop/tags</tagBase> |
|
223 |
</configuration> |
|
224 |
</plugin> |
|
225 |
<plugin> |
|
226 |
<artifactId>maven-antrun-plugin</artifactId> |
|
227 |
<executions> |
|
228 |
<execution> |
|
229 |
<id>prepare-templates</id> |
|
230 |
<phase>package</phase> |
|
231 |
<configuration> |
|
232 |
<tasks> |
|
233 |
<!-- Regexp implementation to use --> |
|
234 |
<property name="ant.regexp.regexpimpl" |
|
235 |
value="org.apache.tools.ant.util.regexp.JakartaOroRegexp" /> |
|
236 |
|
|
237 |
<property name="runtime_classpath" |
|
238 |
refid="maven.runtime.classpath" /> |
|
239 |
<ant antfile="${basedir}/prepare-templates.xml" /> |
|
240 |
</tasks> |
|
241 |
</configuration> |
|
242 |
<goals> |
|
243 |
<goal>run</goal> |
|
244 |
</goals> |
|
245 |
</execution> |
|
246 |
</executions> |
|
247 |
<dependencies> |
|
248 |
<dependency> |
|
249 |
<groupId>org.apache.ant</groupId> |
|
250 |
<artifactId>ant-apache-oro</artifactId> |
|
251 |
<version>1.8.1</version> |
|
252 |
</dependency> |
|
253 |
</dependencies> |
|
254 |
</plugin> |
|
255 |
</plugins> |
|
256 |
</build> |
|
257 |
<profiles> |
|
258 |
<profile> |
|
259 |
<id>gvsig-install</id> |
|
260 |
<activation> |
|
261 |
<activeByDefault>true</activeByDefault> |
|
262 |
</activation> |
|
263 |
<properties> |
|
264 |
<!-- gvSIG installation folder relative to the current workspace --> |
|
265 |
<gvsig.install.dir>${basedir}/../build/product</gvsig.install.dir> |
|
266 |
</properties> |
|
267 |
</profile> |
|
268 |
<profile> |
|
269 |
<id>create-project</id> |
|
270 |
<build> |
|
271 |
<plugins> |
|
272 |
<plugin> |
|
273 |
<artifactId>maven-antrun-plugin</artifactId> |
|
274 |
<executions> |
|
275 |
<execution> |
|
276 |
<id>Run mkmvnproject.xml</id> |
|
277 |
<phase>install</phase> |
|
278 |
<configuration> |
|
279 |
<tasks> |
|
280 |
<!-- Regexp implementation to use --> |
|
281 |
<property name="ant.regexp.regexpimpl" |
|
282 |
value="org.apache.tools.ant.util.regexp.JakartaOroRegexp" /> |
|
283 |
<ant |
|
284 |
antfile="${project.build.directory}/${project.artifactId}-${project.version}-distribution/${project.artifactId}-${project.version}/gvSIG/extensiones/${project.artifactId}/scripts/mkmvnproject.xml" /> |
|
285 |
</tasks> |
|
286 |
</configuration> |
|
287 |
<goals> |
|
288 |
<goal>run</goal> |
|
289 |
</goals> |
|
290 |
</execution> |
|
291 |
</executions> |
|
292 |
<dependencies> |
|
293 |
<dependency> |
|
294 |
<groupId>org.apache.ant</groupId> |
|
295 |
<artifactId>ant-apache-oro</artifactId> |
|
296 |
<version>1.8.1</version> |
|
297 |
</dependency> |
|
298 |
</dependencies> |
|
299 |
</plugin> |
|
300 |
</plugins> |
|
301 |
</build> |
|
302 |
</profile> |
|
303 |
<profile> |
|
304 |
<id>gvsig-install</id> |
|
305 |
<activation> |
|
306 |
<activeByDefault>true</activeByDefault> |
|
307 |
</activation> |
|
308 |
<properties> |
|
309 |
<!-- |
|
310 |
Default gvSIG installation folder relative to the current |
|
311 |
workspace |
|
312 |
--> |
|
313 |
<gvsig.install.dir>${basedir}/../build/product</gvsig.install.dir> |
|
314 |
</properties> |
|
315 |
</profile> |
|
316 |
</profiles> |
|
317 |
</project> |
|
0 | 318 |
tags/v2_0_0_Build_2022/extensions/org.gvsig.mkmvnproject/build.xml | ||
---|---|---|
1 |
<project name="gvSIG-build-config" default="mvn-install" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
|
2 |
|
|
3 |
<property name="maven.folder" |
|
4 |
location="${basedir}/src/main/resources/maven" /> |
|
5 |
|
|
6 |
<!-- Maven ant tasks registration --> |
|
7 |
<path id="maven-ant-tasks.classpath" |
|
8 |
path="${maven.folder}/lib/maven-ant-tasks-2.0.10.jar" /> |
|
9 |
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" |
|
10 |
uri="antlib:org.apache.maven.artifact.ant" |
|
11 |
classpathref="maven-ant-tasks.classpath" /> |
|
12 |
|
|
13 |
<!-- Maven targets --> |
|
14 |
<macrodef name="maven"> |
|
15 |
<attribute name="arg" /> |
|
16 |
<sequential> |
|
17 |
<echo>mvn @{arg}</echo> |
|
18 |
<artifact:mvn mavenHome="${maven.folder}" fork="true" |
|
19 |
failonerror="true" maxmemory="256M"> |
|
20 |
<arg line="@{arg}" /> |
|
21 |
<jvmarg value="-XX:MaxPermSize=64M" /> |
|
22 |
</artifact:mvn> |
|
23 |
</sequential> |
|
24 |
</macrodef> |
|
25 |
|
|
26 |
<!-- Utility targets --> |
|
27 |
<target name="cancel"> |
|
28 |
<fail>User canceled</fail> |
|
29 |
</target> |
|
30 |
|
|
31 |
<target name="mvn-clean" description="Cleans all artifacts"> |
|
32 |
<maven arg="clean" /> |
|
33 |
</target> |
|
34 |
|
|
35 |
<target name="mvn-compile" description="Compiles all source code"> |
|
36 |
<maven arg="compile" /> |
|
37 |
</target> |
|
38 |
|
|
39 |
<target name="mvn-test" description="Launches unit tests"> |
|
40 |
<maven arg="test" /> |
|
41 |
</target> |
|
42 |
|
|
43 |
<target name="mvn-install" description="Compiles and installs"> |
|
44 |
<maven arg="install" /> |
Also available in: Unified diff