devenv.exe execute through jenkin's job doesn't work

i am trying to execute devenv.exe through windows batch command plugin in Jenkins but it keeps on executing and fails to launch the application.

Console Output :

**In progressConsole Output
Started by user anonymous
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace
[workspace] $ cmd /c call C:\Windows\TEMP\hudson3900292017086958332.bat
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set DEVPATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE 
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set PATH=D:\app\nazopay\product\11.2.0\dbhome_1\bin;D:\app\nazopay\product\11.2.0\client_1;C:\Program Files (x86)\Integrity\IntegrityClient10\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\cde\tools;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_23\bin\;C:\Program Files (x86)\Google\Chrome\Application;C:\MingW;C:\PROGRA~2\INTEGR~1\Toolkit\mksnt;%JAVA_HOME%;,;C:\Program Files\Java\jdk1.6.0_23;,;C:\Program Files\Java\jdk1.6.0_23\bin;%CLASS_PATH%;,;C:\Program Files\Java\jdk1.6.0_23\lib;,;C:\Program Files\Java\jdk1.6.0_23\lib;;C:\Program Files (x86)\M**icrosoft Visual Studio 10.0\Common7\IDE 

C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>devenv.exe

Answers


You must execute devenv.com.

The devenv.exe always attempts to open GUI, even when commands are given, and it can't. The devenv.com has output directed to standard output and works fine from Jenkins.

You also must pass arguments.

Without arguments both devenv.com and devenv.exe just start the IDE GUI, which is not what you want. The correct command-line is

devenv.com projectname.sln /Build Release /Project projectname

First is path to the solution you want to build. Then the /Build flag is followed by configuration. If you have multiple platforms, you have to pass configuration and platform combination, e.g. Release|Win32. The /Project flag names project to build (including all dependencies). If omitted, it builds all projects selected for build in given configuration.


Why don't you use msbuild?

This would be a good starting point for your windows build script:

call "%VS100COMNTOOLS%\vsvars32.bat"
msbuild projectname.sln /target:Rebuild /l:FileLogger,Microsoft.Build.Engine;logfile=msbuild.log || goto error
goto end
:error
@echo ERROR: Build failed
exit/b 1
:end
exit/b 0

This way you can also capture the output log that you can parse with one of the jenkins plugins. Ofcourse, adjust the VS100COMNTOOLS to your version of MSVS


Need Your Help

Viewing Posts On My Companies Page and Commenting On Them Or Messaging The OP

php facebook api sdk

I am working on an integration script which will allow our company to view all posts on the companies facebook wall from within our CRM system and then allow support staff to comment on questions a...

Checking whether an object is real JSONArray or JSONObject in Android/Java

java android

I made some research and I found these two methods of checking, but I dont know which would be slower and cause more overhead?