MSBuild
3 つの Visual Studio ソリューションを呼び出してビルドするバッチ ファイルがあります。
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
MSBuild solution0.sln /property:Configuration=Release
MSBuild solution1.sln /property:Configuration=Release
MSBuild solution2.sln /property:Configuration=Release
これはうまくいきます。ただし、ビルドするプログラムのバージョンを選択するようユーザーに促したいと考えています。ユーザーの入力に応じて、特定のソリューション セットを構築します。
私の問題は、 をPATH
呼び出した後に変数を変更するとvcvarsall
、 を呼び出すことができなくなることMSBuild
です。
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
set /P version="Enter the version number [1] or [2]:"
IF %version% == 1 (
set PATH="%PATH%;%PATH_TO_VERSION1_LIBS%"
MSBuild solution0_v1.sln /property:Configuration=Release
MSBuild solution1_v1.sln /property:Configuration=Release
MSBuild solution2_v1.sln /property:Configuration=Release
)
IF %version% == 2 (
set PATH="%PATH%;%PATH_TO_VERSION2_LIBS%"
MSBuild solution0_v2.sln /property:Configuration=Release
MSBuild solution1_v2.sln /property:Configuration=Release
MSBuild solution2_v2.sln /property:Configuration=Release
)
次のエラーが表示されます。
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
ERROR: Cannot determine the location of the VS Common Tools folder.
VS100COMNTOOLS
環境変数が定義されているため、これは不可解です。