Revision 29191

View differences:

branches/v2_0_0_prep/build/build.xml
1
<project name="gvSIG build" basedir="../.." 
2
		 default="mvn-configure-eclipse-workspace" 
3
		 xmlns:artifact="antlib:org.apache.maven.artifact.ant">
4
	
1
<project name="gvSIG build" basedir="../.." default="mvn-configure-eclipse-workspace" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
2

  
5 3
	<description>
6 4
		Ant tasks and macros to interact with maven
7 5
	</description>
8
	
6

  
9 7
	<!-- set global properties for this build -->
10
	<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
	
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

  
13 11
	<property name="mavendir" location="${ant.file.Complete_build_system.dir}/maven" />
14 12
	<!--property environment="environment"/-->
15
	<property name="ant.libs.dir" location="../../ant-tasks"/>
13
	<property name="ant.libs.dir" location="../../ant-tasks" />
16 14

  
17 15
	<!-- ============================= -->
18 16
	<!-- External ant tasks definition -->
19 17
	<!-- ============================= -->
20
		
21
	<!-- Maven ant tasks registration -->	
18

  
19
	<!-- Maven ant tasks registration -->
22 20
	<path id="maven-ant-tasks.classpath" path="${ant.libs.dir}/maven-ant-tasks-2.0.10.jar" />
23
	<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
24
           uri="antlib:org.apache.maven.artifact.ant"
25
           classpathref="maven-ant-tasks.classpath" />
21
	<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
26 22

  
27 23
	<!-- ant-contrib library load -->
28 24
	<taskdef resource="net/sf/antcontrib/antlib.xml">
29
			<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>
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>
36 32
	</taskdef>
37 33

  
38 34
	<!-- Maven targets -->
39 35
	<macrodef name="maven">
40
	   <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
	<target name="mvn-clean" 
50
			description="Cleans all artifacts">
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">
51 46
		<maven arg="clean" />
52 47
	</target>
53 48

  
54
	<target name="mvn-install" 
55
			description="Compiles and installs">
49
	<target name="mvn-install" description="Compiles and installs">
56 50
		<maven arg="install" />
57 51
	</target>
58
	
59
	<target name="mvn-install-without-tests" 
60
		 	description="Compiles and installs without launching tests">
52

  
53
	<target name="mvn-install-without-tests" description="Compiles and installs without launching tests">
61 54
		<maven arg="-Dmaven.test.skip=true install" />
62 55
	</target>
63 56

  
64
	<target name="mvn-reinstall" depends="mvn-clean,mvn-install" 
65
		    description="Performs a clean install"/>
57
	<target name="mvn-reinstall" depends="mvn-clean,mvn-install" description="Performs a clean install" />
66 58

  
67
	<target name="mvn-reinstall-without-tests" 
68
			depends="mvn-clean,mvn-install-without-tests" 
69
			description="Performs a clean install without launching tests"/>
59
	<target name="mvn-reinstall-without-tests" depends="mvn-clean,mvn-install-without-tests" description="Performs a clean install without launching tests" />
70 60

  
71
	<target name="mvn-deploy" 
72
			description="Compiles, installs and deploys">
61
	<target name="mvn-deploy" description="Compiles, installs and deploys">
73 62
		<maven arg="deploy" />
74 63
	</target>
75
	
76
	<target name="mvn-configure-eclipse-workspace"
77
			description="Configures the eclipse workspace for maven integration">
64

  
65
	<target name="mvn-configure-eclipse-workspace" description="Configures the eclipse workspace for maven integration">
78 66
		<maven arg="-Declipse.workspace='${workspace_loc}' eclipse:add-maven-repo" />
79 67
	</target>
80 68

  
81
	<target name="mvn-eclipse-clean"
82
			description="Cleans the maven generated eclipse project files">
69
	<target name="mvn-eclipse-clean" description="Cleans the maven generated eclipse project files">
83 70
		<maven arg="eclipse:clean" />
84 71
	</target>
85 72

  
86
	<target name="mvn-eclipse-eclipse"
87
			description="Generates an eclipse project configuration from the pom.xml">
73
	<target name="mvn-eclipse-eclipse" description="Generates an eclipse project configuration from the pom.xml">
88 74
		<maven arg="eclipse:eclipse" />
89 75
	</target>
90 76

  
91 77
	<!-- Projects checkout targets -->
92
	<target name="svn.checkout.all" depends="svn.getparams,svn.checkout" 
93
			description="Checkouts all projects defined in a parent module pom.xml"/>
94
	
78
	<target name="svn.checkout.all" depends="svn.getparams,svn.checkout" description="Checkouts all projects defined in a parent module pom.xml" />
79

  
95 80
	<target name="svn.checkout">
96 81
		<artifact:pom id="pom" file="pom.xml" />
