SlickEdit Community

Archived Beta Discussions => SlickEdit 201x Beta Discussions => SlickEdit 2019 v24 Beta Discussion => Topic started by: macjohnmcc on August 14, 2019, 08:55:00 PM

Title: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 14, 2019, 08:55:00 PM
I need to add a command line option to visual studio .net builds to set an option.
Title: Re: Is it possible to set command line options for msbuild?
Post by: Lee on August 15, 2019, 10:54:45 AM
Do you need to add an option to the build command used by SlickEdit for builds or need to edit an option that is property in the Visual Studio project?  The build commands are listed under Project Properties, Tools tab where each command is located.   If you need to change any compiler or linking option for the project itself, that needs to be done with Visual Studio.
Title: Re: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 15, 2019, 03:14:09 PM
Due to the way that the build environment is setup on my projects I need to tell MSBuild to use the environment variables for include, lib, path to the compiler etc rather than determining these things itself.

I need to specify this for the builds
/property:VCBuildUseEnvironment=true
Title: Re: Is it possible to set command line options for msbuild?
Post by: Lee on August 15, 2019, 03:37:37 PM
Depending on how the project was created, it may already be setup to use MSBuild for command line builds, you can modify or add parameters to the command-line using Project Properties, Tools tab and change Build, Rebuild or whatever build tool needs to be changed.
Title: Re: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 15, 2019, 03:53:39 PM
The project is a visual studio vcxproj file that typically we build with devenv.exe /useenv <parameters>

It appears to build this same project file vs uses msbuild and the only thing stopping this from working for me is the ability to specify parameters for msbuild in addition to whatever you are already specifying.
Title: Re: Is it possible to set command line options for msbuild?
Post by: Lee on August 15, 2019, 04:08:01 PM
You can replace the existing devenv command-line to use msbuild instead.  We use msbuild as the default build command for newer releases of Visual Studio anyway with the newer templates.  The default command-line now looks like:
msbuild "%w" /t:"%sf" /p:Configuration="%bn" /p:Platform="%bp" /nologo /v:m

where %w gets translated to workspace, %sf is the source project target and others are pretty self-explanatory.  You can use that to start, and then append whatever additional property arguments to that.
Title: Re: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 15, 2019, 04:14:34 PM
I was just hoping I could ride along and just have additional command line options to add to your existing. Thank you.
Title: Re: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 15, 2019, 06:10:03 PM
I changed the commands for the project properties for build and rebuild is to just run nmake. What I see when I compile though is that it is running vsbuild.

I have attached a screenshot of the "Build" settings for the project.

c:\vs2019\win\vsbuild build -b C:\dev\Entrap\EntrapHK\HKCallbacks.cpp -beep -c Debug|x64 C:\dev\Entrap\EntrapHK\EntrapHK.sln C:\dev\Entrap\EntrapHK\EntrapHK.vpj -signal 51106
'x64' is not recognized as an internal or external command,
operable program or batch file.
Title: Re: Is it possible to set command line options for msbuild?
Post by: Lee on August 15, 2019, 06:57:05 PM
Is that the output running the Compile or Build tool from the menu?  Are there multiple projects/dependencies involved in the same solution file that it is trying to build?  I would have to look at your SlickEdit .vpj/.vpw file to see how those commands are configured to see what is going on?  Could also be the Beep on completion option causing something weird in this case, I will have to double-check that option to see if there is some issue building the command-line.

UPDATE: Yep, the addition of the Beep on completion option is mangling the command-line, that is causing an issue.  That option may need to be disabled for this case, but I will check into it see what needs to be fixed.

UPDATE[2]: This will be fixed in next beta release. Thanks for the report.
Title: Re: Is it possible to set command line options for msbuild?
Post by: macjohnmcc on August 15, 2019, 09:08:42 PM
You managed to make me obsolete in solving this. Thanks!
One big win for VS today was that I was trying to rename a variable in a C++ project and neither Visual AssistX plugin nor Resharper C++ pluging could successfully rename it across all the files. VS 2019 Beta 2 did rename properly.