Visual Studio - Can I export templates via command line? - vs-extensibility

Is the "Export Template" functionality available from a command line anywhere? I checked the command line arguments for both MSBuild.exe and devenv.exe and didn't see anything obvious.

How to: Create a Project Template Using the Projectgen.exe Command-Line Tool

Related

Specflow tests in teamcity

How can I configure the build process in TeamCity to execute SpecFlow tests?
I am using visual studio 2017 with the Specrun.Specflow nuget package installed.
Can it be done with Nunit or SpecRun.exe?
To run the SpecFlow tests with the SpecFlow+Runner (aka SpecRun), you need to do this:
Open your project's build steps.
Click on Add build step.
Choose "Command Line" from the dialogue.
Configure the build step as follows:
Run: Executable with parameters
Command executable: Enter the path to SpecRun.exe here
Command parameters: Enter the command line parameters for SpecRun.exe here. Use the BuildServerRun option and include /buildserver:teamcity.
Information on executing command lines in TeamCity is available here. More details on the
SpecFlow+ Runner's command line options can be found here.
Click on Save.
Taken from https://specflow.org/plus/documentation/SpecFlowPlus-and-TeamCity/

MSBuild configuration in jenkins

I am facing the error below during configuration of MSBuild in Jenkins:
[ImageResize] $ cmd.exe /C " msbuild.exe p:Configuration=Release
E:\Heena\Applications\ImageResize\vbimage\ImageResize.sln " && exit
%%ERRORLEVEL%% 'msbuild.exe' is not recognized as an internal or
external command, operable program or batch file. Build step 'Build a
Visual Studio project or solution using MSBuild' marked build as
failure Finished: FAILURE
Please note that I have set MSBuild path up to msBuild.exe during setting up of MSbuild plugin. I have successfully deployed Visual Studio project on jenkins, but unable to configure it with MSBuild.
In MSBuild installations option of jenkins,
Choose the path to MSBuild = C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Then go to your respective jenkins project where you want to build,
from,Add Build Step menu choose
Build Visual Studio Project or solution using MSBuild option
MSBuild version will be what you defined in Step 1 and in MSBuild File
type the path of your solution file and in Command Line Arguments option
type /p:Configuration=Release.
Hope you got the answer what you were looking for.
A Guess from my side , msbuild.exe is not part of the PATH when you execute the msbuild command , check that before you run the command , try to export the the path to msbuild to the path variable.
Looking at the error i assume you are using windows/Batch , so try some thing like this before running msbuild
set PATH=%PATH%;path/to/msbuild/binary
Feel free to revert in case of any issues/concerns

Is it possible to run the command line compiler with selected build configuration in Delphi XE2?

I'd like to make builds from the command line and I'm wondering if there's a way how to execute the command line compiler with selected build configuration ?
I know there is option --no-config which won't load default dcc32.cfg file but I would like to set the build configuration I've prepared in my project.
I would like to run something like
dcc32.exe --some-option RELEASE Win32 PLATFORM
Is there some option for selecting build configuration ?
Thank you
You need to be using msbuild rather than dcc32 for this:
msbuild myproject.dproj /p:Config=RELEASE;Platform=Win32
Make sure you have called the rsvars.bat file from the RAD Studio bin folder before you attempt to call msbuild. This sets up the necessary environment variables.
The great thing about the modern msbuild based build system, as implemented in Delphi, is that you can quite easily ensure that your command line builds are identical to your IDE builds.
As far as I know, you can use the dcc64.exe to compile for 64-bit if you do not want to use MSBuild. It is in the same folder as the dcc32.exe (and dccosx.exe for compile for OSX)

How can I perform a 'dry run' of MSBUILD for a Delphi project?

if I launch the RAD Studio command prompt and run
msbuild /t:Rebuild
in the project directory, msbuild will show the full command line to invoke dcc32, including all path settings. (see Is there a Delphi library which returns all effective source paths for a project?)
If I only want to capture this msbuild console output in a file, and do not need the compiler execution, is there a way to run msbuild only to display which actions it will perform? I have checked the msbuild options but there seems to be no 'dry run' switch.
One possible (but amateurish) solution could be to modify the PATH so that msbuild will not find the compiler.
You can replace dcc32.exe with your own application which will log the command line and exit.
I don't think this is possible. Also I don't think that you will have success by modifying the PATH variable. As far as I knwo the CSC task will not use that to locate where the csc.exe is located.

Delphi MSBuild Build Configurations From Command Line

Delphi 2009 uses build configurations. When you create a new project you have two default build configurations "Debug" and "Release".
Now I asked myself how to automate builds using MSBuild (which is supported by Delphi since version 2007).
You can start the "msbuild" command in the "RAD Studio Command Prompt" in some Delphi project directory and it will build the default build configuration (the last activated build configuration inside the Delphi IDE).
Now, I want to specify a certain (non-default) build configuration by a command line parameter.
The Delphi help asserts that the parameter is [/p:configuration=<configuration name>], which is wrong (Delphi 2009, Help Update 1)!
What is the right way?
Now, if you want to change the build configuration you have to add the parameter
/p:config=<BUILD_CONFIG_NAME>
For example:
C:\Projects\TestDelphiApp001>msbuild /target:Build /p:config=Release
or
C:\Projects\TestDelphiApp001>msbuild /target:Build /p:config=Debug
Copied from original "question"; note community wiki.
I tried this with Delphi XE. It didn't work until I figured out I needed to set the environment variables referenced by the .dproj file:
SET BDS=C:\Program Files (x86)\Embarcadero\RAD Studio\8.0
SET BDSBIN=C:\Program Files (x86)\Embarcadero\RAD Studio\8.0\bin
SET BDSAPPDATABASEDIR=BDS
msbuild myproject.dproj /target:Build /p:config=Release
I've had the same problem and found the solution:
Write /p:config instead of /p:configuration
Write "Release Build" or "Debug Build" (in double quotes) instead of Release or Debug
It did it for me.

Resources