Apache Ant "SI command" for MKStask - apache

Upon trying to use the MKS task for apache ant, I need to specify the application executing the command. In the documentation I found, it says for example "si" or "im". I'm a little confused at this considered ant is used from command prompt so I'm not sure which application would be doing said command, nor do I know what applications "si" or "im" might be. I am using this task to try and send and receive build info to Integrity if that is pertinent. I was able to find this CLI reference guide for Integrity (link at bottom) which only uses im as a prefix, so I'm thinking that's the one I want to use, but I would appreciate an explanation as to what application im indicates (possible Integrity -something) and what one would specify with "si". Thanks
https://bugs.eclipse.org/bugs/attachment.cgi?id=52225

The si commands are used for Source Integrity tasks (the SCCM side of things), while the im commands are used for Integrity Manager commands (the workflow and document management side of things).
The Integrity client should have man page support on all platforms, so you should be able to run man im or man si to see a breakdown of all the supported commands.
In addition, with newer releases of the client, pressing F1 should get you a help interface, which includes documentation on CLI commands.
The guide to the link you posted is a very old version of the product CLI reference, and only for the im commands.
Since you're talking about using Ant, I'm assuming you're trying to perform builds, which will mostly involve si commands (creating sandboxes, checking out members, etc.).

Here are a couple examples of using si in ant:
<target name="check.mks.conn">
<echo message="Checking if an MKS connection exists. If not, one will be created." />
<exec executable="si" failonerror="true">
<arg line="connect" />
<arg line="--hostname=${mks.server}" />
<arg line="--port=${mks.port}" />
<arg line="--user=${mks.user}" />
<arg line="--gui" />
</exec>
</target>
<!-- =================================================================== -->
<!-- If the sandbox already exists, resync the files -->
<!-- Manually drop any empty folders as resync does not do this. -->
<!-- =================================================================== -->
<target name="resync.sandbox" unless="clean.build">
<exec executable="si" failonerror="true">
<arg line="resync" />
<arg line="--hostname=${mks.server}" />
<arg line="--port=${mks.port}" />
<arg line="-R" />
<arg line="-f" />
<arg line="-Y" />
<arg line="-S ${basedir}\${prj.name}\project.pj" />
</exec>
<delete includeemptydirs="true">
<fileset dir="${prj.name}" excludes="**\*.*" />
</delete>
</target>
<!-- =================================================================== -->
<!-- Drop and recreate the sandbox. -->
<!-- =================================================================== -->
<target name="create.sandbox" if="clean.build" >
<exec executable="si">
<arg line="dropsandbox" />
<arg line="--hostname=${mks.server}" />
<arg line="--port=${mks.port}" />
<arg line="--noconfirm" />
<arg line="--batch" />
<arg line='--delete=none' />
<arg line="-Y" />
<arg line="${basedir}\${prj.name}\project.pj" />
</exec>
<delete dir="${prj.name}" />
<exec executable="si" resultproperty="createSBResult">
<arg line="createsandbox" />
<arg line="--hostname=${mks.server}" />
<arg line="--port=${mks.port}" />
<arg line="--project=c:/Projects/StoreWeb2/${prj.name}/project.pj" />
<arg line="--projectRevision=${checkpoint.version}" />
<arg line="--populate" />
<arg line="--recurse" />
<arg line="-Y" />
<arg line="${basedir}\${prj.name}" />
</exec>
<!-- Check if the project is empty but for the mks system file project.pj -->
<pathconvert property="is.project.not.empty" setonempty="false">
<fileset dir="${prj.name}">
<exclude name="project.pj"/>
</fileset>
</pathconvert>
<condition property="try.mainline.storeweb">
<not>
<and>
<equals arg1="0" arg2="${createSBResult}"/>
<isset property="is.project.not.empty" />
</and>
</not>
</condition>
<antcall target="create.sandbox.mainline">
<param name="prj.name" value="${prj.name}"/>
</antcall>
</target>

Related

1st kinect for laserscan&2nd kinect for skeleton tracking on one PC-possible?

