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

Commit

Permalink
Merge pull request #15728 from mellinoe/os-target-cleanup
Browse files Browse the repository at this point in the history
Clean up OS-related property uses, update buildtools, update MSBuild
  • Loading branch information
mellinoe authored Feb 2, 2017
2 parents c6f799e + ec1f3cf commit 99511c7
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion BuildToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.27-prerelease-01230-01
1.0.27-prerelease-01302-01
17 changes: 10 additions & 7 deletions Tools-Override/Build.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@

<!-- Platform detection -->
<PropertyGroup>
<OsEnvironment Condition="'$(OsEnvironment)'=='' AND '$(OS)'=='Unix' AND Exists('/Applications')">OSX</OsEnvironment>
<OsEnvironment Condition="'$(OsEnvironment)'=='' AND '$(OS)'=='Unix'">Linux</OsEnvironment>
<OsEnvironment Condition="'$(OsEnvironment)'==''">$(OS)</OsEnvironment>
<RunningOnUnix Condition="'$(OS)' != 'Windows_NT'">true</RunningOnUnix>
<DefaultOSGroup Condition="'$(OS)'=='Unix' AND Exists('/Applications')">OSX</DefaultOSGroup>
<DefaultOSGroup Condition="'$(DefaultOSGroup)'=='' AND '$(OS)'=='Unix'">Linux</DefaultOSGroup>
<DefaultOSGroup Condition="'$(DefaultOSGroup)'==''">$(OS)</DefaultOSGroup>
<RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix>

<RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
</PropertyGroup>

<!-- Common BuildTools properties -->
Expand All @@ -35,9 +37,10 @@
<ToolRuntimePath Condition="'$(ToolRuntimePath)'=='' and '$(ProjectDir)'!=''">$(ProjectDir)Tools/</ToolRuntimePath>
<ToolsDir Condition="'$(ToolsDir)'==''">$(MSBuildThisFileDirectory)</ToolsDir>
<DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolRuntimePath)dotnetcli/</DotnetCliPath>
<OverrideToolHost>$(DotnetCliPath)dotnet</OverrideToolHost>
<BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)'!='core'">$(ToolsDir)net45/</BuildToolsTaskDir>
<BuildToolsTaskDir Condition="'$(MSBuildRuntimeType)'=='core'">$(ToolsDir)</BuildToolsTaskDir>
<OverrideToolHost Condition="'$(RunningOnUnix)' == 'true'">$(DotnetCliPath)dotnet</OverrideToolHost>
<OverrideToolHost Condition="'$(RunningOnUnix)' != 'true'">$(DotnetCliPath)dotnet.exe</OverrideToolHost>
<BuildToolsTaskDir Condition="'$(RunningOnCore)'!='true'">$(ToolsDir)net45/</BuildToolsTaskDir>
<BuildToolsTaskDir Condition="'$(RunningOnCore)'=='true'">$(ToolsDir)</BuildToolsTaskDir>
<UseRoslynCompilers Condition="'$(UseRoslynCompilers)'=='' and '$(RunningOnUnix)'=='true'">false</UseRoslynCompilers>
<UseSharedCompilation Condition="'$(UseSharedCompilation)' == '' and '$(RunningOnUnix)' != 'true' and '$(UseRoslynCompilers)' != 'false'">true</UseSharedCompilation>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tools-Override/CodeCoverage.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- Coverage options -->
<PropertyGroup>
<CodeCoverageEnabled>false</CodeCoverageEnabled>
<CodeCoverageEnabled Condition="'$(SkipTests)' != 'true' and '$(OS)' == 'Windows_NT' and '$(Coverage)' == 'true' and '$(Performance)' != 'true'">true</CodeCoverageEnabled>
<CodeCoverageEnabled Condition="'$(SkipTests)' != 'true' and '$(RunningOnUnix)' != 'true' and '$(Coverage)' == 'true' and '$(Performance)' != 'true'">true</CodeCoverageEnabled>
<CoverageReportDir Condition="'$(CoverageReportDir)' == ''">$(TestWorkingDir)coverage\</CoverageReportDir>

<!-- This targets file has two modes one for individual projects and one for all -->
Expand Down
16 changes: 7 additions & 9 deletions Tools-Override/ConstructSharedFx.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,17 @@

<ItemGroup>
<!-- This will only copy over the related file -->
<HostFxrFile Condition="'$(OS)'=='Windows_NT'" Include="$(RuntimePath)hostfxr.dll" />
<HostFxrFile Condition="'$(OS)'=='Unix'" Include="$(RuntimePath)libhostfxr.so" />
<HostFxrFile Condition="'$(OS)'=='Unix'" Include="$(RuntimePath)libhostfxr.dylib" />
<DotnetExe Condition="'$(OS)'=='Windows_NT'" Include="$(RuntimePath)dotnet.exe" />
<DotnetExe Condition="'$(OS)'!='Windows_NT'" Include="$(RuntimePath)dotnet" />
<HostFxrFile Condition="'$(OSGroup)'=='Windows_NT'" Include="$(RuntimePath)hostfxr.dll" />
<HostFxrFile Condition="'$(OSGroup)'=='Linux'" Include="$(RuntimePath)libhostfxr.so" />
<HostFxrFile Condition="'$(OSGroup)'=='OSX'" Include="$(RuntimePath)libhostfxr.dylib" />
<DotnetExe Condition="'$(RunningOnUnix)'!='true'" Include="$(RuntimePath)dotnet.exe" />
<DotnetExe Condition="'$(RunningOnUnix)'=='true'" Include="$(RuntimePath)dotnet" />
</ItemGroup>
<MakeDir Directories="$(TestSharedFxPathHostFxr)" />
<Copy SourceFiles="@(HostFxrFile)"
DestinationFolder="$(TestSharedFxPathHostFxr)"
Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
DestinationFolder="$(TestSharedFxPathHostFxr)" />
<Copy SourceFiles="@(DotnetExe)"
DestinationFolder="$(TestSharedFxDir)"
Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
DestinationFolder="$(TestSharedFxDir)" />
<ItemGroup>
<LiveDotNetCliComponents Include="$(RuntimePath)\*.*" Exclude="$(RuntimePath)\xunit.console.netcore.exe" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions Tools-Override/Roslyn.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
<PropertyGroup>
<RoslynVersion>2.0.0-beta3</RoslynVersion>
<RoslynPackageName>Microsoft.Net.Compilers</RoslynPackageName>
<RoslynTargetsPath>$(ToolRuntimePath)</RoslynTargetsPath>
</PropertyGroup>

