I am trying to create TFS ANT build script.When getting the resource for TFS from ant : "com/teamprise/ant/antlib.xml". It is not able to load the jar. I understand from the search that ,this antlib.xml is no more supported. Can any body suggest me which resource to look for to get the access of command line tfs commands in my ant script.
Following is the snippet of the code:
<path id= "tfsant.classpath" >
<fileset dir= "${env.ANT_HOME}/lib" >
<include name= "*teamprise-ant*.jar" />
</fileset>
</path>`enter code here`
<typedef resource="com/teamprise/ant/antlib.xml" classpathref="tfsant.classpath" />
<exec executable="tf">
<arg value="checkout"/>
<arg value="${tfsroot}/temp/BUILD_${build.number}"/>
<arg value="${workdir}"/>
</exec>
You can install Team Explorer Everywhere on your machine. This will install the TF Command-Line utility. Configure the environment variable "Path" for tf.exe, then you can access to tf command directly from your ANT script.
Related
After building EAR file when i'm trying to extract XML file form the EAR i'm getting error [exec] Failed to open properties file : AppManage.tra
<property name="Appmanage" value="C:\tibco\etascbw513\tra\5.10\bin\AppManage.exe" />
<target name="extract">
<exec executable="${Appmanage}">
<arg value="-export"/>
<arg value="-ear"/>
<arg value="${workdir}\Deploy\EARs\${project}.ear"/>
<arg value="-out"/>
<arg value="${workdir}\Deploy\EARs\${project}.xml"/>
<arg value="-max"/>
</exec>
old Q : can someone share simple build.xml to create ear file from ant script
details : i'm able to pull repositories with the help ant script now i want to create EAR file from ant script for Tibco BW. can any one share simple demo .
try to solve this error using below steps.
try to check your environment variable path.
check TRA_HOME/bin/ using App manage utility.
This error "Failed to open properties file : AppManage.tra" occurs because the AppManage executable tries to look for AppManage.tra in the current execution directory and does not find it. In this particular case, the current execution directory would depend on where you are executing Ant from.
The correct way to avoid this error is to provide full path to the AppManage.tra file as an argument to the AppManage executable in the ant exec statement, as shown below, in the highlighted section (two new arguments are added "--propFile" and "full path to AppManage.tra"). Hope this helps.
<property name="Appmanage" value="C:\tibco\etascbw513\tra\5.10\bin\AppManage.exe" />
<target name="extract">
<exec executable="${Appmanage}">
<arg value="--propFile"/>
<arg value="C:\tibco\etascbw513\tra\5.10\bin\AppManage.tra"/>
<arg value="-export"/>
<arg value="-ear"/>
<arg value="${workdir}\Deploy\EARs\${project}.ear"/>
<arg value="-out"/>
<arg value="${workdir}\Deploy\EARs\${project}.xml"/>
<arg value="-max"/>
</exec>
I am using the following open source version of image J in an experiment:
https://github.com/pcj/arterioj
it uses ANT.
Of of the ant targets is:
stats
<!-- ================================================================ -->
<!-- Stats and plot generation tasks -->
<!-- ================================================================ -->
<target name="stats">
<exec executable="R">
<arg line="--vanilla --no-readline --quiet --slave --file=${basedir}/ldip-data.R --args"/>
</exec>
</target>
when I try to use this target I get the following build error message:
BUILD FAILED
/Users/James/ArterioJ/build.xml:179: Execute failed: java.io.IOException: Cannot run program "R" (in directory "/Users/James/ArterioJ"): error=2, No such file or directory
I am unsure how to fix this. I have tried to copy the R package into the /users/James/ArterioJ directory to see if that would help but to no effect.
Thanks
You might want to specify the full path of the R executable, for instance:
<property name="r.home" value="/home/me/R_INSTALL"/>
<target name="stats">
<exec executable="${r.home}/R">
<arg line="--vanilla --no-readline --quiet --slave --file=${basedir}/ldip-data.R --args"/>
</exec>
</target>
Alternatively, if the path to the executable is part of the PATH environment variable, you could just add the searchpath="true" attribute to the exec task:
<exec executable="R" searchpath="true">
<arg line="--vanilla --no-readline --quiet --slave --file=${basedir}/ldip-data.R --args"/>
</exec>
Here is an extract from the Ant documentation about searchpath:
When this attribute is true, then system path environment variables
will be searched when resolving the location of the executable
I'm attempting to set up a Windows node for Jenkins (master is running on Mac/ElCapitan) to run Codeception acceptance tests.
The jenkins jnlp file seems to be running appropriately, Jenkins has created its directories on the Windows node. I'm asking it to run a test via an ant build in Firefox only. This is a successful test running on the master/Apple machine.
I can type "codecept" into the command prompt on the Windows Node in any directory and get the default help message.
I can run the test by going into the Jenkins created folders on the Windows Node machine via the command prompt with codecept run tests/acceptance/all/test.
When trying to do this through Jenkins from the master machine I get the following error:
C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10\build.xml:147: Execute failed: java.io.IOException: Cannot run program "C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10\vendor\bin\codecept" (in directory "C:\jenkins\workspace\nodeTest\browser\firefox\label\Windows10"): CreateProcess error=193, %1 is not a valid Win32 application
The ant file:
<property environment="env"/>
<property name="codecept" value="${basedir}/vendor/bin/codecept"/>
<target name="InvalidLogin" depends="CleanPics, InvalidLoginRun" />
<target name="CleanPics" description="clean out directories from previous run.">
<delete dir="${basedir}/tests/_output" />
<mkdir dir="${basedir}/tests/_output" />
<mkdir dir="${basedir}/tests/_output/debug" />
<target name="InvalidLoginRun" description="confirm invalid credentials don't allow login">
<exec executable="${codecept}" failonerror="true">
<arg value="run" />
<arg value="--debug" />
<arg value="tests/acceptance/all/00loginsInvalidCest.php" />
<arg value="--xml" />
<arg value="--env" />
<arg value="${browser}" />
</exec>
Googling has led me to answers that I should be using a ShellExecute instead of a CreateProcess command but I can't figure out how to configure the Ant file to do this. Any ideas?
vendor/bin/codecept file is for Linux and other kinds of unix-like operating systems.
Use vendor/bin/codecept.bat on Windows.
Is there a way use the svn ant task to get the svn revision number of a working copy and put it into a variable?
I would like to add an entry in my Java manifest file which includes the svn revision number, e.g. 0.9.65361 where 65361 is the revision number.
Aha, I found this idea, which depends only on the svnversion command-line utility in SVN.
<project name="ant-exec-example" default="svnversion" basedir=".">
<target name="svnversion">
<exec executable="svnversion" outputproperty="svnversion" />
<echo message="SVN Version: ${svnversion}"/>
</target>
</project>
Here's where it captures the version in an ant property:
<exec executable="svnversion" outputproperty="svnversion" />
There are a couple of ways -
Use a utility - I believe you are looking for this - https://code.google.com/p/svntask/ I have used it for some side
projects and it works well.
Use commandline utility. - "svn info http://svn.myweb.com/myproject". To use this method simply create a
batch file and put this command in the batch file. Then call this
batch file from your ant task and get the revision number from the
text by searching for that starts with line "Revision:". Or you can
just dump the whole result.
Here is my variant to bundle svn revisions info within the application artifact:
<target name="svn_revisions">
<hostinfo prefix="HOST"/>
<echo file="${dir.out}/.revisions" message="Built by ${user.name} on ${HOST.NAME}${line.separator}"/>
<exec dir="${basedir}" executable="svn" output="${dir.out}/.revisions" append="true">
<arg line="info"/>
</exec>
<exec dir="${basedir}" executable="svn" output="${dir.out}/.revisions" append="true">
<arg line="status -u"/>
</exec>
</target>
<target name="build-war" depends="compile, svn_revisions">
<war basedir="web" file="${dir.out}/ROOT.war" webxml="web/WEB-INF/web.xml">
<!-- main stuff -->
<zipfileset dir="${dir.out}" prefix="META-INF" includes=".revisions"/>
</war>
</target>
My project has a jar in classpath with some utilities in it. When I run the program using ant on Red Hat linux, it's unable to read the system properties using System.getProperty(key), but it works perfectly fine when ran on Ubuntu.
Any suggestion to why this might be happening is appreciated.
ant target
<target name="test">
<property environment="env"/>
<echo message="PATH_ROOT set => ${env.PATH_ROOT}" />
<echo message="CUSTOM_REPORT_PATH set => ${env.CUSTOM_REPORT_PATH}" />
<testng classpathref="compile.classpath" haltOnfailure="false" outputDir="${testng.output.dir}/xxx">
<sysproperty key="PATH_ROOT" value="${env.PATH_ROOT}"/>
<sysproperty key="CUSTOM_REPORT_PATH" value="${env.CUSTOM_REPORT_PATH}"/>
<xmlfileset dir="src/com/xxx" includes="suite.xml" />
</testng>
</target>
================
Guys it was a silly mistake. The framework was not executing the file which had the statements to fetch system variables as the listener was missing in testng suite which is a must for testng to invoke that