From 06f6edeffcae1905cc77a130c7bc916188eba1c7 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 19 Feb 2016 11:06:41 -0800 Subject: Fix clean test build I often fall into a build failure like the following when passing /clean E:\Github\coreclr\tests\runtest.proj : error MSB4057: The target "rebuild" does not exist in the project. runtest.proj is actually invoked in two places one from a part of build.cmd targeting CreateTestOverlay only, and the other from runtest.cmd, which creates wrapper and actually running the tests. So, definining "rebuild" target that does "clean" and "build" doesn't solve this problem. The fix is to not target "rebuild" in the former case since we are explicitly targeting "CreateTestOverlay" only. Instead of putting "/t:rebuild" in the common msbuild argument, I added it to each instance except this case. --- tests/buildtest.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/buildtest.cmd') diff --git a/tests/buildtest.cmd b/tests/buildtest.cmd index 279ec2a5d3..3e1b4afddd 100644 --- a/tests/buildtest.cmd +++ b/tests/buildtest.cmd @@ -156,7 +156,7 @@ if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see h :: The issue is that we extend the build with our own targets which :: means that that rebuilding cannot successfully delete the task :: assembly. -set __msbuildCommonArgs=/nologo /nodeReuse:false %__msbuildCleanBuildArgs% %__msbuildExtraArgs% +set __msbuildCommonArgs=/nologo /nodeReuse:false %__msbuildExtraArgs% if not defined __BuildSequential ( set __msbuildCommonArgs=%__msbuildCommonArgs% /maxcpucount @@ -204,7 +204,7 @@ if not exist "%__NativeTestIntermediatesDir%\install.vcxproj" ( ) set __BuildLogRootName=Tests_Native -call :msbuild "%__NativeTestIntermediatesDir%\install.vcxproj" /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% +call :msbuild "%__NativeTestIntermediatesDir%\install.vcxproj" %__msbuildCleanBuildArgs% /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% if errorlevel 1 exit /b 1 REM endlocal to rid us of environment changes from vcvarsall.bat @@ -230,7 +230,7 @@ if not defined VSINSTALLDIR ( exit /b 1 ) -set __msbuildManagedBuildArgs= +set __msbuildManagedBuildArgs=%__msbuildCleanBuildArgs% if defined __crossgen ( echo Building tests with CrossGen enabled. -- cgit v1.2.3