How does NANT run from Command Prompt on a developer machine Know Where TFS is? - tfs

I open a command prompt and issue the following commands
CD /D C:\CorpInc\ location of xml files for builds
C:\devtools\NANt\bin\NAnt.exe -D:Rebuild="true" -buildfile:"name of xml file" -logfile:"name of xml file.log" -D:DeployCheckEnv=CO -D:vss.user=%USERNAME%
it works - but how does it know where to find TFS? there is nothing in the XML file which says where the code is located

Related

Cannot Build build.xml file in wso2 esb home/bin directory

In WSO2 Documentation, they have said Open a command prompt (or a shell in Linux) and go to the <ESB_HOME>\bin directory. Then run the ant command as shown below to build the build.xml file.
In My Case If I run ant Command it shows command not found even though I run cmd in bin of wso2.
So Can anyone help me with this?
you need to install 'ant' first when you are using Windows.
https://ant.apache.org/manual/install.html

launch a .bat in TFS2015 build

I have a problem trying to launch a server via a .bat file during a TFS build.
I usually launch the server via a cmd window and it works fine.
When I set it in the TFS build, I end up with the following message :
"'..\server_common.bat' is not recognized as an internal command or external, an executable or a command file".
I also have the following line:
"java -Dsun.lang.ClassLoader.allowArraySyntax=true -Xbootclasspath/a:..\..\..\lib\framework\serverjvm15.jar; -cp ..\..\..\lib\framework\fwtime.jar;" indicating a java syntax error (? I'm not skilled in java)
This batch calls other .bat files and sets java VM-related environment variables
From my research, it is probably a problem of rights as I don't have admin rights when I use TFS. However, all the other steps in the build work fine (installing and launching an appli through command lines, or launching a python script via command lines).
However I also tried to launch a basic script with the same kind of step and it works.
First, suggest you to follow the tutorial in Batch script. Make sure you have meet the requirements of Arguments and used correctly. Such as
Path
Specify the path to the .bat or .cmd script you want to run. The path
must be a fully qualified path or a valid path relative to
the default working directory. In Team Foundation Build, this
directory is $(Build.SourcesDirectory).
Also RDP to your build agent and use your build service account manually run the server_common.bat to narrow down if the account have enough permission.

How do i run a saved project from command line in CppCheck

I created a project in CppCheck named CppCheck_MainRls.cppcheck
that includes several directories, i can run the project from the gui and it's working.
my project is huge so i only need a few directories to pass through CppCheck and export the result into xml file (later to be read by jenkins)
The current command line is:
"C:\Program Files (x86)\Cppcheck\CppCheck.exe" --enable=all --xml-version=2 "C:\Program Files (x86)\Jenkins\jobs\MainRls\workspace\Labs\VC++\AllShared" 2> cppcheck_result.xml
which is working great for the "AllShared" directory, how can i change it to read my project file?
I am a cppcheck developer. Currently, you can't use a gui project file directly in the shell client. However it is a good idea to allow it.
As of April 2020 (cppcheck v1.90), this is supported per the cppcheck manual (PDF) section 3.1:
3.1 Cppcheck GUI project
You can import and use Cppcheck GUI project files in the command line tool:
cppcheck --project=foobar.cppcheck

Spaces in TFS file path for Command Line

I am running a batch script that automates some calls to tf.exe and have run into an issue when I have spaces in my path name. For example if get the following at the command prompt:
>tf history /noprompt "$/MyProject/_source_xlf/Some Dir With Spaces/some file w spaces.xlf"
No history entries were found for the item and version combination specified.
Note the double quotes in the command. In the Source Explorer in VS2012 I can navigate to the file just fine, and view the history with no issues through the GUI. Some of the GUI operations even display the server path of the file, which I can copy and paste directly into the tf command (which is how I verify the file path is correct).
I've read elsewhere that tfs supports spaces in the path, and well it does in the GUI, so is there some trick to making it work at the command prompt?

TFS 2010 Team Build - rename a file

As part of my TFS 2010 team build, I'm trying to copy a configuration file from a network location to the output folder where the build goes to.
Using xcopy as an invoke process task, I've successfully gotten it all working EXCEPT that I want to rename the file as part of the copy. The problem is that if you supply a different destination filename, XCOPY asks if the destination is a file or a directory e.g.
XCOPY \\networkshare\configs\live.config \\networkshare\release\server.exe.config /R /Y
results in XCOPY asking me to press F if server.exe.config is a file or D if it's a directory. XCOPY doesn't seem to have any way to suppress this behaviour. I've tried using the basic COPY commmand but Team Build just says that it doesn't recognise the COPY command.
Is there any way to easily rename a file as part of Team Build or use another command line tool to achieve this?
Cheers
Just to confirm - setting the process as CMD.EXE and starting the arguments as "/c copy" does the trick.

Resources