Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Allow test projects to be SDK style #18810

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
313449f
Only include Build.Common.targets when using buildtools
chsienki Jun 20, 2018
78b00de
Move some dir.targets into a diffent file so we can exclude them for …
chsienki Jun 20, 2018
8959ebe
Add Directory.Build.{targets, props} that redirect to dirs.{props, ta…
chsienki Jun 20, 2018
bb32b49
Remove extra slash from Base[Intermediate]OutputPath on tests
chsienki Jun 22, 2018
dce8e68
Rename targetassemblyname extension to dll
chsienki Jun 27, 2018
1762942
Rename nosdk targets file, and import it when neccesary
chsienki Jun 27, 2018
251c232
Enable required properties for sdk properties at the root dirs.props
chsienki Jun 28, 2018
b17cff6
Remove code task factory: generate the param list using msbuild synta…
chsienki Jul 2, 2018
66f84de
Revert "Rename targetassemblyname extension to dll"
chsienki Jul 2, 2018
f2ae5a9
Force tests to have .exe extension rather than dll when they are exec…
chsienki Jul 2, 2018
34f6d3a
Fix dir.targets build imports so that we correctly include buildtools…
chsienki Jul 2, 2018
dbaa803
Always include the nobuild targets if we're a run only project
chsienki Jul 2, 2018
78d4089
Remove runtime references in override.targets when referencing System…
chsienki Jul 3, 2018
ed2feaf
Merge branch 'master' into sdk_projects
chsienki Jul 5, 2018
b31c3ac
Add comments to Directory.Build.props,targets to explain usage
chsienki Jul 5, 2018
d9720b5
Split out nobuild and runonlybuild into two targets files to make the…
chsienki Jul 5, 2018
34b66a4
Rename runonlybuild.targets
chsienki Jul 5, 2018
613f9a0
Fix for SDK projects referencing system.private.corelib
chsienki Jul 6, 2018
0c32d18
Initial change to allow build wrappers and runtest.py
Jun 8, 2018
23d8627
Build xunit wrappers on unix
sbomer Jun 15, 2018
2889281
Correctly generate TestEnv xplat
Jun 18, 2018
4a2f434
Build xunit wrappers using SDK
sbomer Jun 19, 2018
0be3ded
Target netcoreapp2.0 in xunit wrappers
sbomer Jun 19, 2018
0ebb165
Restore to packages directory for xunit wrappers
sbomer Jun 20, 2018
5055fd4
Move common properties out to dir.common.props
sbomer Jun 27, 2018
df7b2f3
Remove desktop-specific test wrapper csproj
sbomer Jun 27, 2018
0963074
Pass build os/arch/type and logsdir to msbuild from runtest.py
sbomer Jun 27, 2018
41c25f3
Remove xunit wrapper helper library from travernal build
sbomer Jun 28, 2018
bf93ab2
Fix parameter passing in build-test.sh
sbomer Jun 28, 2018
2cc7024
Clean up factored .props files
sbomer Jun 28, 2018
493a4b8
Undo runtest.sh changes
sbomer Jun 28, 2018
379bc34
Use latest xunit console runner everywhere
sbomer Jun 28, 2018
4ccf85e
Remove extra StaticDependency on xunit.runner.console
sbomer Jun 28, 2018
51fae78
Eliminate tests/src/dir.common.props, and rename dir.sdkbuild.props
sbomer Jun 29, 2018
9c49d85
Reintroduce dir.sdkbuild.props as a place for SDK-only props
sbomer Jun 29, 2018
db49431
Add xml namespace to dir.common.props
sbomer Jun 29, 2018
8aed5fd
Satisfy xunit analyzer
sbomer Jun 29, 2018
89ba5c1
Satisfy xunit analyzer again
sbomer Jun 29, 2018
c5860f0
Use SDK msbuild to build wrappers
sbomer Jul 3, 2018
71d0327
Remove Microsoft.CSharp.Core.targets workaround
sbomer Jul 6, 2018
96a11ef
Remove UseRoslynCompilers prop and unify roslyn import
sbomer Jul 6, 2018
98a9614
Merge branch 'unify_test_runner' of https://github.com/sbomer/coreclr…
chsienki Jul 9, 2018
98a1b2c
Merge branch 'master' of https://github.com/dotnet/coreclr into merge…
chsienki Jul 9, 2018
8814d88
Remove duplicate properties
chsienki Jul 9, 2018
3f2c0cd
Don't import dirs.props/targets in coreclr.testwrapper
chsienki Jul 9, 2018
7f61eac
Merge branch 'master' of https://github.com/dotnet/coreclr into sdk_p…
chsienki Jul 9, 2018
6111010
Fix build for vs2015
chsienki Jul 10, 2018
829c52b
Undo fix for test wrapper.
chsienki Jul 11, 2018
5280198
Add dummy directory.build.props/targets to common folder to prevent t…
chsienki Jul 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion build-test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ if defined __BuildAgainstPackagesArg (
@if defined _echo @echo on

set __RunArgs=-BuildOS=%__BuildOS% -BuildType=%__BuildType% -BuildArch=%__BuildArch%
REM As we move from buildtools to arcade, __RunArgs should be replaced with __msbuildArgs
set __msbuildArgs=/p:__BuildOS=%__BuildOS% /p:__BuildType=%__BuildType% /p:__BuildArch=%__BuildArch%

if defined __ToolsetDir (
rem arm64 builds currently use private toolset which has not been released yet
Expand Down Expand Up @@ -156,6 +158,12 @@ REM ===
REM =========================================================================================
call "%__ProjectDir%\init-tools.cmd"
@if defined _echo @echo on
set "__ToolsDir=%__ProjectDir%\Tools"
set "__DotnetHost=%__ToolsDir%\dotnetcli\dotnet.exe"
if not exist "%__DotnetHost%" (
echo %__DotnetHost% not found after init-tools.
exit /b 1
)

REM =========================================================================================
REM ===
Expand Down Expand Up @@ -424,7 +432,8 @@ 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% %TargetsWindowsArg% %__unprocessedBuildArgs%
REM Build wrappers using the local SDK's msbuild. As we move to arcade, the other builds should be moved away from run.exe as well.
call %__DotnetHost% msbuild %__ProjectDir%\tests\runtest.proj /p:BuildWrappers=true !__msbuildLog! !__msbuildWrn! !__msbuildErr! %__msbuildArgs% %__unprocessedBuildArgs%
if errorlevel 1 (
echo Xunit Wrapper build failed
exit /b 1
Expand Down
68 changes: 38 additions & 30 deletions build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ generate_layout()
# ===
# =========================================================================================

build_Tests_internal "Restore_Packages" "${__ProjectDir}/tests/build.proj" " -BatchRestorePackages" "Restore product binaries (build tests)"
build_Tests_internal "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"

if [ -n "$__UpdateInvalidPackagesArg" ]; then
__up=-updateinvalidpackageversion
Expand All @@ -172,21 +172,14 @@ generate_layout()

mkdir -p $CORE_ROOT

build_Tests_internal "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "-testOverlay" "Creating test overlay"
build_Tests_internal "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "Creating test overlay" "-testOverlay"

chmod +x $__BinDir/corerun
chmod +x $__BinDir/crossgen

# Make sure to copy over the pulled down packages
cp -r $__BinDir/* $CORE_ROOT/ > /dev/null

# Work hardcoded path around
if [ ! -f "${__BuildToolsDir}/Microsoft.CSharp.Core.Targets" ]; then
ln -s "${__BuildToolsDir}/Microsoft.CSharp.Core.targets" "${__BuildToolsDir}/Microsoft.CSharp.Core.Targets"
fi
if [ ! -f "${__BuildToolsDir}/Microsoft.CSharp.targets" ]; then
ln -s "${__BuildToolsDir}/Microsoft.CSharp.Targets" "${__BuildToolsDir}/Microsoft.CSharp.targets"
fi
}

build_Tests()
Expand Down Expand Up @@ -230,15 +223,15 @@ build_Tests()
# ===
# =========================================================================================

build_Tests_internal "Restore_Product" "${__ProjectDir}/tests/build.proj" " -BatchRestorePackages" "Restore product binaries (build tests)"
build_Tests_internal "Restore_Product" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"

if [ -n "$__BuildAgainstPackagesArg" ]; then
build_Tests_internal "Tests_GenerateRuntimeLayout" "${__ProjectDir}/tests/runtest.proj" "-BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct" "Restore product binaries (run tests)"
build_Tests_internal "Tests_GenerateRuntimeLayout" "${__ProjectDir}/tests/runtest.proj" "Restore product binaries (run tests)" "-BinPlaceRef" "-BinPlaceProduct" "-CopyCrossgenToProduct"
fi

echo "Starting the Managed Tests Build..."

build_Tests_internal "Tests_Managed" "$__ProjectDir/tests/build.proj" "$__up" "Managed tests build (build tests)"
build_Tests_internal "Tests_Managed" "$__ProjectDir/tests/build.proj" "Managed tests build (build tests)" "$__up"

if [ $? -ne 0 ]; then
echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)"
Expand All @@ -254,7 +247,7 @@ build_Tests()

if [ ! -f $__XUnitWrapperBuiltMarker ]; then

build_Tests_internal "Tests_XunitWrapper" "$__ProjectDir/tests/runtest.proj" "-BuildWrappers -MsBuildEventLogging=\" \" " "Test Xunit Wrapper"
build_Tests_internal "Tests_XunitWrapper" "$__ProjectDir/tests/runtest.proj" "Test Xunit Wrapper" "-BuildWrappers" "-MsBuildEventLogging= " "-TargetsWindows=false"

if [ $? -ne 0 ]; then
echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)"
Expand All @@ -279,23 +272,33 @@ build_Tests()

if [ $__ZipTests -ne 0 ]; then
echo "${__MsgPrefix}ZIP tests packages..."
build_Tests_internal "Helix_Prep" "$__ProjectDir/tests/helixprep.proj" " " "Prep test binaries for Helix publishing"
build_Tests_internal "Helix_Prep" "$__ProjectDir/tests/helixprep.proj" "Prep test binaries for Helix publishing" " "
fi
}

build_Tests_internal()
{
subDirectoryName=$1
projectName=$2
extraBuildParameters=$3
stepName="$4"
shift
projectName=$1
shift
stepName="$1"
shift
extraBuildParameters=("$@")

# Set up directories and file names
__BuildLogRootName=$subDirectoryName
__BuildLog="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.log"
__BuildWrn="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.wrn"
__BuildErr="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.err"

# Use binclashlogger by default if no other logger is specified
if [[ "${extraBuildParameters[*]}" == *"-MsBuildEventLogging"* ]]; then
msbuildEventLogging=""
else
msbuildEventLogging="-MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\""
fi

if [[ "$subDirectoryName" == "Tests_Managed" ]]; then
# Execute msbuild managed test build in stages - workaround for excessive data retention in MSBuild ConfigCache
# See https://github.com/Microsoft/msbuild/issues/2993
Expand All @@ -321,12 +324,16 @@ build_Tests_internal()
export TestBuildSlice=$slice

# Generate build command
buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} -MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs"
buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
buildArgs+=("$msbuildEventLogging")
buildArgs+=("${extraBuildParameters[@]}")
buildArgs+=("${__RunArgs[@]}")
buildArgs+=("${__UnprocessedBuildArgs[@]}")

echo "Building step '$stepName' slice=$slice via $buildCommand"

# Invoke MSBuild
eval $buildCommand
"$__ProjectRoot/run.sh" build "${buildArgs[@]}"

# Make sure everything is OK
if [ $? -ne 0 ]; then
Expand All @@ -346,15 +353,16 @@ build_Tests_internal()
__msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr}\""

# Generate build command
buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} -MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs"
buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
buildArgs+=("$msbuildEventLogging")
buildArgs+=("${extraBuildParameters[@]}")
buildArgs+=("${__RunArgs[@]}")
buildArgs+=("${__UnprocessedBuildArgs[@]}")

echo "Building step '$stepName' via $buildCommand"

# Invoke MSBuild
eval $buildCommand

# Invoke MSBuild
# $__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog="$__msbuildLog" -MsBuildWrn="$__msbuildWrn" -MsBuildErr="$__msbuildErr" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs
"$__ProjectRoot/run.sh" build "${buildArgs[@]}"

# Make sure everything is OK
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -508,7 +516,7 @@ __ZipTests=0
__NativeTestIntermediatesDir=
__RunTests=0
__RebuildTests=0
__BuildTestWrappers=0
__BuildTestWrappers=1
__GenerateLayoutOnly=
__priority1=
CORE_ROOT=
Expand Down Expand Up @@ -671,23 +679,23 @@ while :; do
;;
priority1)
__priority1=1
__UnprocessedBuildArgs="$__UnprocessedBuildArgs -priority=1"
__UnprocessedBuildArgs+=("-priority=1")
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
__UnprocessedBuildArgs+=("$1")
;;
esac

shift
done


__RunArgs="-BuildArch=$__BuildArch -BuildType=$__BuildType -BuildOS=$__BuildOS"
__RunArgs=("-BuildArch=$__BuildArch" "-BuildType=$__BuildType" "-BuildOS=$__BuildOS")

# Configure environment if we are doing a verbose build
if [ $__VerboseBuild == 1 ]; then
export VERBOSE=1
__RunArgs="$__RunArgs -verbose"
__RunArgs+=("-verbose")
fi

# Set default clang version
Expand Down Expand Up @@ -732,7 +740,7 @@ __CrossgenExe="$__CrossComponentBinDir/crossgen"

isMSBuildOnNETCoreSupported

# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to set.
# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to it.
# This is needed by CLI to function.
if [ -z "$HOME" ]; then
if [ ! -d "$__ProjectDir/temp_home" ]; then
Expand Down
6 changes: 1 addition & 5 deletions dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PgoDataPackageVersion>99.99.99-master-20180703-0030</PgoDataPackageVersion>
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26704-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
<XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
<XunitConsoleNetcorePackageVersion>2.2.0-preview1-02830-02</XunitConsoleNetcorePackageVersion>
<XunitPackageVersion>2.4.0-beta.2.build4010</XunitPackageVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove one of these 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this happened in my branch when I rebased. Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have made that more clear. I merged @sbomer 's branch into this one, as we've both changed a bunch of stuff. I wonder if it's worth waiting for Sven's changes to land, then rebase onto that, so this is clearer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would make sense.

<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.4</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<CommandLineParserVersion>2.2.0</CommandLineParserVersion>
Expand Down Expand Up @@ -164,10 +164,6 @@
<Version>$(XunitPerformanceApiPackageVersion)</Version>
</StaticDependency>

<StaticDependency Include="xunit.console.netcore">
<Version>$(XunitConsoleNetcorePackageVersion)</Version>
</StaticDependency>

<DependencyBuildInfo Include="@(StaticDependency)">
<PackageId>%(Identity)</PackageId>
<UpdateStableVersions>true</UpdateStableVersions>
Expand Down
36 changes: 36 additions & 0 deletions dir.common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- This file contains build properties that apply to product
projects and test projects. It's imported by
tests/dir.common.props, and the global dir.props. -->

<PropertyGroup>
<CoreclrDir>$(MSBuildThisFileDirectory)</CoreclrDir>
<PackagesDir>$(CoreclrDir)/packages</PackagesDir>
</PropertyGroup>

<!-- Set default Configuration and Platform -->
<PropertyGroup>
<BuildArch>$(__BuildArch)</BuildArch>
<BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
<BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>

<BuildType>$(__BuildType)</BuildType>
<BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
<BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>

<BuildOS>$(__BuildOS)</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT</BuildOS>

<Configuration Condition="'$(Configuration)' == ''">$(BuildType)</Configuration>
<Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>
</PropertyGroup>

<PropertyGroup>
<RestorePackagesPath>$(PackagesDir)</RestorePackagesPath>
</PropertyGroup>


</Project>
14 changes: 2 additions & 12 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="Exists('..\dir.props')" Project="..\dir.props" />

<Import Project="dir.common.props" />

<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
-->
Expand Down Expand Up @@ -42,18 +44,6 @@

<!-- Common properties -->
<PropertyGroup>
<!-- Set basic properties and normalize -->
<BuildArch>$(__BuildArch)</BuildArch>
<BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
<BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>

<BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
<BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>

<BuildOS>$(__BuildOS)</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT</BuildOS>

<ProjectDir>$(__ProjectDir)\</ProjectDir>
<ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</ProjectDir>
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toolRuntime=$working_tree_root/Tools
dotnet=$toolRuntime/dotnetcli/dotnet

echo "Running: $dotnet $toolRuntime/run.exe $working_tree_root/config.json $*"
$dotnet $toolRuntime/run.exe $working_tree_root/config.json $*
$dotnet $toolRuntime/run.exe $working_tree_root/config.json "$@"
if [ $? -ne 0 ]
then
echo "ERROR: An error occured in $dotnet $toolRuntime/run $#. Check $# logs under $working_tree_root."
Expand Down
1 change: 0 additions & 1 deletion tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+serialize\benchmark+serialize.csproj" />
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark\benchmark.csproj" />
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\performance\performance.csproj" />
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\TestWrappersConfig\TestWrappersConfig.csproj" />
</ItemGroup>

<Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages" Condition="$(__SkipTargetingPackBuild) != 'true'">
Expand Down
28 changes: 28 additions & 0 deletions tests/dir.common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="../dir.common.props" />

<!-- This file contains common build properties for projects under
the test tree, and also generated test projects in
bin/tests. It currently has only those properties that are
shared between buildtools test projects and SDK-style test
projects. Eventually every test project should build using the
SDK. Some test projects still bypass this by importing
tests/dir.props directly - these should eventually go away. -->

<PropertyGroup>
<OSPlatformConfig>$(BuildOS).$(Platform).$(Configuration)</OSPlatformConfig>

<TestSrcDir>$(CoreclrDir)/tests/src</TestSrcDir>
<BuildProjectRelativeDir>$([System.String]::Copy('$(MSBuildProjectDirectary)').Replace($(TestSrcDir),''))/$(MSBuildProjectName)</BuildProjectRelativeDir>

<!-- BaseIntermediateOutputPath is used by the SDK as the location
for the lock file, and props/targets from nuget packages. -->
<BaseIntermediateOutputPath>$(CoreclrDir)/bin/tests/obj/$(OSPlatformConfig)/Managed/$(BuildProjectRelativeDir)</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>

<BaseOutputPath>$(CoreclrDir)/bin/tests/$(OSPlatformConfig)/$(BuildProjectRelativeDir)</BaseOutputPath>
<OutputPath>$(BaseOutputPath)</OutputPath>

</PropertyGroup>

</Project>
5 changes: 1 addition & 4 deletions tests/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<BuildToolsTargets45>$(BuildToolsTargetsDesktop)</BuildToolsTargets45>
<RunningOnUnix Condition="('$(RunningOnUnix)' == '') And ('$(MSBuildRuntimeType)' == 'Core') And ('$(OS)'!='Windows_NT')">true</RunningOnUnix>
<UseBuildTools>true</UseBuildTools>
<UseBuildTools Condition="'$(OS)'=='Windows_NT' And '$(RunningOnCore)' == 'true'">false</UseBuildTools>
</PropertyGroup>

<!-- Common repo directories -->
Expand All @@ -47,7 +46,6 @@
<DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolsDir)dotnetcli\</DotnetCliPath>
<BuildToolsTaskDir Condition="'$(BuildToolsTargets45)' == 'true'">$(ToolsDir)net46\</BuildToolsTaskDir>
<OverrideToolHost Condition="'$(OS)' != 'Windows_NT'">$(DotnetCliPath)dotnet</OverrideToolHost>
<CSharpCoreTargetsPath Condition="('$(BuildToolsTargetsDesktop)' != 'true') And ('$(UseBuildTools)'=='true')">$(ToolsDir)\Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath>
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
Expand Down Expand Up @@ -105,8 +103,7 @@
</PropertyGroup>

<!-- Use Roslyn Compilers to build -->
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false' and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />
<Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)') and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />
<Import Project="$(RoslynPropsFile)" Condition="Exists('$(RoslynPropsFile)') and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />

<PropertyGroup Condition="'$(BuildAllProjects)'=='true'">
<!-- When we do a traversal build we get all packages up front, don't restore them again -->
Expand Down
14 changes: 14 additions & 0 deletions tests/dir.sdkbuild.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<Import Project="dir.common.props" />

<!-- This file contains build properties that apply only to
SDK-style test projects. Properties that are shared between SDK
and buildtools projects should go in dir.common.props. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this comment!!


<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

</Project>
Loading