My aim is to use 2 kinects on one PC, one used to get laserscan for SLAM and another used for skeleton tracking.
Right now, I can use 2 kinects on one PC to get color image from one kinect and realize skeleton tracking on the other kinect.
But if I get laserscan from 1st kinect and simultaneously realize skeleton tracking on the other, the skeleton tracking works well while I can't get laserscan data in rviz.
The fact that I failed to get laserscan makes me suspect that whether it is possible that 1st kinect for laserscan&2nd kinect for skeleton tracking on one PC. Or whether my approach is wrong.The following is my approach:
roslaunch openni_launch test.launch(run 2 kinects in test.launch)
rosrun openni_tracker openni_tracker
rosrun rviz rviz(to see the skeleton tracking)
rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/kinect1/depth/image_raw
rosrun rviz rviz(to see the laserscan data)
and test.launch:
<launch>
<!-- Parameters possible to change-->
<arg name="camera1_id" default="#1" />
<arg name="camera2_id" default="#2" />
<arg name="depth_registration" default="true"/>
<!-- Default parameters-->
<arg name="camera1_name" default="kinect1" />
<arg name="camera2_name" default="openni" />
<!-- Putting the time back to realtime-->
<rosparam>
/use_sim_time : false
</rosparam>
<!-- Launching first kinect-->
<include file="$(find openni_launch)/launch/openni.launch">
<arg name="device_id" value="$(arg camera1_id)"/>
<arg name="camera" value="$(arg camera1_name)"/>
<arg name="depth_registration" value="$(arg depth_registration)" />
</include>
<!-- Launching second kinect-->
<include file="$(find openni_launch)/launch/openni.launch">
<arg name="device_id" value="$(arg camera2_id)"/>
<arg name="camera" value="$(arg camera2_name)"/>
<arg name="depth_registration" value="$(arg depth_registration)" />
</include>
</launch>
any idea or suggestion is appreciated! And thanks in advance!

Selenium if/else condition with Apache Ant

Selenium test case requires an if/else condition. How can I insert an if/else condition in a Selenium test case? We have a build file which has a variable CUSTOMNAME which is passed at runtime through an Ant command. If the value is passed, then execute the below line else ignore and move on with rest of the test case.
Run Keyword If || ${CUSTOMNAME}>0 || Select Checkbox
Build file:
<target name="Compute" depends="init">
<echo message="${TODAY_DE}"/>
<exec executable="cmd">
<arg line="/k start cmd.exe"/>
<arg line="/k pybot"/>
<arg line="--variable BROWSER:${Internet}"/>
<arg line="--variable REMOTE_URL:${Remote_Url}"/>
<arg line="--variable SERVICE:${Service}"/>
<arg line="--variable CUSTOMNAME:${CUSTOMNAME}"/>
<arg line="--name ${Service}_${Internet}"/>
<arg line="--doc ${Service}_${Internet}"/>
<arg line="-o ${output.dir}\${Service}_${Internet}_output.xml"/>
<arg line="-l ${logs.dir}\${Service}_${Internet}_logs.xml"/>
<arg line="-r ${docs.dir}\${Service}_${Internet}.html"/>
<arg line="${Compute_Test}"/>
</exec>
</target>
You can use the if attribute to run the Compute <target> only if the CUSTOMNAME property is set:
<target name="Compute" depends="init" if="CUSTOMNAME">
Notice the added if="CUSTOMNAME".

ant junit selenium wont run in jenkins

