mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
* Stop reading TargetFramework prop in props files The TargetFramework property isn't expected to be set in props files before a project's body is evaluated. Don't let BuildTargetFramework property fallback to TargetFramework as BTF's sole intent is to convey the TargetFramework to filter to and not the current selected TargetFramework. Reduce usage of BTF so that it is only used in places where code is actually conditioned on filtering. In addition to that, specify BuildTargetFramework as a global property for all traversal builds so when invoking one of the traversal projects directly (src.proj, ref.proj, etc.), BuildTargetFramework doesn't need to specified manually to get the default behavior (filter on compatible to net6.0). Remove the inferred BuildingNetCoreAppVertical because of that and inline its meaning. Make sendtohelix a normal NoTargets proj so that it has access to the properties which were moved into the Directory.Build.targets file as otherwise it wouldn't import that file.
55 lines
4.4 KiB
XML
55 lines
4.4 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<RunSettingsInputFilePath>$(MSBuildThisFileDirectory).runsettings</RunSettingsInputFilePath>
|
|
<RunSettingsIntermediateOutputFilePath>$(ArtifactsObjDir)$(TargetOS)-$(Configuration)-$(TargetArchitecture).runsettings</RunSettingsIntermediateOutputFilePath>
|
|
<RunSettingsAppOutputFilePath>$(OutDir).runsettings</RunSettingsAppOutputFilePath>
|
|
|
|
<CreateIntermediateRunSettingsFile Condition="'$(CreateIntermediateRunSettingsFile)' == ''">false</CreateIntermediateRunSettingsFile>
|
|
<RunSettingsOutputFilePath Condition="'$(CreateIntermediateRunSettingsFile)' == 'true'">$(RunSettingsIntermediateOutputFilePath)</RunSettingsOutputFilePath>
|
|
<RunSettingsOutputFilePath Condition="'$(CreateIntermediateRunSettingsFile)' != 'true'">$(RunSettingsAppOutputFilePath)</RunSettingsOutputFilePath>
|
|
|
|
<!-- Set RunSettingsFilePath property which is read by VSTest. -->
|
|
<RunSettingsFilePath Condition="Exists('$(RunSettingsAppOutputFilePath)')">$(RunSettingsAppOutputFilePath)</RunSettingsFilePath>
|
|
<!-- Use an intermediate runsettings file if the app hasn't been built yet to enable VSTest discovery. -->
|
|
<RunSettingsFilePath Condition="'$(RunSettingsFilePath)' == '' and Exists('$(RunSettingsIntermediateOutputFilePath)')">$(RunSettingsIntermediateOutputFilePath)</RunSettingsFilePath>
|
|
|
|
<PrepareForRunDependsOn>GenerateRunSettingsFile;$(PrepareForRunDependsOn)</PrepareForRunDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<_testFilter Condition="'$(_withCategories)' != ''">$(_withCategories.Replace(';', '&amp;category='))</_testFilter>
|
|
<_testFilter Condition="'$(_withoutCategories)' != ''">$(_testFilter)$(_withoutCategories.Replace(';', '&amp;category!='))</_testFilter>
|
|
<_testFilter>$(_testFilter.Trim('&amp;'))</_testFilter>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="GenerateRunSettingsFile"
|
|
DependsOnTargets="SetupCoverageFilter">
|
|
<PropertyGroup>
|
|
<RunSettingsFileContent>$([System.IO.File]::ReadAllText('$(RunSettingsInputFilePath)'))</RunSettingsFileContent>
|
|
<RunSettingsFileContent Condition="'$(TestDisableParallelization)' == 'true'">$(RunSettingsFileContent.Replace('$$MAXCPUCOUNT$$', '1'))</RunSettingsFileContent>
|
|
<RunSettingsFileContent Condition="'$(TestDisableParallelization)' != 'true'">$(RunSettingsFileContent.Replace('$$MAXCPUCOUNT$$', '0'))</RunSettingsFileContent>
|
|
<!-- Arm64 is currently not a known TargetPlatform value in VSTEST: https://github.com/microsoft/vstest/issues/2566 -->
|
|
<RunSettingsFileContent Condition="'$(TargetArchitecture)' != 'arm64'">$(RunSettingsFileContent.Replace('$$TARGETPLATFORM$$', '<TargetPlatform>$(TargetArchitecture)</TargetPlatform>'))</RunSettingsFileContent>
|
|
<RunSettingsFileContent Condition="'$(TargetArchitecture)' == 'arm64'">$(RunSettingsFileContent.Replace('$$TARGETPLATFORM$$', ''))</RunSettingsFileContent>
|
|
<RunSettingsFileContent>$(RunSettingsFileContent.Replace('$$COVERAGE_INCLUDE$$', '$(CoverageIncludeFilter)')
|
|
.Replace('$$COVERAGE_EXCLUDEBYFILE$$', '$(CoverageExcludeByFileFilter)')
|
|
.Replace('$$COVERAGE_INCLUDEDIRECTORY$$', '$(CoverageIncludeDirectoryFilter)')
|
|
.Replace('$$COVERAGE_ENABLED$$', '$([MSBuild]::ValueOrDefault('$(Coverage)', 'false'))')
|
|
.Replace('$$DISABLEPARALLELIZATION$$', '$([MSBuild]::ValueOrDefault('$(TestDisableParallelization)', 'false'))')
|
|
.Replace('$$DISABLEAPPDOMAIN$$', '$([MSBuild]::ValueOrDefault('$(TestDisableAppDomain)', 'false'))')
|
|
.Replace('$$TESTCASEFILTER$$', '$(_testFilter)')
|
|
.Replace('$$DOTNETHOSTPATH$$', '$(NetCoreAppCurrentTestHostPath)$([System.IO.Path]::GetFileName('$(DotNetTool)'))'))</RunSettingsFileContent>
|
|
</PropertyGroup>
|
|
|
|
<WriteLinesToFile File="$(RunSettingsOutputFilePath)"
|
|
Lines="$(RunSettingsFileContent)"
|
|
WriteOnlyWhenDifferent="true"
|
|
Overwrite="true" />
|
|
|
|
<!-- Set RunSettingsFilePath property which is read by VSTest. -->
|
|
<PropertyGroup>
|
|
<RunSettingsFilePath>$(RunSettingsOutputFilePath)</RunSettingsFilePath>
|
|
</PropertyGroup>
|
|
</Target>
|
|
</Project>
|