-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
When building runtime tests the build system always imports CoreCLR specific .props file which causes series of workarounds to make the runtime tests on mobile set up properly (especially in AndroidBuild.props and AppleBuild.props).
Here is the import sequence when building a runtime tests for Android with Mono:

Proposal
We should fix this as a prerequisite on improving test coverage with other .NET runtimes on mobile, especially since we need a way to determine early which target runtime the tests (and the whole SDK) are using (whether it is RuntimeFlavor property or UseMonoRuntime).
Tentative list of problematic areas
-
The imported coreclr-specific file unconditionally sets
UseMonoRuntime=false:runtime/src/coreclr/Directory.Build.props
Line 11 in 2ac0591
<UseMonoRuntime>false</UseMonoRuntime> -
The output paths unconditionally use coreclr subdir:
runtime/src/tests/Common/dir.common.props
Line 15 in f1901a0
<BaseOutputPath>$(ArtifactsDir)tests\coreclr</BaseOutputPath> -
The build script sets various runtime-specific global properties and exports them to MSBuild:
Lines 414 to 422 in f1901a0
__OSPlatformConfig="$__TargetOS.$__TargetArch.$__BuildType" __BinDir="$__RootBinDir/bin/coreclr/$__OSPlatformConfig" __PackagesBinDir="$__BinDir/.nuget" __TestDir="$__RepoRootDir/src/tests" __TestBinDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig" __IntermediatesDir="$__RootBinDir/obj/coreclr/$__OSPlatformConfig" __TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig" __CrossCompIntermediatesDir="$__IntermediatesDir/crossgen" __MonoBinDir="$__RootBinDir/bin/mono/$__OSPlatformConfig" -
RuntimeFlavoris set from the build script:
Lines 387 to 391 in f1901a0
if [[ $__Mono -eq 1 ]]; then __RuntimeFlavor="mono" else __RuntimeFlavor="coreclr" fi
and used in the builds through:
runtime/src/tests/Directory.Build.props
Line 84 in f1901a0
<RuntimeFlavor Condition="'$(__RuntimeFlavor)' != ''">$(__RuntimeFlavor)</RuntimeFlavor>
and not via:
Line 90 in 2e42b6e
<PropertyGroup Condition="'$(RuntimeFlavor)' == ''">