svn-gvsig-desktop / branches / v2_0_0_prep / build / build.xml @ 29191
History | View | Annotate | Download (6.02 KB)
1 |
<project name="gvSIG build" basedir="../.." default="mvn-configure-eclipse-workspace" xmlns:artifact="antlib:org.apache.maven.artifact.ant"> |
---|---|
2 |
|
3 |
<description>
|
4 |
Ant tasks and macros to interact with maven |
5 |
</description>
|
6 |
|
7 |
<!-- set global properties for this build -->
|
8 |
<dirname file="${ant.file.Complete_build_system}" property="ant.file.Complete_build_system.dir" /> |
9 |
<dirname file="${ant.file.Complete_build_system.dir}" property="workspace_loc" /> |
10 |
|
11 |
<property name="mavendir" location="${ant.file.Complete_build_system.dir}/maven" /> |
12 |
<!--property environment="environment"/-->
|
13 |
<property name="ant.libs.dir" location="../../ant-tasks" /> |
14 |
|
15 |
<!-- ============================= -->
|
16 |
<!-- External ant tasks definition -->
|
17 |
<!-- ============================= -->
|
18 |
|
19 |
<!-- Maven ant tasks registration -->
|
20 |
<path id="maven-ant-tasks.classpath" path="${ant.libs.dir}/maven-ant-tasks-2.0.10.jar" /> |
21 |
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> |
22 |
|
23 |
<!-- ant-contrib library load -->
|
24 |
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
25 |
<classpath>
|
26 |
<pathelement location="${ant.libs.dir}/ant-contrib-1.0b3.jar" /> |
27 |
<pathelement location="${ant.libs.dir}/bcel-5.1.jar" /> |
28 |
<pathelement location="${ant.libs.dir}/commons-httpclient-3.0.1.jar" /> |
29 |
<pathelement location="${ant.libs.dir}/commons-logging-1.0.4.jar" /> |
30 |
<pathelement location="${ant.libs.dir}/ivy-1.3.1.jar" /> |
31 |
</classpath>
|
32 |
</taskdef>
|
33 |
|
34 |
<!-- Maven targets -->
|
35 |
<macrodef name="maven"> |
36 |
<attribute name="arg" /> |
37 |
<sequential>
|
38 |
<echo>mvn @{arg}</echo> |
39 |
<artifact:mvn mavenHome="../../maven" fork="true" failonerror="true"> |
40 |
<arg line="@{arg}" /> |
41 |
</artifact:mvn>
|
42 |
</sequential>
|
43 |
</macrodef>
|
44 |
|
45 |
<target name="mvn-clean" description="Cleans all artifacts"> |
46 |
<maven arg="clean" /> |
47 |
</target>
|
48 |
|
49 |
<target name="mvn-install" description="Compiles and installs"> |
50 |
<maven arg="install" /> |
51 |
</target>
|
52 |
|
53 |
<target name="mvn-install-without-tests" description="Compiles and installs without launching tests"> |
54 |
<maven arg="-Dmaven.test.skip=true install" /> |
55 |
</target>
|
56 |
|
57 |
<target name="mvn-reinstall" depends="mvn-clean,mvn-install" description="Performs a clean install" /> |
58 |
|
59 |
<target name="mvn-reinstall-without-tests" depends="mvn-clean,mvn-install-without-tests" description="Performs a clean install without launching tests" /> |
60 |
|
61 |
<target name="mvn-deploy" description="Compiles, installs and deploys"> |
62 |
<maven arg="deploy" /> |
63 |
</target>
|
64 |
|
65 |
<target name="mvn-configure-eclipse-workspace" description="Configures the eclipse workspace for maven integration"> |
66 |
<maven arg="-Declipse.workspace='${workspace_loc}' eclipse:add-maven-repo" /> |
67 |
</target>
|
68 |
|
69 |
<target name="mvn-eclipse-clean" description="Cleans the maven generated eclipse project files"> |
70 |
<maven arg="eclipse:clean" /> |
71 |
</target>
|
72 |
|
73 |
<target name="mvn-eclipse-eclipse" description="Generates an eclipse project configuration from the pom.xml"> |
74 |
<maven arg="eclipse:eclipse" /> |
75 |
</target>
|
76 |
|
77 |
<!-- Projects checkout targets -->
|
78 |
<target name="svn.checkout.all" depends="svn.getparams,svn.checkout" description="Checkouts all projects defined in a parent module pom.xml" /> |
79 |
|
80 |
<target name="svn.checkout"> |
81 |
<artifact:pom id="pom" file="pom.xml" /> |
82 |
<for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true"> |
83 |
<sequential>
|
84 |
<var name="svn.isgroup" unset="true" /> |
85 |
<propertyregex property="svn.module" input="@{svn.module}" regexp="[./]*(.*)" replace="\1" casesensitive="false" override="true" /> |
86 |
<available file="../${svn.module}" property="svn.isgroup" /> |
87 |
<antcall target="svn.getgroup"> |
88 |
<param name="svn.module" value="${svn.module}" /> |
89 |
</antcall>
|
90 |
<antcall target="svn.getproject"> |
91 |
<param name="svn.module" value="${svn.module}" /> |
92 |
</antcall>
|
93 |
</sequential>
|
94 |
</for>
|
95 |
</target>
|
96 |
|
97 |
<target name="svn.getgroup" if="svn.isgroup"> |
98 |
<echo>group: ${svn.module}</echo> |
99 |
<ant dir="../${svn.module}" target="svn.checkout" /> |
100 |
</target>
|
101 |
|
102 |
<target name="svn.getproject" unless="svn.isgroup"> |
103 |
<propertyregex property="svn.module" input="${svn.module}" regexp="^lib.*" replace="libraries/\0" casesensitive="false" override="true" /> |
104 |
<propertyregex property="svn.module" input="${svn.module}" regexp="^ext.*" replace="extensions/\0" casesensitive="false" override="true" /> |
105 |
<propertyregex property="svn.module" input="${svn.module}" regexp="^app.*" replace="applications/\0" casesensitive="false" override="true" /> |
106 |
<propertyregex property="svn.module" input="${svn.module}" regexp="^_fw.*" replace="frameworks/\0" casesensitive="false" override="true" /> |
107 |
<echo>project: ${svn.module}</echo> |
108 |
<antcall target="svn.checkout.project"> |
109 |
<param name="svn.project.path" value="../../.." /> |
110 |
<param name="svn.project.url" value="${svn.repository.url}/${svn.module}" /> |
111 |
</antcall>
|
112 |
</target>
|
113 |
|
114 |
<target name="svn.checkout.project"> |
115 |
<echo>url: ${svn.project.url}</echo> |
116 |
<java classname="org.tmatesoft.svn.cli.SVN" dir="${svn.project.path}" fork="true" failonerror="true"> |
117 |
<arg value="co" /> |
118 |
<arg value="--username" /> |
119 |
<arg value="${svn.username}" /> |
120 |
<arg value="--password" /> |
121 |
<arg value="${svn.password}" /> |
122 |
<arg value="${svn.project.url}" /> |
123 |
<classpath>
|
124 |
<pathelement location="${ant.libs.dir}/svnkit-1.2.3.jar" /> |
125 |
<pathelement location="${ant.libs.dir}/svnkit-cli-1.2.3.jar" /> |
126 |
</classpath>
|
127 |
</java>
|
128 |
</target>
|
129 |
|
130 |
<target name="svn.getparams"> |
131 |
<input addproperty="svn.repository.url.option" defaultvalue="a"> |
132 |
Select one SVN url to the branch to checkout: |
133 |
a) Public (http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep) |
134 |
b) Development (https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep) |
135 |
</input>
|
136 |
|
137 |
<condition property="svn.repository.url" value="http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep" else="https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep"> |
138 |
<equals arg1="${svn.repository.url.option}" arg2="a" /> |
139 |
</condition>
|
140 |
|
141 |
<input message="SVN user name:" addproperty="svn.username" defaultvalue="guest" /> |
142 |
|
143 |
<input message="SVN user password:" addproperty="svn.password" defaultvalue="guest" /> |
144 |
</target>
|
145 |
</project>
|