Skip to content

Commit a49ebb0

Browse files
Merge pull request #1133 from SixLabors/sp/text-segment-initialization
Text segment ReadOnlySpan<byte> initialization
2 parents a9e10e2 + 20bf5fa commit a49ebb0

File tree

25 files changed

+1357
-106
lines changed

25 files changed

+1357
-106
lines changed

.editorconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ csharp_style_throw_expression = true:suggestion
368368
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
369369
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
370370

371-
csharp_style_var_for_built_in_types = false:silent
371+
csharp_style_var_for_built_in_types = never
372372
csharp_style_var_when_type_is_apparent = true:warning
373373
csharp_style_var_elsewhere = false:warning
374-
375-
csharp_prefer_simple_using_statement = false:silent

ImageSharp.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Tests.ProfilingS
334334
EndProject
335335
Global
336336
GlobalSection(SharedMSBuildProjectFiles) = preSolution
337+
shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{2aa31a1f-142c-43f4-8687-09abca4b3a26}*SharedItemsImports = 5
337338
shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13
338339
EndGlobalSection
339340
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@
3434
<InternalsVisibleTo Include="SixLabors.ImageSharp.Tests" PublicKey="$(SixLaborsPublicKey)" />
3535
</ItemGroup>
3636

37+
38+
3739
</Project>

src/Directory.Build.targets

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,37 @@
5252
<!-- https://github.com/Microsoft/vstest/issues/411 -->
5353
<Target Name="VSTest" Condition="'$(IsTestProject)' == 'true'"/>
5454

55+
<ItemGroup>
56+
<!--Shared config files that have to exist at root level.-->
57+
<ConfigFilesToCopy Include="..\..\shared-infrastructure\.editorconfig;..\..\shared-infrastructure\.gitattributes" />
58+
<!--
59+
Copy submodule files generated via T4 templates.
60+
We cannot include the generated files in the submodule as any solution wide T4 regeneration
61+
could potentially cause the module to be marked dirty which is a headache.
62+
This, instead, combined with using 'Compile Update' over 'Include' allows us to copy the file
63+
across from the submodule and place it directly in the src folder for compilation.
64+
-->
65+
<SubmoduleSourceFilesToCopy Include="..\..\shared-infrastructure\src\SharedInfrastructure\Guard.Numeric.cs" />
66+
</ItemGroup>
67+
68+
<!--Ensures our config files are up to date.-->
69+
<Target Name="CopyFiles" BeforeTargets="Build">
70+
<Copy SourceFiles="@(ConfigFilesToCopy)"
71+
SkipUnchangedFiles = "true"
72+
DestinationFolder="..\..\" />
73+
74+
<Copy SourceFiles="@(SubmoduleSourceFilesToCopy)"
75+
DestinationFolder="..\..\src\ImageSharp\Common\Helpers"
76+
SkipUnchangedFiles="true"
77+
ContinueOnError="true" />
78+
</Target>
79+
80+
<!-- Allows regenerating T4-generated files at build time using MsBuild -->
81+
<!-- Enable on Windows OS to build all T4 templates. TODO: XPlat
82+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
83+
<PropertyGroup>
84+
<TransformOnBuild>true</TransformOnBuild>
85+
</PropertyGroup>
86+
-->
87+
5588
</Project>

src/ImageSharp/Common/Extensions/StreamExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
// Licensed under the Apache License, Version 2.0.
33

44
using System;
5-
using System.Buffers;
65
using System.IO;
76
using SixLabors.ImageSharp.Memory;
7+
#if !SUPPORTS_SPAN_STREAM
8+
using System.Buffers;
9+
#endif
810

911
namespace SixLabors.ImageSharp
1012
{

0 commit comments

Comments
 (0)