Statistics
| Revision:

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

History | View | Annotate | Download (6.58 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" 
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="co" />
109
                        <arg value="--username" />
110
                        <arg value="${svn.username}" />
111
                        <arg value="--password" />
112
                        <arg value="${svn.password}" />
113
                        <arg value="${svn.project.url}" />
114
                        <classpath>
115
                                <pathelement location="${ant.libs.dir}/svnkit-${svnkit.version}.jar" />
116
                                <pathelement location="${ant.libs.dir}/svnkit-cli-${svnkit.version}.jar" />
117
                        </classpath>
118
                </java>
119
        </target>
120

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

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

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

    
169
                        <selectionProperty label="SVNKit version to use: "
170
                                property="svnkit.version"
171
                                values="1.2.3;1.1.7;1.3.0"
172
                                separator=";" />
173

    
174
                        <label>
175
Note:
176
  Once the process has finished, import the projects into your eclipse workspace.
177
                        </label>
178
                </antform>
179
        </target>
180

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