cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

CLI commands automatically called from inside build.xml file?

Highlighted
Level 1

CLI commands automatically called from inside build.xml file?

Can I call the MKS CLI commands automatically by putting them in my build.xml file? I am trying to automate aspects of the build process using the mkstask.jar and mksapi.jar files and would like to be able to configure my build.xml file so that it will automatically connect to the integrity server and make those commands. Is this possible? Upon looking at the CLI reference guide, it seems like they must directly be typed into the command line terminal since the commands are always listed like so:

im connect [--hostname=value] [--port=value] [--password=value] [--user=value] [(-?|--usage)] [(-F file|--selectionFile=file)] [(-N|--no)] [(-Y|--yes)] [--[no]batch] [--cwd=directory] [--forceConfirm=[yes|no]] [(-g|--gui)] [--quiet] [--settingsUI=[gui|default]] [--status=[none|gui|default]]

however, upon viewing some documentation on the ant task, it seems as though these commands could be put in the build.xml file and automatically invoked like in this example:

The MKS Source command "si co --lock --cpid=1:1 file1.txt file2.txt" can be run as:

Using the general <command> tag:

<mks>

     <command  application="si" command="co" >

          <options>

               <option name="lock"/>

               <option name="cpid">1:1</option>

          </options>

          <selections>

               <selection>file1.txt</selection>

               <selection>file2.txt</selection>

          <selections>

     </command>

</mks>

For example, I'm thinking to use the connect cli command, I would list the user, port, hostname, and port as options and enter in their values in the xml file like so:

<taskdef name="mks" classpath="${mkstask.jar};${mksapi.jar}" classname="mks.integrations.apache.ant.MKSTask" />

<mks>

     <command application="im" command="connect">

          <options>

                 <option name="hostname">myserver</option>

                 <option name="port">val</option>

                 <option name="user">myuser</option>

                 <option name="password">mypass</option>

          </options>

     </command>

</mks>

I'm new to ant, software builds, and xml so I apologize if this is a silly question. Thanks in advance.

1 REPLY 1

Re: CLI commands automatically called from inside build.xml file?

Oh, also this anwer from me was not migrated ;(

Here again:

I like your approach a lot, a former colleague from me developed a migration utility and he was using exactly this approach.

So, yes, please go a head. Interested to see, hear or read how it goes.

Volker