Let's say I have checkedout a folder inside the folder BuildI12
and I want to update it using the ant, how can I do that.?
I don't how to create customized tasks in ant.
Asked
Active
Viewed 251 times
0

viveksinghggits
- 661
- 14
- 35
-
Can you explain better what you mean to "update the folder"? Do you mean run a svn update? – ivoruJavaBoy Jun 01 '16 at 13:26
-
yes , I have checked out the folder and then want to update it. – viveksinghggits Jun 01 '16 at 19:07
-
My solution uses svnkit as a subversion client: http://stackoverflow.com/questions/16305315/the-svn-client-svnkit-is-not-available/16310312#16310312 – Mark O'Connor Jun 01 '16 at 22:00
1 Answers
0
If i Understand your needs and you mean run a SVN UPDATE from a custom ant task, you can do something like this:
<target name="svn_command" description = "run svn update command">
<if> <os family="windows"/>
<then>
<exec dir="." executable="cmd.exe" outputproperty="svnlog.out" failonerror="true" >
<arg line="/c svn update"/>
</exec>
</then>
<else>
<exec executable="svn" outputproperty="svnlog.out">
<arg line=" update"/>
</exec>
</else>
</if>
</target>
Obviously you can do more trick, using placeholder and creating dynamic task that could work for different SVN operations..
Let me know if this fits your needs..

ivoruJavaBoy
- 1,307
- 2
- 19
- 39
-
Just a note: Using `
` would require the third-party Ant-Contrib library. To avoid Ant-Contrib, the ` – Chad Nouis Jun 01 '16 at 14:34` task has an `osfamily` attribute that assures that ` ` only runs on certain operating systems. -
I don't understand how would it work.? I mean what is the purpose of cmd.exe, will I have to write it.? – viveksinghggits Jun 01 '16 at 19:09
-
This custom target works for both windows and unix... it says, if the system is a windows system use cmd.exe to call the svn process and run the update command, fail if something goes wrong and log into svnlog.out the output, if is not a windows system, just call the executable process svn with param update, what you mean with i have to write it? Is your system unix or windows based? – ivoruJavaBoy Jun 02 '16 at 08:35