Skip to content

Commit

Permalink
addressing some missing feedback Relating to Browser (#38968)
Browse files Browse the repository at this point in the history
* addressing some missing feedback

* Apply suggestions from code review

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>

* remove odbc32 from ref

* fix stuff

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
  • Loading branch information
Anipik and safern authored Jul 10, 2020
1 parent 45bd3f9 commit b62b16a
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 56 deletions.
4 changes: 0 additions & 4 deletions eng/targetframeworksuffix.props
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,4 @@
</PropertyGroup>
</When>
</Choose>

<PropertyGroup>
<EnablePInvokeAnalyzer Condition="'$(TargetsBrowser)' == 'true'">false</EnablePInvokeAnalyzer>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -14,16 +14,13 @@
Link="Common\Interop\Windows\Interop.FormatMessage.cs" />
<Compile Include="System\ComponentModel\Win32Exception.Windows.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
<Compile Include="System\ComponentModel\Win32Exception.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsAnyOS)' == 'true'">
<Compile Include="System\ComponentModel\Win32Exception.Default.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.InteropServices" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Compile Include="Win32ExceptionTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,18 @@ private ClientConfigPaths(string exePath, bool includeUserConfig)
}
else
{
// An EntryAssembly may not be found when running from a custom host.
// Try to find the native entry point.
using (Process currentProcess = Process.GetCurrentProcess())
try
{
ApplicationUri = currentProcess.MainModule?.FileName;
// An EntryAssembly may not be found when running from a custom host.
// Try to find the native entry point.
using (Process currentProcess = Process.GetCurrentProcess())
{
ApplicationUri = currentProcess.MainModule?.FileName;
}
}
catch (PlatformNotSupportedException)
{
ApplicationUri = string.Empty;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Console/src/System.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
Link="Common\System\Text\ValueStringBuilder.cs" />
</ItemGroup>
<!-- Unix -->
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' and '$(TargetsAndroid)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsAndroid)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="System\ConsolePal.Unix.cs" />
<Compile Include="System\TermInfo.cs" />
<Compile Include="System\IO\StdInReader.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.Data.Odbc/ref/System.Data.Odbc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Data.Odbc.cs" />
<Compile Include="System.Data.Odbc.ODBC32.cs" Condition="!$(TargetFramework.StartsWith('net4'))" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<Reference Include="mscorlib" />
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<NoWarn Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' and '$(TargetsAnyOS)' == 'true'">$(NoWarn);SA1121</NoWarn>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetsAnyOS)' == 'true'">SR.Odbc_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('$(NetCoreAppCurrent)')) or $(TargetFramework.StartsWith('netcoreapp2.0'))" >
<Compile Include="System\Data\Odbc\ODBC32.Common.cs"/>
</ItemGroup>
<ItemGroup Condition="($(TargetFramework.StartsWith('$(NetCoreAppCurrent)')) or $(TargetFramework.StartsWith('netcoreapp2.0'))) and '$(TargetsAnyOS)' != 'true'">
<Compile Include="$(CommonPath)System\Data\Common\AdapterUtil.cs"
Link="Common\System\Data\Common\AdapterUtil.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

namespace System.Data.Odbc
{
// Class needs to be public to support serialization with type forwarding from Desktop to Core.
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public static class ODBC32
public static partial class ODBC32
{
// from .\public\sdk\inc\sqlext.h: and .\public\sdk\inc\sql.h
// must be public because it is serialized by OdbcException
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public enum RETCODE : int
{
Expand Down
16 changes: 1 addition & 15 deletions src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ internal static short ShortStringLength(string inputString)
}
}

// Class needs to be public to support serialization with type forwarding from Desktop to Core.
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public static class ODBC32
public static partial class ODBC32
{
internal enum SQL_HANDLE : short
{
Expand All @@ -134,18 +132,6 @@ internal enum SQL_HANDLE : short
DESC = 4,
}

// from .\public\sdk\inc\sqlext.h: and .\public\sdk\inc\sql.h
// must be public because it is serialized by OdbcException
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public enum RETCODE : int
{ // must be int instead of short for Everett OdbcException Serializablity.
SUCCESS = 0,
SUCCESS_WITH_INFO = 1,
ERROR = -1,
INVALID_HANDLE = -2,
NO_DATA = 100,
}

// must be public because it is serialized by OdbcException
internal enum RetCode : short
{
Expand Down
14 changes: 7 additions & 7 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup Condition=" '$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
<DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetsBrowser)' == 'true'">
<PropertyGroup Condition="'$(TargetsBrowser)' == 'true'">
<DefineConstants>$(DefineConstants);TARGETS_BROWSER</DefineConstants>
</PropertyGroup>
<!-- ILLinker settings -->
Expand Down Expand Up @@ -127,7 +127,7 @@
Link="Common\System\Net\ArrayBuffer.cs"/>
</ItemGroup>
<!-- SocketsHttpHandler implementation -->
<ItemGroup Condition=" '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs" />
Expand Down Expand Up @@ -358,7 +358,7 @@
Link="Common\Interop\FreeBSD\Interop.Libraries.cs" />
</ItemGroup>
<!-- SocketsHttpHandler platform parts -->
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Unix.cs" />
Expand Down Expand Up @@ -387,7 +387,7 @@
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteNegoContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteNegoContext.cs" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Unix.cs" />
</ItemGroup>
Expand Down Expand Up @@ -554,7 +554,7 @@
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs"
Link="Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(CommonPath)System\StrongToWeakReference.cs"
Link="Common\Interop\Unix\StrongToWeakReference.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
Expand Down Expand Up @@ -604,7 +604,7 @@
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Expand Down Expand Up @@ -694,7 +694,7 @@
<Reference Include="System.Threading.Channels" />
<Reference Include="System.IO.Compression.Brotli" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.IO.FileSystem" />
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Net.Mail/src/System.Net.Mail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
Link="Common\System\HexConverter.cs" />
</ItemGroup>
<!-- Unix specific files -->
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(CommonPath)System\Net\ContextAwareResult.Unix.cs"
Link="Common\System\Net\ContextAwareResult.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Unix.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.Threading.Thread" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsLinux)' == 'true' or '$(TargetsBrowser)' == 'true' OR '$(TargetsFreeBSD)' == 'true'">
<ItemGroup Condition="'$(TargetsLinux)' == 'true' or '$(TargetsBrowser)' == 'true' or '$(TargetsFreeBSD)' == 'true'">
<Reference Include="System.Threading.Timer" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace System.Runtime.Caching.Tests
{
// These are the tests to fill in some of the coverage in ported Mono caching tests
[SkipOnMono("MemoryCache is not supported on Browser", TestPlatforms.Browser)]
public class AdditionalCacheTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

namespace MonoTests.System.Runtime.Caching
{
[SkipOnMono("MemoryCache is not supported on Browser", TestPlatforms.Browser)]
public class MemoryCacheTest
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup Condition="'$(TargetsBrowser)' == 'true'">
<Compile Include="System\Runtime\InteropServices\RuntimeInformation\RuntimeInformation.Browser.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="System\Runtime\InteropServices\RuntimeInformation\RuntimeInformation.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetUnixName.cs"
Link="Common\Interop\Unix\System.Native\Interop.GetUnixName.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
<Compile Include="$(CommonPath)System\Security\Cryptography\RSACng.SignVerify.cs"
Link="Common\System\Security\Cryptography\RSACng.SignVerify.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.Nid.cs"
Expand Down Expand Up @@ -560,7 +560,7 @@
<Compile Include="Internal\Cryptography\TripleDesImplementation.OSX.cs" />
<Compile Include="System\Security\Cryptography\ECDiffieHellman.Create.SecurityTransforms.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' and '$(TargetsBrowser)' != 'true'">
<ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Cipher.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Cipher.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs"
Expand Down

0 comments on commit b62b16a

Please sign in to comment.