Merge pull request #153 from wfurt/freebsd

Unofficial support for freebsd
This commit is contained in:
Livar 2018-12-11 11:06:45 -08:00 committed by GitHub
commit a7476cb30c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 3 deletions

View file

@ -4,6 +4,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' AND
($(Rid.StartsWith('rhel.6'))
OR $(Rid.StartsWith('freebsd'))
OR $(Rid.StartsWith('linux-musl'))
OR $(Rid.StartsWith('fedora.27'))
OR $(Rid.StartsWith('opensuse.42.3'))
@ -12,6 +13,7 @@
<UsePortableLinuxSharedFramework Condition=" '$(UsePortableLinuxSharedFramework)' == '' AND '$(OSPlatform)' == 'linux' AND '$(Rid)' != 'rhel.6-x64' AND '$(Rid)' != 'linux-musl-x64' ">true</UsePortableLinuxSharedFramework>
<IncludeSharedFrameworksForBackwardsCompatibilityTests Condition=" $(IncludeSharedFrameworksForBackwardsCompatibilityTests) == ''
AND '$(Rid)' != 'freebsd-x64'
AND '$(Rid)' != 'linux-x64'
AND '$(Rid)' != 'rhel.6-x64'
AND '$(Rid)' != 'linux-musl-x64'

View file

@ -9,7 +9,7 @@
</GetCurrentRuntimeInformation>
<PropertyGroup>
<IsLinux Condition = " '$(HostOSName)' != 'win' AND '$(HostOSName)' != 'osx' ">True</IsLinux>
<IsLinux Condition = " '$(HostOSName)' != 'win' AND '$(HostOSName)' != 'osx' AND '$(HostOSName)' != 'freebsd'">True</IsLinux>
<OSName Condition=" '$(OSName)' == '' AND '$(IsLinux)' != 'True' ">$(HostOSName)</OSName>
<OSPlatform Condition=" '$(OSPlatform)' == '' AND '$(IsLinux)' != 'True' ">$(HostOSPlatform)</OSPlatform>
<OSName Condition=" '$(OSName)' == '' AND '$(IsLinux)' == 'True' ">linux</OSName>

View file

@ -34,6 +34,14 @@ namespace Microsoft.DotNet.Cli.Build.Framework
}
}
public static bool IsFreeBSD
{
get
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"));
}
}
public static bool IsUbuntu
{
get
@ -83,7 +91,7 @@ namespace Microsoft.DotNet.Cli.Build.Framework
{
get
{
return IsLinux || IsOSX;
return IsLinux || IsOSX || IsFreeBSD;
}
}
@ -124,6 +132,8 @@ namespace Microsoft.DotNet.Cli.Build.Framework
return IsUbuntu;
case BuildPlatform.OSX:
return IsOSX;
case BuildPlatform.FreeBSD:
return IsFreeBSD;
case BuildPlatform.CentOS:
return IsCentOS;
case BuildPlatform.RHEL:
@ -182,6 +192,10 @@ namespace Microsoft.DotNet.Cli.Build.Framework
{
return BuildPlatform.OpenSuse;
}
else if (IsFreeBSD)
{
return BuildPlatform.FreeBSD;
}
else
{
return default(BuildPlatform);

View file

@ -14,6 +14,7 @@ namespace Microsoft.DotNet.Cli.Build.Framework
RHEL = 7,
Debian = 8,
Fedora = 9,
OpenSuse = 10
OpenSuse = 10,
FreeBSD = 11
}
}

View file

@ -17,6 +17,8 @@ uname=$(uname)
if [ "$(uname)" = "Darwin" ]
then
RID=osx-x64
elif [ "$(uname)" = "FreeBSD" ]; then
RID=freebsd-x64
else
RID=linux-x64
fi

View file

@ -180,6 +180,7 @@
<PropertyGroup Condition="'$(CreateCrossgenSymbols)' == ''">
<CreateCrossgenSymbols>true</CreateCrossgenSymbols>
<CreateCrossgenSymbols Condition="'$(OSName)' == 'osx'">false</CreateCrossgenSymbols>
<CreateCrossgenSymbols Condition="'$(OSName)' == 'freebsd'">false</CreateCrossgenSymbols>
</PropertyGroup>
<Crossgen