From 42f1781463e973a7e764675715191b4f137d4e05 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 12 Apr 2017 12:47:28 -0700 Subject: Enable building Core_Root for any RID against packages --- build-test.cmd | 57 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 20 deletions(-) (limited to 'build-test.cmd') diff --git a/build-test.cmd b/build-test.cmd index 785c3cbf05..c12e9af645 100644 --- a/build-test.cmd +++ b/build-test.cmd @@ -57,6 +57,7 @@ set __RunArgs= set __BuildAgainstPackagesArg= set __RuntimeId= set __ZipTests= +set __TargetsWindows=1 :Arg_Loop if "%1" == "" goto ArgsDone @@ -80,6 +81,7 @@ if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs if /i "%1" == "buildagainstpackages" (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "ziptests" (set __ZipTests=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) +if /i "%1" == "targetsNonWindows" (set __TargetsWindows=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if [!processedArgs!]==[] ( @@ -90,6 +92,13 @@ if [!processedArgs!]==[] ( :ArgsDone +if defined __BuildAgainstPackagesArg ( + if not defined __RuntimeID ( + echo %__MsgPrefix%Error: When building against packages, you must supply a target Runtime ID. + exit /b 1 + ) +) + echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat" call "%__VSToolsRoot%\VsDevCmd.bat" @@ -228,32 +237,17 @@ REM ============================================================================ if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir% set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root" -set "CORE_OVERLAY=%XunitTestBinBase%\Tests\Core_Root_%__RuntimeId%" call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -UpdateDependencies -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% set __BuildLogRootName=Tests_GenerateRuntimeLayout -call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% +call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% if errorlevel 1 ( echo BinPlace of mscorlib.dll failed exit /b 1 ) -if defined __RuntimeId ( - - if not exist %__PackagesDir%\TestNativeBins ( - echo %__MsgPrefix%Error: Ensure you have run sync.cmd -ab before building a non-Windows test overlay against packages - exit /b 1 - ) - - call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -CreateNonWindowsTestOverlay -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% - for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.so) do copy %%f %Core_Overlay% - for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.dylib) do copy %%f %Core_Overlay% - - echo %__MsgPrefix% Created the runtime layout for %__RuntimeId% in %CORE_OVERLAY% -) - echo %__MsgPrefix% Restored CoreCLR product from packages :SkipRestoreProduct @@ -305,14 +299,34 @@ if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%" md "%CORE_ROOT%" xcopy /s "%__BinDir%" "%CORE_ROOT%" +if defined __BuildAgainstPackagesArg ( + if "%__TargetsWindows%"=="0" ( + + if not exist %__PackagesDir%\TestNativeBins ( + echo %__MsgPrefix%Error: Ensure you have run sync.cmd -ab before building a non-Windows test overlay against packages + exit /b 1 + ) + + for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.so) do copy %%f %CORE_ROOT% + for /R %__PackagesDir%\TestNativeBins\%__RuntimeId%\%__BuildType% %%f in (*.dylib) do copy %%f %CORE_ROOT% + ) +) + echo %__MsgPrefix%Creating test wrappers... set RuntimeIdArg= +set TargetsWindowsArg= if defined __RuntimeId ( set RuntimeIdArg=-RuntimeID="%__RuntimeId%" ) +if "%__TargetsWindows%"=="1" ( + set TargetsWindowsArg=-TargetsWindows=true +) else if "%__TargetsWindows%"=="0" ( + set TargetsWindowsArg=-TargetsWindows=false +) + set __BuildLogRootName=Tests_XunitWrapper set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn @@ -321,7 +335,7 @@ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%" set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%" set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%" -call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg% +call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %TargetsWindowsArg% if errorlevel 1 ( echo Xunit Wrapper build failed exit /b 1 @@ -337,7 +351,7 @@ set __msbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%" set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%" set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%" -call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__unprocessedBuildArgs% +call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__unprocessedBuildArgs% if errorlevel 1 ( echo %__MsgPrefix%Error: build failed. Refer to the build log files for details: echo %__BuildLog% @@ -362,7 +376,7 @@ REM === Prep test binaries for Helix publishing REM === REM ========================================================================================= -call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg% +call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs% %RuntimeIdArg% %TargetsWindowsArg% echo %__MsgPrefix% Prepped test binaries for publishing @@ -393,13 +407,16 @@ echo runtimeid ^: Builds a test overlay for the specified OS (Only supporte echo alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3 echo debian.8-x64: Builds overlay for Debian 8 echo fedora.24-x64: Builds overlay for Fedora 24 -echo fedora.25-x64: Builds overlay for Fedora 25 +echo linux-x64: Builds overlay for portable linux echo opensuse.42.1-x64: Builds overlay for OpenSUSE 42.1 echo osx.10.12-x64: Builds overlay for OSX 10.12 +echo osx-x64: Builds overlay for portable OSX echo rhel.7-x64: Builds overlay for RHEL 7 or CentOS echo ubuntu.14.04-x64: Builds overlay for Ubuntu 14.04 echo ubuntu.16.04-x64: Builds overlay for Ubuntu 16.04 echo ubuntu.16.10-x64: Builds overlay for Ubuntu 16.10 +echo win-x64: Builds overlay for portable Windows +echo win7-x64: Builds overlay for Windows 7 echo ziptests: zips CoreCLR tests & Core_Root for a Helix run echo Exclude- Optional parameter - specify location of default exclusion file (defaults to tests\issues.targets if not specified) echo Set to "" to disable default exclusion file. -- cgit v1.2.3