Skip to content

Commit ab51be9

Browse files
Merge pull request #111 from SixLabors/js/shared-props-targets
Use Shared props/targets
2 parents 3d737b5 + f9b7929 commit ab51be9

132 files changed

Lines changed: 2422 additions & 2722 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 404 additions & 340 deletions
Large diffs are not rendered by default.

.gitattributes

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,26 @@
9696
*.gif binary
9797
*.jpg binary
9898
*.ktx binary
99+
*.otf binary
99100
*.pbm binary
100101
*.pdf binary
101102
*.png binary
102103
*.ppt binary
103104
*.pptx binary
104105
*.pvr binary
105-
*.ttf binary
106106
*.snk binary
107107
*.tga binary
108+
*.tif binary
109+
*.tiff binary
110+
*.ttc binary
108111
*.ttf binary
112+
*.wbmp binary
113+
*.webp binary
109114
*.woff binary
110115
*.woff2 binary
111116
*.xls binary
112117
*.xlsx binary
113118

114-
115119
###############################################################################
116120
# Set explicit file behavior to:
117121
# diff as plain text

.github/workflows/build-and-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
framework: netcoreapp3.1
2020
runtime: -x64
2121
codecov: false
22+
- os: macos-latest
23+
framework: netcoreapp3.1
24+
runtime: -x64
25+
codecov: false
2226
- os: windows-latest
2327
framework: netcoreapp3.1
2428
runtime: -x64
@@ -53,6 +57,14 @@ jobs:
5357
git fetch --prune --unshallow
5458
git submodule -q update --init --recursive
5559
60+
- name: Setup NuGet Cache
61+
uses: actions/cache@v2
62+
id: nuget-cache
63+
with:
64+
path: ~/.nuget
65+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
66+
restore-keys: ${{ runner.os }}-nuget-
67+
5668
- name: Build
5769
shell: pwsh
5870
run: ./ci-build.ps1 "${{matrix.options.framework}}"
@@ -64,6 +76,13 @@ jobs:
6476
CI: True
6577
XUNIT_PATH: .\tests\ImageSharp.Drawing.Tests # Required for xunit
6678

79+
- name: Store Output Images after failed tests
80+
uses: actions/upload-artifact@v2
81+
if: failure()
82+
with:
83+
name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip
84+
path: tests/Images/ActualOutput/
85+
6786
- name: Update Codecov
6887
uses: codecov/codecov-action@v1
6988
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')

Directory.Build.props

Lines changed: 4 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -10,106 +10,12 @@
1010
that is done by the file that imports us.
1111
-->
1212

13-
<!-- Default settings that are used by other settings -->
1413
<PropertyGroup>
15-
<BaseArtifactsPath>$(MSBuildThisFileDirectory)artifacts/</BaseArtifactsPath>
16-
<BaseArtifactsPathSuffix>$(ImageSharpProjectCategory)/$(MSBuildProjectName)</BaseArtifactsPathSuffix>
17-
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ImageSharp.Drawing/</RepositoryUrl>
14+
<!-- This MUST be defined before importing props. -->
15+
<SixLaborsSolutionDirectory>$(MSBuildThisFileDirectory)</SixLaborsSolutionDirectory>
1816
</PropertyGroup>
1917