97 82
		<for list="${pom.modules}" param="svn.module" delimiter=",[]" trim="true">
98 83
			<sequential>
99
				<var name="svn.isgroup" unset="true"/>
100
			    <propertyregex property="svn.module"
101
			              input="@{svn.module}"
102
			              regexp="[./]*(.*)"
103
			              replace="\1"
104
			              casesensitive="false" 
105
			    		  override="true"/>
106
				<available file="../${svn.module}" property="svn.isgroup"/>
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" />
107 87
				<antcall target="svn.getgroup">
108
					<param name="svn.module" value="${svn.module}"/>
88
					<param name="svn.module" value="${svn.module}" />
109 89
				</antcall>
110 90
				<antcall target="svn.getproject">
111
					<param name="svn.module" value="${svn.module}"/>
91
					<param name="svn.module" value="${svn.module}" />
112 92
				</antcall>
113 93
			</sequential>
114 94
		</for>
......
116 96

  
117 97
	<target name="svn.getgroup" if="svn.isgroup">
118 98
		<echo>group: ${svn.module}</echo>
119
		<ant dir="../${svn.module}" target="svn.checkout"/>
99
		<ant dir="../${svn.module}" target="svn.checkout" />
120 100
	</target>
121 101

  
122 102
	<target name="svn.getproject" unless="svn.isgroup">
123
	    <propertyregex property="svn.module"
124
	              input="${svn.module}"
125
	              regexp="^lib.*"
126
	              replace="libraries/\0"
127
	              casesensitive="false" 
128
	    		  override="true"/>
129
	    <propertyregex property="svn.module"
130
	              input="${svn.module}"
131
	              regexp="^ext.*"
132
	              replace="extensions/\0"
133
	              casesensitive="false" 
134
	    		  override="true"/>
135
	    <propertyregex property="svn.module"
136
	              input="${svn.module}"
137
	              regexp="^app.*"
138
	              replace="applications/\0"
139
	              casesensitive="false" 
140
	    		  override="true"/>
141
	    <propertyregex property="svn.module"
142
	              input="${svn.module}"
143
	              regexp="^_fw.*"
144
	              replace="frameworks/\0"
145
	              casesensitive="false" 
146
	    		  override="true"/>
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" />
147 107
		<echo>project: ${svn.module}</echo>
148 108
		<antcall target="svn.checkout.project">
149
			<param name="svn.project.path" value="../../.."/>
150
			<param name="svn.project.url" value="${svn.repository.url}/${svn.module}"/>
151
	    </antcall>
109
			<param name="svn.project.path" value="../../.." />
110
			<param name="svn.project.url" value="${svn.repository.url}/${svn.module}" />
111
		</antcall>
152 112
	</target>
153 113

  
154
  <target name="svn.checkout.project">
155
  	<echo>url: ${svn.project.url}</echo>
156
    <java classname="org.tmatesoft.svn.cli.SVN" 
157
          dir="${svn.project.path}" 
158
          fork="true" 
159
          failonerror="true">
160
      <arg value="co" />
161
      <arg value="--username"/>
162
      <arg value="${svn.username}"/>
163
	  <arg value="--password"/>
164
      <arg value="${svn.password}"/>
165
      <arg value="${svn.project.url}" />
166
        <classpath>
167
          <pathelement location="${ant.libs.dir}/svnkit-1.2.3.jar" />
168
          <pathelement location="${ant.libs.dir}/svnkit-cli-1.2.3.jar" />
169
        </classpath>
170
    </java>
171
  </target>
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>
172 129

  
173
  <target name="svn.getparams">
174
	  <input
175
	    addproperty="svn.repository.url.option"
176
	  	defaultvalue="a">
130
	<target name="svn.getparams">
131
		<input addproperty="svn.repository.url.option" defaultvalue="a">
177 132
	  	Select one SVN url to the branch to checkout:
178 133
	  	a) Public (http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep)
179 134
	  	b) Development (https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep)
180 135
  	  </input>
181
  	
182
  	  <condition property="svn.repository.url" 
183
  	  			 value="http://subversion.gvsig.org/gvSIG/branches/v2_0_0_prep"
184
  	  			 else="https://gvsig.org/svn/gvSIG/branches/v2_0_0_prep">
185
  	  	<equals arg1="${svn.repository.url.option}" arg2="a"/>
186
  	  </condition>
187 136

  
188
  	  <input
189
	    message="SVN user name:"
190
	    addproperty="svn.username"
191
  	    defaultvalue="guest" />
192
  	
193
	  <input
194
	    message="SVN user password:"
195
	    addproperty="svn.password"
196
	  	defaultvalue="guest" />	  
197
   </target>
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>
198 145
</project>

Also available in: Unified diff