Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / build / ant-tasks / subversion-tasks.xml @ 32650

History | View | Annotate | Download (6.76 KB)

1
<project name="gvSIG-subversion-tasks" default="svn.checkout.all"
2
        xmlns:artifact="antlib:org.apache.maven.artifact.ant">
3

    
4
        <dirname property="gvSIG-subversion-tasks.basedir" file="${ant.file.gvSIG-subversion-tasks}" />
5
        <import file="${gvSIG-subversion-tasks.basedir}/ant-tasks-config.xml" />
6

    
7
        <description>
8
                Ant tasks and macros to interact with subversion
9
        </description>
10

    
11
        <!-- Subversion targets -->
12
        <target name="svn.checkout.all" 
13
                depends="svn.checkout.allprojects,eclipse.projects"
14
                description="Checkouts all projects defined in a parent module pom.xml">
15
                <echo>
16
Note:
17
  Once the process has finished, import the projects into your
18
  eclipse workspace.</echo>
19
        </target>
20
                
21
        <target name="svn.checkout.allprojects" depends="svn.getparams">
22

    
23
                <artifact:pom id="pom" file="pom.xml" />
24
                <for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true">
25
                        <sequential>
26
                                <var name="svn.isgroup" unset="true" />
27
                                <propertyregex property="svn.module" input="@{svn.module}"
28
                                        regexp="[./]*(.*)" replace="\1" casesensitive="false" 
29
                                        override="true" />
30
                                <available file="${build.folder}/projects/${svn.module}" 
31
                                        property="svn.isgroup" />
32
                                <antcall target="svn.checkout.group">
33
                                        <param name="svn.module" value="${svn.module}" />
34
                                </antcall>
35
                                <antcall target="svn.checkout.project">
36
                                        <param name="svn.module" value="${svn.module}" />
37
                                </antcall>
38
                        </sequential>
39
                </for>
40
        </target>
41
        
42
        <target name="eclipse.projects" if="create.eclipse.projects">
43
                <!-- Create the eclipse project configuration for all downloaded projects -->
44
                <if>
45
                        <equals arg1="${create.eclipse.projects}" arg2="true" />
46
                        <then>
47
                                <maven arg="-Dmaven.test.failure.ignore install" />
48
                                <maven arg="-P eclipse-project" />
49
                        </then>
50
                </if>
51
        </target>
52

    
53
        <target name="svn.update.all" depends="svn.getparams"
54
                description="Updates all projects defined in a parent module pom.xml">
55
                <artifact:pom id="pom" file="pom.xml" />
56
                <for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true">
57
                        <sequential>
58
                                <var name="svn.isgroup" unset="true" />
59
                                <propertyregex property="svn.module" input="@{svn.module}"
60
                                        regexp="[./]*(.*)" replace="\1" casesensitive="false" 
61
                                        override="true" />
62
                                <available file="${build.folder}/projects/${svn.module}" 
63
                                        property="svn.isgroup" />
64
                                <antcall target="svn.update.group">
65
                                        <param name="svn.module" value="${svn.module}" />
66
                                </antcall>
67
                                <antcall target="svn.update.project">
68
                                        <param name="svn.module" value="${svn.module}" />
69
                                </antcall>
70
                        </sequential>
71
                </for>
72
        </target>
73

    
74
        <target name="svn.checkout.group" if="svn.isgroup">
75
                <echo>group: ${svn.module}</echo>
76
                <ant dir="${build.folder}/projects/${svn.module}" 
77
                        target="svn.checkout.allprojects" />
78
        </target>
79

    
80
        <target name="svn.checkout.project" unless="svn.isgroup" 
81
                depends="svn.get.project.path">
82
                <echo>project: ${svn.module}</echo>
83
                <antcall target="svn.checkout">
84
                        <param name="svn.project.path" value="${workspace_loc}" />
85
                        <param name="svn.project.url" value="${svn.module.url}" />
86
                </antcall>
87
        </target>
88

    
89
        <target name="svn.update.group" if="svn.isgroup">
90
                <echo>group: ${svn.module}</echo>
91
                <ant dir="${build.folder}/projects/${svn.module}" target="svn.update.all" />
92
        </target>
93

    
94
        <target name="svn.update.project" unless="svn.isgroup" 
95
                depends="svn.get.project.path">
96
                <echo>project: ${svn.module}</echo>
97
                <antcall target="svn.update">
