Skip to content

Commit b27581a

Browse files
Merge pull request #1451 from SixLabors/js/shared-msbuild
Update to use new props/targets plus cleanup.
2 parents 4aed9f4 + 76519a9 commit b27581a

25 files changed

Lines changed: 694 additions & 915 deletions

.editorconfig

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
git fetch --prune --unshallow
5757
git submodule -q update --init --recursive
5858
59-
- name: Setup nuget cache
59+
- name: Setup NuGet Cache
6060
uses: actions/cache@v2
6161
id: nuget-cache
6262
with:

Directory.Build.props

Lines changed: 4 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -10,133 +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>$(SixLaborsProjectCategory)/$(MSBuildProjectName)</BaseArtifactsPathSuffix>
17-
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ImageSharp/</RepositoryUrl>
18-
<RunSettingsFilePath>$(MSBuildThisFileDirectory)/.runsettings</RunSettingsFilePath>
14+
<!-- This MUST be defined before importing props. -->
15+
<SixLaborsSolutionDirectory>$(MSBuildThisFileDirectory)</SixLaborsSolutionDirectory>
1916
</PropertyGroup>
2017

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

14221
</Project>

Directory.Build.targets

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +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" PrivateAssets="All" Version="3.7.0" />
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-
<!--Src Dependencies-->
26-
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
27-
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.1" />
28-
<PackageReference Update="System.Buffers" Version="4.5.1" />
29-
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
30-
<PackageReference Update="System.IO.UnmanagedMemoryStream" Version="4.3.0" />
31-
<PackageReference Update="System.Numerics.Vectors" Version="4.5.0" />
32-
<PackageReference Update="System.Memory" Version="4.5.4" />
33-
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" />
34-
<PackageReference Update="System.Threading.Tasks.Parallel" Version="4.3.0" />
35-
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
36-
37-
</ItemGroup>
13+
<!-- Import the shared global .props file -->
14+
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\targets\SixLabors.Global.targets"/>
3815

3916
</Project>

0 commit comments

Comments
 (0)