Skip to content

Commit

Permalink
Reduce size of AnyOS binaries with required String extracted (#1225)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra authored Aug 24, 2021
1 parent 369314d commit 74ffd8b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AssemblyName>Microsoft.Data.SqlClient</AssemblyName>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition="$(ReferenceType)=='NetStandard' AND $(TargetNetStandardVersion)=='netstandard2.1'">netstandard2.1</TargetFrameworks>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(OSGroup)' == 'AnyOS'">Strings.PlatformNotSupported_DataSqlClient</GeneratePlatformNotSupportedAssemblyMessage>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(OSGroup)' == 'AnyOS'">Microsoft.Data.SqlClient is not supported on this platform.</GeneratePlatformNotSupportedAssemblyMessage>
<OSGroup Condition="'$(OSGroup)' == ''">$(OS)</OSGroup>
<TargetsWindows Condition="'$(OSGroup)'=='Windows_NT'">true</TargetsWindows>
<TargetsUnix Condition="'$(OSGroup)'=='Unix'">true</TargetsUnix>
Expand Down Expand Up @@ -402,8 +402,18 @@
<Compile Include="Microsoft\Data\SqlClient\SimulatorEnclaveProvider.NetCoreApp.cs" />
</ItemGroup>
<ItemGroup Condition="'$(OSGroup)' != 'AnyOS'">
<Compile Include="Microsoft\Data\SqlClient\AAsyncCallContext.cs" />
<Compile Include="Resources\StringsHelper.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<CustomToolNamespace>System</CustomToolNamespace>
</EmbeddedResource>
<Compile Include="Microsoft\Data\SqlClient\AAsyncCallContext.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\MetadataUtilsSmi.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\SmiEventSink.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\SmiEventSink_Default.cs" />
Expand Down Expand Up @@ -832,13 +842,6 @@
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Memory" />
</ItemGroup>
<ItemGroup>
<Compile Include="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Microsoft.Data.SqlClient.SqlMetaData.xml">
<LogicalName>Microsoft.Data.SqlClient.SqlMetaData.xml</LogicalName>
Expand Down Expand Up @@ -869,13 +872,6 @@
<PackageReference Include="System.Security.Cryptography.Cng" Version="$(SystemSecurityCryptographyCngVersion)" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
<CustomToolNamespace>System</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(ToolsDir)targets\GenerateThisAssemblyCs.targets" />
<Import Project="$(ToolsDir)targets\ResolveContract.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
<Import Project="$(ToolsDir)targets\NotSupported.targets" Condition="'$(OSGroup)' == 'AnyOS'" />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,6 @@
<data name="LocalDBNotSupported" xml:space="preserve">
<value>LocalDB is not supported on this platform.</value>
</data>
<data name="PlatformNotSupported_DataSqlClient" xml:space="preserve">
<value>Microsoft.Data.SqlClient is not supported on this platform.</value>
</data>
<data name="SqlParameter_InvalidTableDerivedPrecisionForTvp" xml:space="preserve">
<value>Precision '{0}' required to send all values in column '{1}' exceeds the maximum supported precision '{2}'. The values must all fit in a single precision.</value>
</data>
Expand Down

0 comments on commit 74ffd8b

Please sign in to comment.