0

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.

viveksinghggits
  • 661
  • 14
  • 35

1 Answers1

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 `` task has an `osfamily` attribute that assures that `` only runs on certain operating systems. – Chad Nouis Jun 01 '16 at 14:34
  • 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