diff --git a/build.sh b/build.sh index b73fca3e7..4cc9a52f0 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #! /bin/bash -msBuild='/c/Program Files (x86)/MSBuild/14.0/Bin' +msBuildVersion='15.0' outputFolder='./_output' outputFolderLinux='./_output_linux' outputFolderMacOS='./_output_macos' @@ -12,6 +12,8 @@ updateFolder=$outputFolder/Sonarr.Update updateFolderMono=$outputFolderLinux/Sonarr.Update nuget='tools/nuget/nuget.exe'; +vswhere='tools/vswhere/vswhere.exe'; + CheckExitCode() { "$@" @@ -62,8 +64,14 @@ CleanFolder() BuildWithMSBuild() { + installationPath=`$vswhere -latest -products \* -requires Microsoft.Component.MSBuild -property installationPath` + installationPath=${installationPath/C:\\/\/c\/} + installationPath=${installationPath//\\/\/} + msBuild="$installationPath/MSBuild/$msBuildVersion/Bin" + echo $msBuild + export PATH=$msBuild:$PATH - CheckExitCode MSBuild.exe $slnFile //t:Clean //m + CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Clean //m $nuget restore $slnFile CheckExitCode MSBuild.exe $slnFile //p:Configuration=Release //p:Platform=x86 //t:Build //m //p:AllowedReferenceRelatedFileExtensions=.pdb } diff --git a/tools/nuget/nuget.exe b/tools/nuget/nuget.exe index 9f8781de0..0cc40884a 100644 Binary files a/tools/nuget/nuget.exe and b/tools/nuget/nuget.exe differ diff --git a/tools/vswhere/vswhere.exe b/tools/vswhere/vswhere.exe new file mode 100644 index 000000000..e1b511803 Binary files /dev/null and b/tools/vswhere/vswhere.exe differ