Skip to content

Commit

Permalink
Remove more OSGroup usages from src/mono (dotnet#33247)
Browse files Browse the repository at this point in the history
* Remove more OSGroup usages from src/mono

Follow-up to dotnet#32833

* PR feedback
  • Loading branch information
akoeplinger authored Mar 6, 2020
1 parent 0d42ea8 commit 574f003
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<CoreCLRTargetOS Condition="'$(CoreCLRTargetOS)' == ''">$(TargetOS)</CoreCLRTargetOS>
<CoreCLRConfiguration Condition="'$(CoreCLRConfiguration)' == ''">$(Configuration)</CoreCLRConfiguration>
<MonoTargetOS Condition="'$(MonoCLROSGroup)' == ''">$(TargetOS)</MonoTargetOS>
<MonoTargetOS Condition="'$(MonoTargetOS)' == ''">$(TargetOS)</MonoTargetOS>
<MonoConfiguration Condition="'$(MonoConfiguration)' == ''">$(Configuration)</MonoConfiguration>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/libraries/restore/runtime/runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<SwapNativeForIL Condition="'$(SwapNativeForIL)' == '' and ('$(Configuration)' == 'Debug' or '$(Coverage)' == 'true') and '$(RuntimeFlavor)' != 'Mono'">true</SwapNativeForIL>
<CoreCLRTargetOS Condition="'$(CoreCLRTargetOS)' == ''">$(TargetOS)</CoreCLRTargetOS>
<CoreCLRConfiguration Condition="'$(CoreCLRConfiguration)' == ''">$(Configuration)</CoreCLRConfiguration>
<MonoTargetOS Condition="'$(MonoTargetOS)' == ''">$(DefaultOSGroup)</MonoTargetOS>
<MonoTargetOS Condition="'$(MonoTargetOS)' == ''">$(TargetOS)</MonoTargetOS>
<MonoConfiguration Condition="'$(MonoConfiguration)' == ''">$(Configuration)</MonoConfiguration>
<BinPlaceForTargetVertical>false</BinPlaceForTargetVertical>
<TargetFrameworks>netcoreapp3.0-Windows_NT;netcoreapp3.0-Unix;$(netcoreappCurrent)-Windows_NT;$(netcoreappCurrent)-Unix</TargetFrameworks>
Expand Down
20 changes: 7 additions & 13 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />

<!-- Set default Configuration and Platform -->
<!-- Set default Platform -->
<PropertyGroup>
<OSGroup Condition="'$(OSGroup)' == '' and '$([MSBuild]::IsOSPlatform(Windows))' == 'true'">Windows_NT</OSGroup>
<OSGroup Condition="'$(OSGroup)' == '' and '$([MSBuild]::IsOSPlatform(Linux))' == 'true'">Linux</OSGroup>
<OSGroup Condition="'$(OSGroup)' == '' and '$([MSBuild]::IsOSPlatform(OSX))' == 'true'">OSX</OSGroup>

<ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup>
<Platform>$(ArchGroup)</Platform>
<TargetArchitecture>$(ArchGroup)</TargetArchitecture>

<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>

<PlatformConfigPathPart>$(OSGroup).$(Platform).$(Configuration)</PlatformConfigPathPart>
<PlatformConfigPathPart>$(TargetOS).$(Platform).$(Configuration)</PlatformConfigPathPart>
</PropertyGroup>

<!-- Common properties -->
Expand All @@ -41,11 +35,11 @@

<!-- Set up common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsFreeBSD Condition="'$(OSGroup)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsLinux Condition="'$(OSGroup)' == 'Linux'">true</TargetsLinux>
<TargetsNetBSD Condition="'$(OSGroup)' == 'NetBSD'">true</TargetsNetBSD>
<TargetsOSX Condition="'$(OSGroup)' == 'OSX'">true</TargetsOSX>
<TargetsWindows Condition="'$(OSGroup)' == 'Windows_NT'">true</TargetsWindows>
<TargetsFreeBSD Condition="'$(TargetOS)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsLinux Condition="'$(TargetOS)' == 'Linux'">true</TargetsLinux>
<TargetsNetBSD Condition="'$(TargetOS)' == 'NetBSD'">true</TargetsNetBSD>
<TargetsOSX Condition="'$(TargetOS)' == 'OSX'">true</TargetsOSX>
<TargetsWindows Condition="'$(TargetOS)' == 'Windows_NT'">true</TargetsWindows>
<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix>
</PropertyGroup>

Expand Down
24 changes: 12 additions & 12 deletions src/mono/llvm/llvm-init.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Condition="'$(OSGroup)' == 'Linux'" Include="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(OSGroup)' == 'Linux'" Include="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
<PackageReference Condition="'$(OSGroup)' == 'Windows_NT'" Include="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(OSGroup)' == 'Windows_NT'" Include="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
<PackageReference Condition="'$(OSGroup)' == 'OSX'" Include="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(OSGroup)' == 'OSX'" Include="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'Linux'" Include="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'Linux'" Include="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'Windows_NT'" Include="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'Windows_NT'" Include="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'OSX'" Include="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)" />
<PackageReference Condition="'$(TargetOS)' == 'OSX'" Include="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)" />
</ItemGroup>

<Target Name="CopyLLVMToTree" AfterTargets="Restore">
<ItemGroup>
<LLVMFiles Condition="'$(OSGroup)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\linux-x64\**" />
<LLVMFiles Condition="'$(OSGroup)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\linux-x64\**" />
<LLVMFiles Condition="'$(OSGroup)' == 'Windows_NT'" Include="$(NuGetPackageRoot)\runtime.win-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\win-x64\**" />
<LLVMFiles Condition="'$(OSGroup)' == 'Windows_NT'" Include="$(NuGetPackageRoot)\runtime.win-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\win-x64\**" />
<LLVMFiles Condition="'$(OSGroup)' == 'OSX'" Include="$(NuGetPackageRoot)\runtime.osx.10.12-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\osx.10.12-x64\**" />
<LLVMFiles Condition="'$(OSGroup)' == 'OSX'" Include="$(NuGetPackageRoot)\runtime.osx.10.12-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\osx.10.12-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\linux-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'Linux'" Include="$(NuGetPackageRoot)\runtime.linux-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\linux-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'Windows_NT'" Include="$(NuGetPackageRoot)\runtime.win-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\win-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'Windows_NT'" Include="$(NuGetPackageRoot)\runtime.win-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\win-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'OSX'" Include="$(NuGetPackageRoot)\runtime.osx.10.12-x64.microsoft.netcore.runtime.mono.llvm.sdk\$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion)\tools\osx.10.12-x64\**" />
<LLVMFiles Condition="'$(TargetOS)' == 'OSX'" Include="$(NuGetPackageRoot)\runtime.osx.10.12-x64.microsoft.netcore.runtime.mono.llvm.tools\$(runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)\tools\osx.10.12-x64\**" />
</ItemGroup>

<Copy SourceFiles="@(LLVMFiles)" DestinationFolder="$(MonoLLVMDir)\%(RecursiveDir)">
Expand Down
6 changes: 3 additions & 3 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<_CoreClrFileName Condition="'$(_CoreClrFileName)' == ''">libcoreclr.so</_CoreClrFileName>
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
<CoreClrTestCoreRoot>$(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root</CoreClrTestCoreRoot>
<LibrariesTesthostRoot>$(ArtifactsDir)bin\testhost\$(NetCoreAppCurrent)-$(OSGroup)-$(LibrariesTestConfig)-$(Platform)\</LibrariesTesthostRoot>
<CoreClrTestCoreRoot>$(ArtifactsDir)tests\coreclr\$(TargetOS).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root</CoreClrTestCoreRoot>
<LibrariesTesthostRoot>$(ArtifactsDir)bin\testhost\$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesTestConfig)-$(Platform)\</LibrariesTesthostRoot>
<LibrariesTesthostRuntimeDir>$(LibrariesTesthostRoot)shared\Microsoft.NETCore.App\$(ProductVersion)\</LibrariesTesthostRuntimeDir>
</PropertyGroup>

Expand Down Expand Up @@ -235,7 +235,7 @@

<!-- Run CoreCLR runtime test using testhost -->
<Target Name="RunCoreClrTest" DependsOnTargets="ValidateLocalDotnet;PatchCoreClrCoreRoot">
<Error Condition="$(CoreClrTest) == ''" Text="'CoreClrTest' is not set. E.g. set it to `$(ArtifactsDir)tests/coreclr/$(OSGroup).$(Platform).$(CoreClrTestConfig)/JIT/opt/InstructionCombining/DivToMul/DivToMul$(ScriptExt)` in order to run DivToMul test." />
<Error Condition="$(CoreClrTest) == ''" Text="'CoreClrTest' is not set. E.g. set it to `$(ArtifactsDir)tests/coreclr/$(TargetOS).$(Platform).$(CoreClrTestConfig)/JIT/opt/InstructionCombining/DivToMul/DivToMul$(ScriptExt)` in order to run DivToMul test." />
<Exec Command="$(CoreClrTest) -coreroot=&quot;$(CoreClrTestCoreRoot)&quot;"/>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion src/mono/netcore/nuget/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'osx'">OSX</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'android'">Android</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(_runtimeOSFamily)' == 'win'">Windows_NT</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(OSGroup)' != ''">$(OSGroup)</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == '' and '$(TargetOS)' != ''">$(TargetOS)</_derivedPackageTargetOSGroup>
<_derivedPackageTargetOSGroup Condition="'$(_derivedPackageTargetOSGroup)' == ''">Linux</_derivedPackageTargetOSGroup>

<_isSupportedOSGroup Condition="!$(SupportedPackageOSGroups.Contains(';$(_derivedPackageTargetOSGroup);'))">false</_isSupportedOSGroup>
Expand Down

0 comments on commit 574f003

Please sign in to comment.