svn-gvsig-desktop / tags / v2_0_0_Build_2007 / build / build.xml @ 33449
History | View | Annotate | Download (9.76 KB)
1 | 29192 | cordinyana | <project name="gvSIG build" basedir="../.." |
---|---|---|---|
2 | default="mvn-configure-eclipse-workspace" |
||
3 | xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
||
4 | 29319 | cordinyana | |
5 | 20506 | jcampos | <description>
|
6 | 29185 | cordinyana | Ant tasks and macros to interact with maven |
7 | 20506 | jcampos | </description>
|
8 | 29319 | cordinyana | |
9 | 20506 | jcampos | <!-- set global properties for this build -->
|
10 | 29192 | cordinyana | <dirname file="${ant.file.Complete_build_system}" property="ant.file.Complete_build_system.dir"/> |
11 | <dirname file="${ant.file.Complete_build_system.dir}" property="workspace_loc"/> |
||
12 | 29319 | cordinyana | |
13 | 23397 | jmvivo | <property name="mavendir" location="${ant.file.Complete_build_system.dir}/maven" /> |
14 | 29190 | cordinyana | <!--property environment="environment"/-->
|
15 | 29192 | cordinyana | <property name="ant.libs.dir" location="../../ant-tasks"/> |
16 | 23397 | jmvivo | |
17 | 29185 | cordinyana | <!-- ============================= -->
|
18 | <!-- External ant tasks definition -->
|
||
19 | <!-- ============================= -->
|
||
20 | 29319 | cordinyana | |
21 | <!-- Maven ant tasks registration -->
|
||
22 | 29185 | cordinyana | <path id="maven-ant-tasks.classpath" path="${ant.libs.dir}/maven-ant-tasks-2.0.10.jar" /> |
23 | 29192 | cordinyana | <typedef resource="org/apache/maven/artifact/ant/antlib.xml" |
24 | uri="antlib:org.apache.maven.artifact.ant" |
||
25 | classpathref="maven-ant-tasks.classpath" /> |
||
26 | 20506 | jcampos | |
27 | 29185 | cordinyana | <!-- ant-contrib library load -->
|
28 | <taskdef resource="net/sf/antcontrib/antlib.xml"> |
||
29 | 29319 | cordinyana | <classpath>
|
30 | <pathelement location="${ant.libs.dir}/ant-contrib-1.0b3.jar"/> |
||
31 | <pathelement location="${ant.libs.dir}/bcel-5.1.jar"/> |
||
32 | <pathelement location="${ant.libs.dir}/commons-httpclient-3.0.1.jar"/> |
||
33 | <pathelement location="${ant.libs.dir}/commons-logging-1.0.4.jar"/> |
||
34 | <pathelement location="${ant.libs.dir}/ivy-1.3.1.jar"/> |
||
35 | </classpath>
|
||
36 | 29185 | cordinyana | </taskdef>
|
37 | 20506 | jcampos | |
38 | 29185 | cordinyana | <!-- Maven targets -->
|
39 | <macrodef name="maven"> |
||
40 | 29319 | cordinyana | <attribute name="arg" /> |
41 | <sequential>
|
||
42 | <echo>mvn @{arg}</echo> |
||
43 | <artifact:mvn mavenHome="../../maven" fork="true" failonerror="true"> |
||
44 | <arg line="@{arg}"/> |
||
45 | </artifact:mvn>
|
||
46 | </sequential>
|
||
47 | </macrodef>
|
||
48 | |||
49 | 29192 | cordinyana | <target name="mvn-clean" |
50 | description="Cleans all artifacts"> |
||
51 | 29185 | cordinyana | <maven arg="clean" /> |
52 | </target>
|
||
53 | 20506 | jcampos | |
54 | 29192 | cordinyana | <target name="mvn-install" |
55 | description="Compiles and installs"> |
||
56 | 29185 | cordinyana | <maven arg="install" /> |
57 | 20506 | jcampos | </target>
|
58 | 29319 | cordinyana | |
59 | 29192 | cordinyana | <target name="mvn-install-without-tests" |
60 | description="Compiles and installs without launching tests"> |
||
61 | 29185 | cordinyana | <maven arg="-Dmaven.test.skip=true install" /> |
62 | 20506 | jcampos | </target>
|
63 | 23397 | jmvivo | |
64 | 29192 | cordinyana | <target name="mvn-reinstall" depends="mvn-clean,mvn-install" |
65 | description="Performs a clean install"/> |
||
66 | 23397 | jmvivo | |
67 | 29192 | cordinyana | <target name="mvn-reinstall-without-tests" |
68 | depends="mvn-clean,mvn-install-without-tests" |
||
69 | description="Performs a clean install without launching tests"/> |
||
70 | 29190 | cordinyana | |
71 | 29192 | cordinyana | <target name="mvn-deploy" |
72 | description="Compiles, installs and deploys"> |
||
73 | 29190 | cordinyana | <maven arg="deploy" /> |
74 | </target>
|
||
75 | 29319 | cordinyana | |
76 | 29192 | cordinyana | <target name="mvn-configure-eclipse-workspace" |
77 | description="Configures the eclipse workspace for maven integration"> |
||
78 | 29319 | cordinyana | |
79 | <input message="Eclipse workspace folder to configure?:" |
||
80 | addproperty="eclipse.workspace" |
||
81 | defaultvalue="${workspace_loc}"/> |
||
82 | |||
83 | <maven arg="-Declipse.workspace='${eclipse.workspace}' eclipse:add-maven-repo" /> |
||
84 | <mkdir dir="${eclipse.workspace}/.metadata/.plugins/org.eclipse.ui.workbench" /> |
||
85 | 29323 | cordinyana | <copy file="../../metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml" |
86 | 29319 | cordinyana | todir="${eclipse.workspace}/.metadata/.plugins/org.eclipse.ui.workbench" /> |
87 | 23397 | jmvivo | </target>
|
88 | |||
89 | 29192 | cordinyana | <target name="mvn-eclipse-clean" |
90 | description="Cleans the maven generated eclipse project files"> |
||
91 | 29185 | cordinyana | <maven arg="eclipse:clean" /> |
92 | 20506 | jcampos | </target>
|
93 | |||
94 | 29192 | cordinyana | <target name="mvn-eclipse-eclipse" |
95 | description="Generates an eclipse project configuration from the pom.xml"> |
||
96 | 29185 | cordinyana | <maven arg="eclipse:eclipse" /> |
97 | 23397 | jmvivo | </target>
|
98 | |||
99 | 29307 | cordinyana | <target name="mvn-create-library" |
100 | description="Generates a new library project with the initial structure and configuration"> |
||
101 | 29319 | cordinyana | |
102 | 29307 | cordinyana | <input message="Library maven groupId:" |
103 | addproperty="lib.groupId" |
||
104 | defaultvalue="org.gvsig" /> |
||
105 | 29319 | cordinyana | |
106 | 29307 | cordinyana | <input message="Library maven artifactId:" |
107 | addproperty="lib.artifactId"/> |
||
108 | 29319 | cordinyana | |
109 | 29307 | cordinyana | <input message="Library main java package:" |
110 | addproperty="lib.package" |
||
111 | defaultvalue="${lib.artifactId}"/> |
||
112 | 29319 | cordinyana | |
113 | 29307 | cordinyana | <input message="Library version:" |
114 | addproperty="lib.version" |
||
115 | defaultvalue="2.0-SNAPSHOT" /> |
||
116 | 29319 | cordinyana | |
117 | 29307 | cordinyana | <maven arg="archetype:generate -B -DarchetypeGroupId=org.gvsig -DarchetypeArtifactId=org.gvsig.library-archetype -DgroupId=${lib.groupId} -DartifactId=${lib.artifactId} -Dversion=${lib.version} -Dpackage=${lib.package}" /> |
118 | 29319 | cordinyana | |
119 | 29307 | cordinyana | <move todir="../../../${lib.artifactId}"> |
120 | <fileset dir="${lib.artifactId}" /> |
||
121 | </move>
|
||
122 | 29319 | cordinyana | |
123 | 29331 | cordinyana | <artifact:mvn mavenHome="../../maven" fork="true" failonerror="true" |
124 | dir="../../../${lib.artifactId}"> |
||
125 | <arg line="eclipse:eclipse"/> |
||
126 | 29319 | cordinyana | </artifact:mvn>
|
127 | 29307 | cordinyana | </target>
|
128 | |||
129 | 29185 | cordinyana | <!-- Projects checkout targets -->
|
130 | 29319 | cordinyana | <target name="svn.checkout.all" depends="svn.getparams" description="Checkouts all projects defined in a parent module pom.xml"> |
131 | 29239 | cordinyana | |
132 | 29170 | jjdelcerro | <artifact:pom id="pom" file="pom.xml" /> |
133 | <for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true"> |
||
134 | <sequential>
|
||
135 | 29192 | cordinyana | <var name="svn.isgroup" unset="true"/> |
136 | 29319 | cordinyana | <propertyregex property="svn.module" |
137 | 29192 | cordinyana | input="@{svn.module}" |
138 | regexp="[./]*(.*)" |
||
139 | replace="\1" |
||
140 | casesensitive="false" |
||
141 | override="true"/> |
||
142 | <available file="../${svn.module}" property="svn.isgroup"/> |
||
143 | 29239 | cordinyana | <antcall target="svn.checkout.group"> |
144 | 29192 | cordinyana | <param name="svn.module" value="${svn.module}"/> |
145 | 29170 | jjdelcerro | </antcall>
|
146 | 29239 | cordinyana | <antcall target="svn.checkout.project"> |
147 | 29192 | cordinyana | <param name="svn.module" value="${svn.module}"/> |
148 | 29170 | jjdelcerro | </antcall>
|
149 | </sequential>
|
||
150 | </for>
|
||
151 | </target>
|
||
152 | |||
153 | 29239 | cordinyana | <target name="svn.update.all" |
154 | description="Updates all projects defined in a parent module pom.xml"> |
||
155 | |||
156 | <artifact:pom id="pom" file="pom.xml" /> |
||
157 | <for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true"> |
||
158 | <sequential>
|
||
159 | <var name="svn.isgroup" unset="true"/> |
||
160 | 29319 | cordinyana | <propertyregex property="svn.module" |
161 | 29239 | cordinyana | input="@{svn.module}" |
162 | regexp="[./]*(.*)" |
||
163 | replace="\1" |
||
164 | casesensitive="false" |
||
165 | override="true"/> |
||
166 | <available file="../${svn.module}" property="svn.isgroup"/> |
||
167 | <antcall target="svn.update.group"> |
||
168 | <param name="svn.module" value="${svn.module}"/> |
||
169 | </antcall>
|
||
170 | <antcall target="svn.update.project"> |
||
171 | <param name="svn.module" value="${svn.module}"/> |
||
172 | </antcall>
|
||
173 | </sequential>
|
||
174 | </for>
|
||
175 | </target>
|
||
176 | |||
177 | <target name="svn.checkout.group" if="svn.isgroup"> |
||
178 | 29170 | jjdelcerro | <echo>group: ${svn.module}</echo> |
179 | 29239 | cordinyana | <ant dir="../${svn.module}" target="svn.checkout.all"/> |
180 | 29170 | jjdelcerro | </target>
|
181 | |||
182 | 29319 | cordinyana | <target name="svn.checkout.project" unless="svn.isgroup" |
183 | 29239 | cordinyana | depends="svn.get.project.path"> |
184 | 29170 | jjdelcerro | <echo>project: ${svn.module}</echo> |
185 | 29239 | cordinyana | <antcall target="svn.checkout"> |
186 | 29192 | cordinyana | <param name="svn.project.path" value="../../.."/> |
187 | <param name="svn.project.url" value="${svn.repository.url}/${svn.module}"/> |
||
188 | 29319 | cordinyana | </antcall>
|
189 | </target>
|
||
190 | 29239 | cordinyana | |
191 | <target name="svn.update.group" if="svn.isgroup"> |
||
192 | <echo>group: ${svn.module}</echo> |
||
193 | <ant dir="../${svn.module}" target="svn.update.all"/> |
||
194 | 29170 | jjdelcerro | </target>
|
195 | |||
196 | 29319 | cordinyana | <target name="svn.update.project" unless="svn.isgroup" |
197 | 29239 | cordinyana | depends="svn.get.project.path"> |
198 | <echo>project: ${svn.module}</echo> |
||
199 | <antcall target="svn.update"> |
||
200 | <param name="svn.project.path" value="../../.."/> |
||
201 | <param name="svn.project.url" value="${svn.repository.url}/${svn.module}"/> |
||
202 | 29319 | cordinyana | </antcall>
|
203 | </target>
|
||
204 | 29239 | cordinyana | |
205 | 29319 | cordinyana | <target name="svn.checkout"> |
206 | <echo>url: ${svn.project.url}</echo> |
||
207 | <java classname="org.tmatesoft.svn.cli.SVN" |
||
208 | 29192 | cordinyana | dir="${svn.project.path}" |
209 | fork="true" |
||
210 | failonerror="true"> |
||
211 | 29319 | cordinyana | <arg value="co" /> |
212 | <arg value="--username"/> |
||
213 | <arg value="${svn.username}"/> |
||
214 | <arg value="--password"/> |
||
215 | <arg value="${svn.password}"/> |
||
216 | <arg value="${svn.project.url}" /> |
||
217 | <classpath>
|
||
218 | <pathelement location="${ant.libs.dir}/svnkit-1.2.3.jar" /> |
||
219 | <pathelement location="${ant.libs.dir}/svnkit-cli-1.2.3.jar" /> |
||
220 | </classpath>
|
||
221 | </java>
|
||
222 | </target>
|
||
223 | 29170 | jjdelcerro | |
224 | 29319 | cordinyana | <target name="svn.update"> |
225 | <java classname="org.tmatesoft.svn.cli.SVN" |
||
226 | 29239 | cordinyana | dir="${svn.project.path}" |
227 | fork="true" |
||
228 | failonerror="true"> |
||
229 | 29319 | cordinyana | <arg value="update" /> |
230 | <arg value="${svn.module}" /> |
||
231 | <classpath>
|
||
232 | <pathelement location="${ant.libs.dir}/svnkit-1.2.3.jar" /> |
||
233 | <pathelement location="${ant.libs.dir}/svnkit-cli-1.2.3.jar" /> |
||
234 | </classpath>
|
||
235 | </java>
|
||
236 | </target>
|
||
237 | 29239 | cordinyana | |
238 | 29319 | cordinyana | <target name="svn.getparams"> |
239 | <input
|
||
240 | 29192 | cordinyana | addproperty="svn.repository.url.option" |
241 | defaultvalue="a"> |
||
242 | 29185 | cordinyana | Select one SVN url to the branch to checkout: |
243 | a) Public (http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep) |
||
244 | b) Development (https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep) |
||
245 | </input>
|
||
246 | 29319 | cordinyana | |
247 | <condition property="svn.repository.url" |
||
248 | 29239 | cordinyana | value="https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep" |
249 | else="http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep"> |
||
250 | 29319 | cordinyana | <equals arg1="${svn.repository.url.option}" arg2="b"/> |
251 | </condition>
|
||
252 | 29185 | cordinyana | |
253 | 29319 | cordinyana | <input
|
254 | 29192 | cordinyana | message="SVN user name:" |
255 | addproperty="svn.username" |
||
256 | defaultvalue="guest" /> |
||
257 | 29319 | cordinyana | |
258 | <input
|
||
259 | 29192 | cordinyana | message="SVN user password:" |
260 | addproperty="svn.password" |
||
261 | 29319 | cordinyana | defaultvalue="guest" /> |
262 | </target>
|
||
263 | |||
264 | 29239 | cordinyana | <target name="svn.get.project.path"> |
265 | <description>
|
||
266 | Converts a project name to a project path in subversion. |
||
267 | Ej: libTools -> libraries/libTools
|
||
268 | </description>
|
||
269 | 29319 | cordinyana | <propertyregex property="svn.module" |
270 | 29239 | cordinyana | input="${svn.module}" |
271 | regexp="^lib.*" |
||
272 | replace="libraries/\0" |
||
273 | casesensitive="false" |
||
274 | override="true"/> |
||
275 | 29319 | cordinyana | <propertyregex property="svn.module" |
276 | 29239 | cordinyana | input="${svn.module}" |
277 | regexp="^ext.*" |
||
278 | replace="extensions/\0" |
||
279 | casesensitive="false" |
||
280 | override="true"/> |
||
281 | 29319 | cordinyana | <propertyregex property="svn.module" |
282 | 29239 | cordinyana | input="${svn.module}" |
283 | regexp="^app.*" |
||
284 | replace="applications/\0" |
||
285 | casesensitive="false" |
||
286 | override="true"/> |
||
287 | 29319 | cordinyana | <propertyregex property="svn.module" |
288 | 29239 | cordinyana | input="${svn.module}" |
289 | regexp="^_fw.*" |
||
290 | replace="frameworks/\0" |
||
291 | casesensitive="false" |
||
292 | override="true"/> |
||
293 | </target>
|
||
294 | |||
295 | 29185 | cordinyana | </project> |