I have junit tests that use selenium to test web server.
When i run the tests using ant from command line, everything is working fine, browser gets opened and tests are going as planed.Browser gets open and i can see tests running.
Recently ive tried to add automatic tests as part of Ci cycle running on jenkins.
I run it as ant build command.
I can see that ant is executing properly (test classes are built i can see output from tests to console) but browser window never gets opened and test fails because of it. here is my ant file
<?xml version="1.0"?>
<project name="JUNIT" default="main" basedir="../../project" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- Sets variables which can later be used. -->
<!-- The value of a property is accessed via ${} -->
<property name="api.dir" location="src/java" />
<property name="build.api.dir" location="target/classes" />
<property name="test.dir" location="src/test/java" />
<property name="build.test.dir" location="target" />
<!-- Variables used for JUnit testin -->
<property name="test.report.dir" location="testreport" />
<!-- Define the classpath which includes the junit.jar and the classes after compiling-->
<path id="api.class.path">
<pathelement location="${build.api.dir}" />
</path>
<artifact:dependencies cacheDependencyRefs="true" pathId="pomdeps.path">
<pom file="pom.xml"/>
</artifact:dependencies>
<target name="clean">
<delete dir="${test.report.dir}" />
<delete dir="${build.api.dir}" />
<delete dir="${build.test.dir}" />
</target> <!-- Creates the build, docs and dist directory-->
<target name="makedir">
<echo message="Make dir"/>
<mkdir dir="${build.test.dir}" />
<mkdir dir="${build.api.dir}" />
<mkdir dir="${test.report.dir}" />
</target> <!-- Compiles the java code (including the usage of library for JUnit -->
<target name="compile" depends="clean, makedir">
<echo message="Compile"/>
<javac srcdir="${api.dir}" destdir="${build.api.dir}" includeantruntime="false">
<!--classpath refid="junit.class.path" />
<classpath refid="libs.class.path" /-->
<classpath refid="pomdeps.path" />
</javac>
<javac srcdir="${test.dir}" destdir="${build.test.dir}" includeantruntime="false">
<!--classpath refid="junit.class.path" /-->
<classpath refid="api.class.path" />
<classpath refid="pomdeps.path" />
</javac>
</target>
<!-- Run the JUnit Tests --> <!-- Output is XML, could also be plain-->
<echo message="Classes folder ${build.test.dir}"/>
<target name="junit" depends="compile" >
<echo message="junit"/>
<junit printsummary="on" fork="false" haltonfailure="no" showoutput="true">
<classpath refid="pomdeps.path" />
<classpath>
<pathelement location="${build.test.dir}"/>
<pathelement location="${build.api.dir}"/>
</classpath>
<formatter usefile="false" type="plain"/>
<batchtest fork="no" todir="${test.report.dir}">
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="main" depends="compile, junit">
<description>Main target</description>
</target>
</project>
Jenkins is 1.591 i installed it with default parameters as windows installation downloaded from their site.
Can it be something wrong with jenkins? Do i miss something?
As i mentioned earlier the problem was lack of UI permissions for Jenkins server.
1.configure Jenkins to run as service and make it login with real user name
2.Make sure that windows host that runs Jenkins logs on automaticaly after restart.

Nant script not able to spawn msbuild

I've been asked to migrate a VB.NET solution from Windows Server 2003, Visual Studio 2005, 32 bit, .NET 2.0 to Windows Server 2008, Visual Studio 2008, 64 bit, .NET 4.0. I have the solution compiling and working fine in Visual Studio. the next step is getting the Nant script to work so it'll checkout, compile and test like it did before.
However, when the Nant script gets to the msbuild step, it's failing immediately with "...Microsoft.NET/Framework64/v4.0.30319/msbuild failed to start. Access is denied"
I've tried running msbuild directly with the same inputs and it gets past this point. My question is: is there something I can put in my nant .build to get it to run it's tasks as an administrator?
My .build file:
<?xml version="1.0"?>
...
<credential domain="xxxx" username="xxxxx" password="xxxxxx" id="55" />
<property name="debug" value="true" overwrite="false" />
<property name="configuration" value="debug" overwrite="false" />
<property name="solution.file" value="solution.sln" overwrite="false" />
...
<target name="msbuild" description="Build the whole solution">
<exec program="C:/Windows/Microsoft.NET/Framework64/v4.0.30319/msbuild" workingdir="D:/BuildTest" commandline='"${solution.file}" /v:q /nologo /p:Configuration=${configuration}' />
</target>
...
Or
You could put ".exe" on the end if the msbuild line
<exec program="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe">
I have the same problem on a 32-bit machine. A workaround for me is to use nantcontrib's msbuild task instead. Anyone understands why this works?
On a 64-bit computer the exec-method works as well. I have to point to msbuild.exe in the correct Framework folder.
<target name="compile" description="Compiles the .Net solution">
<!-- this works -->
<msbuild project="${src.root.dir}\${src.solution}"
verbosity="Normal">
<arg value="/p:Configuration=${msbuild.configuration}" />
<arg value="/p:Platform=Any CPU" />
<arg value="/t:Rebuild" />
<arg value="/nologo" />
</msbuild>
<!-- access is denied -->
<exec program="${msbuild.path}"
workingdir="${src.root.dir}"
basedir="${src.root.dir}"
commandline="${src.root.dir}\${src.solution}${src.solution}"
failonerror="true" >
<arg value="/p:Platform=Any CPU" />
<arg value="/p:Configuration=${msbuild.configuration}" />
<arg value="/t:Rebuild" />
<arg value="/v:${msbuild.verbosity}" />
</exec>
</target>

<msbuild> task or msbuild.exe with NAnt?

It looks like there are (at least) two options for getting nant to use csproj files: using the task of NAntContrib or using msbuild.exe directly (e.g., codecampserver). Am I reading this right, and if so, what is the advantage of using msbuild.exe over the NAntContrib task?
The NAntContrib assumes .NET Framework V2.0. If you want to use .NET 3.5, you'll need to call MsBuild.exe directly. As you upgrade to new versions of .NET, you need only modify the MSBuildPath property.
Here's an example:
<property name="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"/>
<target name="build">
<exec program="${MSBuildPath}">
<arg line='"${SolutionFile}"' />
<arg line="/property:Configuration=${SolutionConfiguration}" />
<arg value="/target:Rebuild" />
<arg value="/verbosity:normal" />
<arg value="/nologo" />
<arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/>
</exec>
</target>
The value MSBuildPath for different versions of .NET are
2.0, 3.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\MSBuild.exe
3.5 C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe
4, 4.5.x, 4.6.x, 4.7.x C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
For a 32-bit build, change Framework64 to Framework
Update
Following up on some of the comments, the value attribute is used for parameters that have no white space characters where as line is used for parameters that contain white spaces. Otherwise, the NAnt would use the space as an end of input.
Here is a simple target
<target>
<loadtasks assembly="${nant::get-base-directory()}/../../nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />
<msbuild project="${filepath.root}/yourproject.csproj" verbose="true">
<arg value="/p:Platform=${build.platform}" />
<arg value="/t:Rebuild" />
<arg value="/p:OutputPath=${build.dir}/bin/" />
</msbuild>
</target>