20-
<!-- Default settings that explicitly differ from the Sdk.props defaults -->
21-
<PropertyGroup>
22-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
23-
<DebugType>portable</DebugType>
24-
<DebugType Condition="'$(codecov)' != ''">full</DebugType>
25-
<NullableContextOptions>disable</NullableContextOptions>
26-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
27-
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
28-
</PropertyGroup>
29-
30-
<!--
31-
https://apisof.net/
32-
+===================+=======+==========+=====================+=============+=================+====================+==============+
33-
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE |
34-
+===================+=======+==========+=====================+=============+=================+====================+==============+
35-
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y |
36-
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y |
37-
| netcoreapp2.0 | Y | N | N | N | N | N | Y |
38-
| netstandard2.1 | Y | Y | N | Y | Y | N | Y |
39-
| netstandard2.0 | N | N | N | N | N | N | Y |
40-
| netstandard1.3 | N | N | N | N | N | N | N |
41-
| net472 | N | N | Y | N | N | N | Y |
42-
+===================+=======+==========+=====================+=============+=================+====================+==============+
43-
-->
44-
45-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
46-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
47-
</PropertyGroup>
48-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
49-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
50-
</PropertyGroup>
51-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
52-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE</DefineConstants>
53-
</PropertyGroup>
54-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
55-
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
56-
</PropertyGroup>
57-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
58-
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
59-
</PropertyGroup>
60-
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
61-
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
62-
</PropertyGroup>
63-
64-
<!-- Default settings that explicitly differ from the Sdk.targets defaults-->
65-
<PropertyGroup>
66-
<Authors>Six Labors and contributors</Authors>
67-
<Company>Six Labors</Company>
68-
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(BaseArtifactsPathSuffix)/$(Configuration)/</PackageOutputPath>
69-
<Product>SixLabors.ImageSharp.Drawing</Product>
70-
<VersionPrefix>0.0.1</VersionPrefix>
71-
<VersionPrefix Condition="'$(packageversion)' != ''">$(PackageVersion)</VersionPrefix>
72-
<VersionSuffix></VersionSuffix>
73-
</PropertyGroup>
74-
75-
<!--MinVer Properties for versioning-->
76-
<PropertyGroup>
77-
<MinVerTagPrefix>v</MinVerTagPrefix>
78-
<MinVerVerbosity>normal</MinVerVerbosity>
79-
</PropertyGroup>
80-
81-
<!-- Default settings that are otherwise undefined -->
82-
<PropertyGroup>
83-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)shared-infrastructure/SixLabors.snk</AssemblyOriginatorKeyFile>
84-
<Copyright>Copyright © Six Labors and Contributors</Copyright>
85-
<Features>strict;IOperation</Features>
86-
<HighEntropyVA>true</HighEntropyVA>
87-
<LangVersion>8.0</LangVersion>
88-
<NeutralLanguage>en</NeutralLanguage>
89-
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
90-
<PackageIcon>sixlabors.imagesharp.drawing.128.png</PackageIcon>
91-
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
92-
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
93-
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
94-
<RepositoryType>git</RepositoryType>
95-
<RestoreSources>
96-
https://www.myget.org/F/sixlabors/api/v3/index.json;
97-
https://api.nuget.org/v3/index.json;
98-
</RestoreSources>
99-
<SixLaborsPublicKey>00240000048000009400000006020000002400005253413100040000010001000147e6fe6766715eec6cfed61f1e7dcdbf69748a3e355c67e9d8dfd953acab1d5e012ba34b23308166fdc61ee1d0390d5f36d814a6091dd4b5ed9eda5a26afced924c683b4bfb4b3d64b0586a57eff9f02b1f84e3cb0ddd518bd1697f2c84dcbb97eb8bb5c7801be12112ed0ec86db934b0e9a5171e6bb1384b6d2f7d54dfa97</SixLaborsPublicKey>
100-
<UseSharedCompilation>true</UseSharedCompilation>
101-
<SignAssembly>true</SignAssembly>
102-
</PropertyGroup>
103-
104-
<!-- Package references and additional files which are consumed by all projects -->
105-
<ItemGroup>
106-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" IsImplicitlyDefined="true" />
107-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" IsImplicitlyDefined="true" />
108-
<!--TODO: Enable this once tests Stylecop issues are fixed-->
109-
<!--<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />-->
110-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)shared-infrastructure\stylecop.json" />
111-
<!--NuGet package icon source-->
112-
<None Include="$(MSBuildThisFileDirectory)shared-infrastructure\branding\icons\imagesharp.drawing\sixlabors.imagesharp.drawing.128.png" Pack="true" PackagePath="" />
113-
</ItemGroup>
18+
<!-- Import the shared global .props file -->
19+
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\props\SixLabors.Global.props" />
11420

11521
</Project>

Directory.Build.targets

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,12 @@
55
Directory.Build.targets is automatically picked up and imported by
66
Microsoft.Common.targets. This file needs to exist, even if empty so that
77
files in the parent directory tree, with the same name, are not imported
8-
instead. The import fairly late and most other props/targets will have been
8+
instead. They import fairly late and most other props/targets will have been
99
imported beforehand. We also don't need to add ourselves to
1010
MSBuildAllProjects, as that is done by the file that imports us.
1111
-->
1212

13-
<!-- Settings that append the existing setting value -->
14-
<PropertyGroup>
15-
<DefineConstants>$(DefineConstants);$(OS)</DefineConstants>
16-
</PropertyGroup>
17-
18-
<!-- Package versions for package references across all projects -->
19-
<ItemGroup>
20-
<!--Global Dependencies-->
21-
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="3.3.1" PrivateAssets="All" />
22-
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
23-
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
24-
25-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
26-
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.0" />
27-
28-
<!--Src Dependencies-->
29-
<PackageReference Update="SixLabors.Fonts" Version="1.0.0-beta0013" />
30-
<PackageReference Update="SixLabors.ImageSharp" Version="1.0.2" />
31-
</ItemGroup>
13+
<!-- Import the shared global .props file -->
14+
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\targets\SixLabors.Global.targets"/>
3215

3316
</Project>

ImageSharp.Drawing.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.28902.138
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
77
ProjectSection(SolutionItems) = preProject
88
.editorconfig = .editorconfig
99
.gitattributes = .gitattributes
@@ -352,6 +352,7 @@ Global
352352
HideSolutionNode = FALSE
353353
EndGlobalSection
354354
GlobalSection(NestedProjects) = preSolution
355+
{1799C43E-5C54-4A8F-8D64-B1475241DB0D} = {C317F1B1-D75E-4C6D-83EB-80367343E0D7}
355356
{FBE8C1AD-5AEC-4514-9B64-091D8E145865} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D}
356357
{2E33181E-6E28-4662-A801-E2E7DC206029} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
357358
{FA55F5DE-11A6-487D-ABA4-BC93A02717DD} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}