98
                        <param name="svn.project.path" value="${workspace_loc}" />
99
                        <param name="svn.project.url" value="${svn.module.url}" />
100
                </antcall>
101
        </target>
102

    
103
        <target name="svn.checkout">
104
                <echo>url: ${svn.project.url}</echo>
105
                <echo>SVNKit version: ${svnkit.version}</echo>
106
                <java classname="org.tmatesoft.svn.cli.SVN" dir="${svn.project.path}"
107
                        fork="true" failonerror="true">
108
                        <arg value="--non-interactive"/>
109
                        <arg value="co" />
110
                        <arg value="--username" />
111
                        <arg value="${svn.username}" />
112
                        <arg value="--password" />
113
                        <arg value="${svn.password}" />
114
                        <arg value="${svn.project.url}" />
115
                        <classpath>
116
                                <pathelement location="${ant.libs.dir}/svnkit-${svnkit.version}.jar" />
117
                                <pathelement location="${ant.libs.dir}/svnkit-cli-${svnkit.version}.jar" />
118
                        </classpath>
119
                </java>
120
        </target>
121

    
122
        <target name="svn.update">
123
                <echo>url: ${svn.project.url}</echo>
124
                <echo>SVNKit version: ${svnkit.version}</echo>
125
                <java classname="org.tmatesoft.svn.cli.SVN" dir="${svn.project.path}"
126
                        fork="true" failonerror="true">
127
                        <arg value="--non-interactive"/>
128
                        <arg value="update" />
129
                        <arg value="${svn.module}" />
130
                        <classpath>
131
                                <pathelement location="${ant.libs.dir}/svnkit-${svnkit.version}.jar" />
132
                                <pathelement location="${ant.libs.dir}/svnkit-cli-${svnkit.version}.jar" />
133
                        </classpath>
134
                </java>
135
        </target>
136

    
137
        <!-- 
138
                Get subversion parameters using the AntForms utility:
139
                http://antforms.sourceforge.net/
140
        -->
141
        <target name="svn.getparams" unless="svn.repository.url">
142
                <!-- Default values -->
143
                <property name="create.eclipse.projects" value="true"/>
144
                <property name="svn.repository.url" value="https://svn.forge.osor.eu/svn/gvsig-desktop/branches/v2_0_0_prep"/>
145
                <!--
146
                        <property name="svn.username" value="guest"/> <property name="svn.password"
147
                        value="guest"/>
148
                -->
149
                <antform title="SVN parameters" image="${gvsiglogo}" resetMessage="Cancel"
150
                        previousTarget="cancel">
151
        
152
                        <textProperty label="gvSIG 2.0 subversion repository: " property="svn.repository.url"
153
                                password="false" editable="false" columns="38"/>
154

    
155
                        <label>
156
Note:
157
  Select the SVNKit version which relates to the SVN version of the other SVN 
158
  clients you are using, like the SVN command line client or Eclipse. In the
159
  case of Eclipse, you have to install a version of the Subclipse plugin which 
160
  provides the same SVNKit version as the one selected, or to install the 
161
  Subversive plugin and configure it to use the selected SVNKit version in the
162
  plugin preferences.
163
                                
164
  The relationship with the subversion version is :
165
          SVNKit 1.1.7 -> Subversion 1.4 -> ¿? 
166
          SVNKit 1.2.3 -> Subversion 1.5 -> Subclipse 1.4.*
167
          SVNKit 1.3.0 -> Subversion 1.6 -> Subclipse 1.6.*
168
                                
169
  In the case of Subversive, you can select the SVNKit version in the eclipse preferences:
170
        Team > SVN > SVN Connector
171
                        </label>
172

    
173
                        <selectionProperty label="SVNKit version to use: "
174
                                property="svnkit.version"
175
                                values="1.2.3;1.1.7;1.3.0"
176
                                separator=";" />
177

    
178
                        <label>
179
Note:
180
  Once the process has finished, import the projects into your eclipse workspace.
181
                        </label>
182
                </antform>
183
        </target>
184

    
185
        <target name="svn.get.project.path">
186
                <description>
187
                        Converts a project name to a project path in subversion.
188
                        Ej: libTools -> libraries/libTools
189
                </description>
190
                <property file="${gvSIG-subversion-tasks.basedir}/projects-svn-repository.properties"/>
191
                <propertycopy property="svn.module.url" from="${svn.module}" 
192
                                          override="true" silent="true"/>
193
        </target>
194
</project>