svn-gvsig-desktop / branches / v2_0_0_prep / extensions / org.gvsig.mkmvnproject / src / main / resources / scripts / fortunecookies.xml @ 37291
History | View | Annotate | Download (11.4 KB)
1 |
<?xml version="1.0" encoding="ISO-8859-1"?>
|
---|---|
2 |
<project name="gvSIG-make-maven-project" default="mkproject-build" basedir="."> |
3 |
|
4 |
<!-- Get current file location folder -->
|
5 |
<dirname property="gvSIG-make-maven-project.basedir" file="${ant.file.gvSIG-make-maven-project}" /> |
6 |
|
7 |
<!-- Libraries folder in the gvSIG extension -->
|
8 |
<property name="lib.folder" location="${gvSIG-make-maven-project.basedir}/../lib" /> |
9 |
<!-- Templates folder in the gvSIG extension -->
|
10 |
<property name="templates.folder" location="${gvSIG-make-maven-project.basedir}/../templates" /> |
11 |
|
12 |
<property name="gvsiglogo" location="${basedir}/../gvSIG.png" /> |
13 |
|
14 |
<!-- Load some ant external utility tasks -->
|
15 |
<property name="antform.lib" location="${lib.folder}/antform-2.0.jar" /> |
16 |
<property name="antcontrib.lib" location="${lib.folder}/ant-contrib-1.0b3.jar" /> |
17 |
<property name="antelope.lib" location="${lib.folder}/antelopetasks-3.2.10.jar" /> |
18 |
|
19 |
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
20 |
<classpath>
|
21 |
<pathelement location="${antcontrib.lib}" /> |
22 |
</classpath>
|
23 |
</taskdef>
|
24 |
|
25 |
<taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="${antform.lib}" /> |
26 |
|
27 |
<taskdef name="antmenu" classname="com.sardak.antform.AntMenu" classpath="${antform.lib}" /> |
28 |
|
29 |
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" classpath="${antelope.lib}" /> |
30 |
|
31 |
<target name="mkproject-build-cancelled"> |
32 |
<antform title="Project creation cancelled" width="${form.width}" image="${gvsiglogo}"> |
33 |
<textProperty label="" editable="false" columns="40" property="form.title" /> |
34 |
<label>Creation cancelled.</label> |
35 |
<separator /> |
36 |
<controlbar>
|
37 |
<button type="cancel" label=" Close " /> |
38 |
</controlbar>
|
39 |
</antform>
|
40 |
</target>
|
41 |
|
42 |
|
43 |
<target name="mkproject-prompt-data"> |
44 |
<property name="project.type" value="1" /> |
45 |
<property name="create.main" value="true" /> |
46 |
<property name="create.ui.library" value="true" /> |
47 |
<property name="create.plugin" value="false" /> |
48 |
|
49 |
<antform title="Create project" width="${form.width}" image="${gvsiglogo}"> |
50 |
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" /> |
51 |
|
52 |
<textProperty label="Project" editable="false" property="project.name" /> |
53 |
<textProperty label="Group Id" editable="false" property="project.group.id" /> |
54 |
<textProperty label="Artifact Id" editable="false" property="project.artifact.id" /> |
55 |
<textProperty label="Folder" editable="false" property="project.folder" /> |
56 |
<separator /> |
57 |
<radioSelectionProperty property="selected.project.type" separator="#" values="1- Basic, API separated of the implementation#2- With providers, implementation requires provider services" editable="true" label="Choose project type :" /> |
58 |
<booleanProperty property="create.main" editable="true" label="Create test application" /> |
59 |
<booleanProperty property="create.ui.library" editable="true" label="Create swing library projects" /> |
60 |
<booleanProperty property="create.plugin" editable="true" label="Create gvSIG plugin" /> |
61 |
<separator /> |
62 |
<controlbar>
|
63 |
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" /> |
64 |
<button type="ok" label=" Next " target="mkproject-confirm" /> |
65 |
</controlbar>
|
66 |
</antform>
|
67 |
</target>
|
68 |
|
69 |
<target name="mkproject-confirm-data"> |
70 |
|
71 |
<propertyregex property="project.type" input="${selected.project.type}" regexp="([1-5]).*" select="\1" defaultvalue="1" /> |
72 |
|
73 |
<antform title="Confirm the creation" width="${form.width}" image="${gvsiglogo}"> |
74 |
<textProperty label="" editable="false" columns="${form.columns}" property="form.title" /> |
75 |
<label>The data used for the creation of project are:</label> |
76 |
|
77 |
<textProperty label="Project" editable="false" property="project.name" /> |
78 |
<textProperty label="Project name capitalized" editable="false" property="${project.name.capitalized}" /> |
79 |
<textProperty label="Project name lowercase" editable="false" property="${project.name.lowercase}" /> |
80 |
<textProperty label="Group Id" editable="false" property="project.group.id" /> |
81 |
<textProperty label="Artifact Id" editable="false" property="project.artifact.id" /> |
82 |
<textProperty label="Folder" editable="false" property="project.folder" /> |
83 |
|
84 |
<textProperty label="Create main" editable="false" property="create.main" /> |
85 |
<textProperty label="Create UI library" editable="false" property="create.ui.library" /> |
86 |
<textProperty label="Create plugin" editable="false" property="create.plugin" /> |
87 |
<textProperty label="Project type" editable="false" property="project.type" /> |
88 |
|
89 |
<label>Continue ?</label> |
90 |
<separator /> |
91 |
<controlbar>
|
92 |
<button type="cancel" label=" Cancel " target="mkproject-build-cancelled" /> |
93 |
<button type="ok" label=" Previous " target="mkproject-prompt-data" /> |
94 |
<button type="ok" label=" Next " /> |
95 |
</controlbar>
|
96 |
</antform>
|
97 |
|
98 |
</target>
|
99 |
|
100 |
<target name="mkproject-build" depends="mkproject-prompt-data"> |
101 |
<echo>
|
102 |
Project name: "${project.name}" |
103 |
Project name capitalized: "${project.name.capitalized}" |
104 |
Project name lowercase: ${project.name.lowercase}" |
105 |
Group id: "${project.group.id}" |
106 |
ArtifactId: "${project.artifact.id}" |
107 |
Project folder: "${project.folder}" |
108 |
Create main: "${create.main}" |
109 |
Create UI library: "${create.ui.library}" |
110 |
Create plugin: "${create.plugin}" |
111 |
Project type: "${project.type}" |
112 |
</echo>
|
113 |
|
114 |
<if>
|
115 |
<equals arg1="${project.type}" arg2="1" /> |
116 |
<then>
|
117 |
<echo>Unzipping the basic template project</echo> |
118 |
<unzip src="${templates.folder}/fortunecookies-basic.zip" dest="${project.folder}" /> |
119 |
</then>
|
120 |
<else>
|
121 |
<echo>Unzipping the provider based implementation template project</echo> |
122 |
<unzip src="${templates.folder}/fortunecookies-pbi.zip" dest="${project.folder}" /> |
123 |
</else>
|
124 |
</if>
|
125 |
|
126 |
<!-- Calculate the project artifact id as PATH -->
|
127 |
<propertyregex property="project.artifact.id.folder" input="${project.artifact.id}" regexp="([^\.]*).([^\.]*)" replace="\1${file.separator}\2" /> |
128 |
|
129 |
|
130 |
<echo>Remove non wanted projects</echo> |
131 |
<if>
|
132 |
<equals arg1="${create.plugin}" arg2="false" /> |
133 |
<then>
|
134 |
<echo>Remove the gvSIG extension projects</echo> |
135 |
<delete dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" /> |
136 |
<delete dir="${project.folder}/org.gvsig.fortunecookies.app" /> |
137 |
</then>
|
138 |
</if>
|
139 |
<if>
|
140 |
<equals arg1="${create.main}" arg2="false" /> |
141 |
<then>
|
142 |
<echo>Remove the library test main project</echo> |
143 |
<delete dir="${project.foldern}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" /> |
144 |
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main</module>" value="" /> |
145 |
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" /> |
146 |
</then>
|
147 |
</if>
|
148 |
<if>
|
149 |
<equals arg1="${create.ui.library}" arg2="false" /> |
150 |
<then>
|
151 |
<echo>Remove the Swing library</echo> |
152 |
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.swing" /> |
153 |
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.swing</module>" value="" /> |
154 |
<if>
|
155 |
<equals arg1="${create.plugin}" arg2="true" /> |
156 |
<then>
|
157 |
<echo>Leave only the extension which depends on the swing components</echo> |
158 |
<delete dir="${project.folder}/org.gvsig.fortunecookies.app" /> |
159 |
<move todir="${project.folder}/org.gvsig.fortunecookies.app"> |
160 |
<fileset dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" /> |
161 |
</move>
|
162 |
</then>
|
163 |
</if>
|
164 |
<if>
|
165 |
<equals arg1="${create.main}" arg2="true" /> |
166 |
<then>
|
167 |
<echo>Leave only the Main class which not depends on the swing components</echo> |
168 |
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main" /> |
169 |
<move todir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main"> |
170 |
<fileset dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" /> |
171 |
</move>
|
172 |
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" /> |
173 |
<replace file="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main/pom.xml" token="org.gvsig.fortunecookies.main.noswinglib" value="org.gvsig.fortunecookies.main" /> |
174 |
</then>
|
175 |
</if>
|
176 |
</then>
|
177 |
<else>
|
178 |
<!-- Let the Swing library and use the extension which uses that library -->
|
179 |
<if>
|
180 |
<equals arg1="${create.plugin}" arg2="true" /> |
181 |
<then>
|
182 |
<echo>Leave only the extension which not depends on the swing components</echo> |
183 |
<delete dir="${project.folder}/org.gvsig.fortunecookies.app.noswinglib" /> |
184 |
</then>
|
185 |
</if>
|
186 |
<if>
|
187 |
<equals arg1="${create.main}" arg2="true" /> |
188 |
<then>
|
189 |
<echo>Leave only the Main class which depends on the swing components</echo> |
190 |
<delete dir="${project.folder}/org.gvsig.fortunecookies/org.gvsig.fortunecookies.main.noswinglib" /> |
191 |
<replace file="${project.folder}/org.gvsig.fortunecookies/pom.xml" token="<module>org.gvsig.fortunecookies.main.noswinglib</module>" value="" /> |
192 |
</then>
|
193 |
</if>
|
194 |
</else>
|
195 |
</if>
|
196 |
|
197 |
<echo>Renaming folder ${project.folder}/org.gvsig.fortunecookies to
|
198 |
${project.folder}/${project.artifact.id}</echo>
|
199 |
<move todir="${project.folder}"> |
200 |
<fileset dir="${project.folder}"> |
201 |
<include name="org.gvsig.fortunecookies/**" /> |
202 |
<include name="org.gvsig.fortunecookies.app/**" /> |
203 |
</fileset>
|
204 |
<mapper>
|
205 |
<filtermapper>
|
206 |
<replacestring from="org.gvsig.fortunecookies" to="${project.artifact.id}" /> |
207 |
<replacestring from="org${file.separator}gvsig${file.separator}fortunecookies" to="${project.artifact.id.folder}" /> |
208 |
<replacestring from="FortuneCookie" to="${project.name.capitalized}" /> |
209 |
</filtermapper>
|
210 |
</mapper>
|
211 |
<filterchain>
|
212 |
<tokenfilter>
|
213 |
<!-- Replace fortune cookie server url as it contains the FortuneCookie word in it. -->
|
214 |
<replacestring from="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" to="FC_URL_TO_PRESERVE" /> |
215 |
</tokenfilter>
|
216 |
<tokenfilter>
|
217 |
<replacestring from="org.gvsig.fortunecookies" to="${project.artifact.id}" /> |
218 |
</tokenfilter>
|
219 |
<tokenfilter>
|
220 |
<replacestring from="FortuneCookies" to="${project.name.capitalized}" /> |
221 |
<replacestring from="Fortune Cookies" to="${project.name.capitalized}" /> |
222 |
<replacestring from="Fortune cookies" to="${project.name.capitalized}" /> |
223 |
<replacestring from="fortune cookies" to="${project.name.capitalized}" /> |
224 |
<replacestring from="gvsig-fortunecookies" to="gvsig-${project.name.lowercase}" /> |
225 |
<replacestring from="fortunecookies" to="${project.name.capitalized}" /> |
226 |
</tokenfilter>
|
227 |
<tokenfilter>
|
228 |
<replacestring from="FortuneCookie" to="${project.name.capitalized}" /> |
229 |
<replacestring from="Fortune Cookie" to="${project.name.capitalized}" /> |
230 |
<replacestring from="Fortune cookie" to="${project.name.capitalized}" /> |
231 |
<replacestring from="fortune cookie" to="${project.name.capitalized}" /> |
232 |
<replacestring from="gvsig-fortunecookie" to="gvsig-${project.name.lowercase}" /> |
233 |
<replacestring from="fortunecookie" to="${project.name.capitalized}" /> |
234 |
</tokenfilter>
|
235 |
<tokenfilter>
|
236 |
<!-- Restore the fortune cookie server URL -->
|
237 |
<replacestring from="FC_URL_TO_PRESERVE" to="http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie" /> |
238 |
</tokenfilter>
|
239 |
</filterchain>
|
240 |
</move>
|
241 |
|
242 |
</target>
|
243 |
|
244 |
|
245 |
</project>
|