Revision 118

View differences:

org.gvsig.maven.base/trunk/org.gvsig.maven.base/org.gvsig.maven.base.build/src/main/resources/org.gvsig.maven.base.build/check-gvsig-profile.xml
68 68
			<textProperty label="Your current gvSIG location is on : " editable="false" property="current-gvsig-location" />
69 69
			<label>	Would you like to change it?</label>
70 70
			<controlbar>
71
				<button type="cancel" label="No" target="operation-cancelled" />
71
				<button type="cancel" label="No" />
72 72
				<button type="ok" label="Yes" target="select-location" />
73 73
			</controlbar>
74 74
		</antform>
......
189 189
	</antform>
190 190
</target>
191 191

  
192
<target name="prueba_find">
193
	<property name="settings_file" value="/home/jobacas/Escritorio/text_example3c.xml" />
194
	<property name="new-gvsig-location" value="/home/jobacas/Escritorio/" />
195

  
196
	<loadfile property="settings_file_content" srcFile="${settings_file}" />
197

  
198
	<condition property="has_profiles">
199
		<matches pattern="profiles" string="${settings_file_content}" />
200
	</condition>
201

  
202
	<condition property="has_gvsig_configuration">
203
		<matches pattern="gvsig-install" string="${settings_file_content}" />
204
	</condition>
205

  
206
	<if>
207
		<isset property="has_profiles" />
208
		<then>
209
			<if>
210
				<isset property="has_gvsig_configuration" />
211
				<then>
212
					<echo>Nothing to do</echo>
213
				</then>
214
				<else>
215
					<echo>There isn't a gvSIG profile</echo>
216
				</else>
217
			</if>
218
		</then>
219
		<else>
220
			<echo>There isn't a profile set on your 'setting.xml'</echo>
221
			<propertyregex property="current-gvsig-location" 
222
					input="settings_file_content" 
223
					regexp="\074set([^s]*)s" 
224
					select="\1" 
225
				/>
226
			<echo>"Hola ${current-gvsig-location}"</echo>
227
			<echo>"Hola ${settings_file}"</echo>
228

  
229
			<xmltask source="${settings_file}" dest="${settings_file}">
230
				<replace path="//:settings/:servers/:server/:id/text()">
231
					<![CDATA[gvsig]]>
232
				</replace>
233
				<insert path="//:settings/:fermin/:gustavo" xml="&lt;other/&gt;"/>
234
				<insert path="//:settings/:servers" position="after">
235
					<![CDATA[
236
				        <servlet>
237
					<servlet-name>
238
				            ${settings_file}
239
				          </servlet-name>
240
				</servlet>
241
				      ]]>
242
				    </insert>
243

  
244
			<copy path="//:settings/:servers/:server/:password/text()" property="title"/>
245
		</xmltask>
246

  
247
		<echo>"Hola ${title}"</echo>
248
	</else>
249
</if>
250

  
251
</target>
252

  
253
	
254
	<target name="prueba_delete_attribute">
255
		<property name="settings_file" value="/home/jobacas/.m2/settings-copia.xml" />
256
		
257
		<xmltask source="${settings_file}" dest="${settings_file}">
258
		<attr path="//:settings/:profiles/:profile/:properties/:gvsig.install.dir" attr="xmlns" remove="true"/>
259
		</xmltask>
260
	</target>
261

  
262 192
</project>

Also available in: Unified diff