src/Directory.Build.props

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,23 @@
55
Directory.Build.props is automatically picked up and imported by
66
Microsoft.Common.props. This file needs to exist, even if empty so that
77
files in the parent directory tree, with the same name, are not imported
8-
instead. The import fairly early and only Sdk.props will have been
8+
instead. They import fairly early and only Sdk.props will have been
99
imported beforehand. We also don't need to add ourselves to
1010
MSBuildAllProjects, as that is done by the file that imports us.
1111
-->
1212

13-
<PropertyGroup>
14-
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
15-
<ImageSharpProjectCategory>src</ImageSharpProjectCategory>
16-
</PropertyGroup>
13+
<!-- Import the shared src .props file -->
14+
<Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\props\SixLabors.Src.props" />
1715

16+
<!-- Import the solution .props file. -->
1817
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
1918

20-
<PropertyGroup>
21-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.ruleset</CodeAnalysisRuleSet>
22-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
23-
</PropertyGroup>
24-
19+
<!-- Compilation properties. -->
2520
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
2621
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2722
</PropertyGroup>
2823

29-
<!--Add deterministic builds in CI-->
30-
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
31-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
32-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
33-
</PropertyGroup>
34-
35-
<PropertyGroup>
36-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
37-
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
38-
<IncludeSymbols>true</IncludeSymbols>
39-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
40-
</PropertyGroup>
41-
4224
<ItemGroup>
43-
<!--TODO: Delete this once tests Stylecop issues are fixed-->
44-
<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />
45-
4625
<!-- DynamicProxyGenAssembly2 is needed so Moq can use our internals -->
4726
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7" />
4827
<InternalsVisibleTo Include="SixLabors.ImageSharp.Tests" Key="$(SixLaborsPublicKey)" />

src/Directory.Build.targets

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,15 @@
55
Directory.Build.targets is automatically picked up and imported by
66
Microsoft.Common.targets. This file needs to exist, even if empty so that
77
files in the parent directory tree, with the same name, are not imported
8-
instead. The import fairly late and most other props/targets will have
8+
instead. They import fairly late and most other props/targets will have
99
been imported beforehand. We also don't need to add ourselves to
1010
MSBuildAllProjects, as that is done by the file that imports us.
1111
-->
1212

13-
<PropertyGroup>
14-
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
15-
</PropertyGroup>
13+
<!-- Import the shared src .targets file -->
14+
<Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\targets\SixLabors.Src.targets" />
1615

16+
<!-- Import the solution .targets file. -->
1717
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
1818

19-
<PropertyGroup>
20-
<GeneratedInternalsVisibleToFile Condition="'$(GeneratedInternalsVisibleToFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
21-
</PropertyGroup>
22-
23-
<!-- Workaround for running Coverlet with Determenistic builds -->
24-
<!-- https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/DeterministicBuild.md -->
25-
<Target Name="CoverletGetPathMap"
26-
DependsOnTargets="InitializeSourceRootMappedPaths"
27-
Returns="@(_LocalTopLevelSourceRoot)"
28-
Condition="'$(DeterministicSourcePaths)' == 'true'">
29-
<ItemGroup>
30-
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
31-
</ItemGroup>
32-
</Target>
33-
34-
<ItemDefinitionGroup>
35-
<InternalsVisibleTo>
36-
<Visible>false</Visible>
37-
</InternalsVisibleTo>
38-
</ItemDefinitionGroup>
39-
40-
<Target Name="GenerateInternalsVisibleTo"
41-
BeforeTargets="CoreCompile"
42-
DependsOnTargets="PrepareForBuild;CoreGenerateInternalsVisibleTo"
43-
Condition="'@(InternalsVisibleTo)' != ''" />
44-
45-
<Target Name="CoreGenerateInternalsVisibleTo"
46-
Condition="'$(Language)' == 'VB' or '$(Language)' == 'C#'"
47-
Inputs="$(MSBuildAllProjects)"
48-
Outputs="$(GeneratedInternalsVisibleToFile)">
49-
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute" AdditionalMetadata="_Parameter1=%(InternalsVisibleTo.Identity)" Condition="'%(InternalsVisibleTo.Key)' == ''">
50-
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
51-
</CreateItem>
52-
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute" AdditionalMetadata="_Parameter1=%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key)" Condition="'%(InternalsVisibleTo.Key)' != ''">
53-
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
54-
</CreateItem>
55-
56-
<WriteCodeFragment AssemblyAttributes="@(InternalsVisibleToAttribute)" Language="$(Language)" OutputFile="$(GeneratedInternalsVisibleToFile)">
57-
<Output TaskParameter="OutputFile" ItemName="Compile" />
58-
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
59-
</WriteCodeFragment>
60-
</Target>
61-
62-
<!-- Empty target so that `dotnet test` will work on the solution -->
63-
<!-- https://github.com/Microsoft/vstest/issues/411 -->
64-
<Target Name="VSTest" Condition="'$(IsTestProject)' == 'true'"/>
65-
6619
</Project>

0 commit comments

Comments
 (0)