<PropertyGroup>
<RoslynPropsFile Condition="'$(RoslynPropsFile)' == '' and '$(RunningOnUnix)' != 'true'">$(ToolRuntimePath)/net45/roslyn/build/Microsoft.Net.Compilers.props</RoslynPropsFile>
<RoslynPropsFile Condition="'$(RoslynPropsFile)' == '' and '$(RunningOnCore)' != 'true'">$(ToolRuntimePath)/net45/roslyn/build/Microsoft.Net.Compilers.props</RoslynPropsFile>
</PropertyGroup>

<!--
On Unix we always use a version of Roslyn we restore from NuGet and we have to work around some known issues.
-->
<PropertyGroup Condition="'$(RoslynPropsFile)' == '' and '$(RunningOnUnix)' == 'true'">
<PropertyGroup Condition="'$(RoslynPropsFile)' == '' and '$(RunningOnCore)' == 'true'">
<RoslynPackageDir>$(PackagesDir)/$(RoslynPackageName).$(RoslynVersion)/</RoslynPackageDir>
<RoslynPropsFile>$(RoslynPackageDir)build/$(RoslynPackageName).props</RoslynPropsFile>

Expand Down
4 changes: 2 additions & 2 deletions Tools-Override/codeAnalysis.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
always be net45 (because we use Mono to run our tests and Mono needs to load the net45 version)
-->
<PropertyGroup>
<CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(OSEnvironment)'=='Windows_NT'">$(ToolsDir)net45/analyzers/</CodeAnalyzerDir>
<CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(OSEnvironment)'!='Windows_NT'">$(ToolsDir)analyzers/</CodeAnalyzerDir>
<CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(RunningOnCore)'!='true'">$(ToolsDir)net45/analyzers/</CodeAnalyzerDir>
<CodeAnalyzerDir Condition="'$(CodeAnalyzerDir)'=='' and '$(RunningOnCore)'=='true'">$(ToolsDir)analyzers/</CodeAnalyzerDir>
</PropertyGroup>

<!-- PInvokeChecker data files-->
Expand Down
4 changes: 1 addition & 3 deletions Tools-Override/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,8 @@
</Target>

<Target Name="CheckTestPlatforms">
<GetTargetMachineInfo Condition="'$(TargetOS)' == ''">
<Output TaskParameter="TargetOS" PropertyName="TargetOS" />
</GetTargetMachineInfo>
<PropertyGroup>
<TargetOS Condition="'$(TargetOS)' == ''">$(DefaultOSGroup)</TargetOS>
<TestDisabled Condition="'%(UnsupportedPlatformsItems.Identity)' == '$(TargetOS)' Or '$(ConfigurationErrorMsg)' != ''">true</TestDisabled>
</PropertyGroup>
<Message Text="CheckTestPlatforms found TargetOS of [$(TargetOS)]." Importance="Low" />
Expand Down
6 changes: 3 additions & 3 deletions Tools-Override/versioning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@
</ItemGroup>
<!-- Windows Exec command requires DOS escaping for the percent sign since it secretly runs the process in a shell instead of calling createprocess. -->
<PropertyGroup>
<LatestDateCommand Condition="'$(OsEnvironment)'=='Windows_NT'">git show -s --format=^%25%25cd --date=short HEAD</LatestDateCommand>
<LatestDateCommand Condition="'$(OsEnvironment)'!='Windows_NT'">git show -s --format=%25cd --date=short HEAD</LatestDateCommand>
<LatestDateCommand Condition="'$(RunningOnUnix)'!='true'">git show -s --format=^%25%25cd --date=short HEAD</LatestDateCommand>
<LatestDateCommand Condition="'$(RunningOnUnix)'=='true'">git show -s --format=%25cd --date=short HEAD</LatestDateCommand>
</PropertyGroup>

<Exec Command="$(LatestDateCommand)" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="VersionSeedDate" />
<Output TaskParameter="ExitCode" PropertyName="LatestDateCommandExitCode" />
Expand Down
2 changes: 1 addition & 1 deletion dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
See Documentation/coding-guidelines/project-guidelines.md for more details on our configurations.
-->
<TargetGroup Condition="'$(TargetGroup)' == ''">netcoreapp</TargetGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(OSEnvironment)</OSGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(DefaultOSGroup)</OSGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)' == ''">Debug</ConfigurationGroup>
<ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup>

Expand Down

0 comments on commit 99511c7

Please sign in to comment.