Skip to content

Commit

Permalink
Create Common.Build.props for property reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
bothzoli committed May 23, 2024
1 parent 42d9354 commit 71f669c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -1,63 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;net45;net461;netstandard2.0;net5.0;net6.0</TargetFrameworks>
<PackageId>CSharpFunctionalExtensions.StrongName</PackageId>
<Authors>Vladimir Khorikov</Authors>
<Description>CSharpFunctionalExtensions - functional extensions for C#</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>C# Functional</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://enterprisecraftsmanship.com/ps-func</PackageProjectUrl>
<RepositoryUrl>https://github.com/vkhorikov/CSharpFunctionalExtensions/</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<LangVersion>9.0</LangVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<NoWarn>1591;1701;1702</NoWarn>
<AssemblyOriginatorKeyFile>CSharpFunctionalExtensions.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<Import Project="../Common.Build.props"/>

<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 4.5</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net461'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 4.6.1</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET Standard 2.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 5.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 6.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup>
<PackageId>CSharpFunctionalExtensions.StrongName</PackageId>
<AssemblyOriginatorKeyFile>CSharpFunctionalExtensions.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168"/>
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 4.5</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net461'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 4.6.1</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET Standard 2.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net5.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 5.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<AssemblyTitle>CSharpFunctionalExtensions (with a strong name) .NET 6.0</AssemblyTitle>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168"/>
</ItemGroup>

<ItemGroup Condition="!$(DefineConstants.Contains('NET5_0_OR_GREATER')) and !$(DefineConstants.Contains('NETCORE'))">
<EmbeddedResource Remove="Result\Json\Serialization\**" />
<None Remove="Result\Json\Serialization\**" />
<Compile Include="..\CSharpFunctionalExtensions\**\*.cs"
Exclude="..\CSharpFunctionalExtensions\obj\**\*.cs;..\CSharpFunctionalExtensions\Result\Json\Serialization\**"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="$(DefineConstants.Contains('NET5_0_OR_GREATER')) or $(DefineConstants.Contains('NETCORE'))">
<Compile Include="..\CSharpFunctionalExtensions\**\*.cs" Exclude="..\CSharpFunctionalExtensions\obj\**\*.cs"/>
</ItemGroup>
<ItemGroup Condition="!$(DefineConstants.Contains('NET5_0_OR_GREATER')) and !$(DefineConstants.Contains('NETCORE'))">
<EmbeddedResource Remove="Result\Json\Serialization\**"/>
<None Remove="Result\Json\Serialization\**"/>
<Compile Include="..\CSharpFunctionalExtensions\**\*.cs"
Exclude="..\CSharpFunctionalExtensions\obj\**\*.cs;..\CSharpFunctionalExtensions\Result\Json\Serialization\**"/>
</ItemGroup>

<ItemGroup Condition="$(DefineConstants.Contains('NET5_0_OR_GREATER')) or $(DefineConstants.Contains('NETCORE'))">
<Compile Include="..\CSharpFunctionalExtensions\**\*.cs" Exclude="..\CSharpFunctionalExtensions\obj\**\*.cs"/>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions CSharpFunctionalExtensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Dockerfile = Dockerfile
README.md = README.md
version.txt = version.txt
Common.Build.props = Common.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpFunctionalExtensions.StrongName", "CSharpFunctionalExtensions.StrongName\CSharpFunctionalExtensions.StrongName.csproj", "{A86176EF-DCC2-44E5-8F0F-D5F58006DEBB}"
Expand Down
39 changes: 12 additions & 27 deletions CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Common.Build.props"/>

<PropertyGroup>
<TargetFrameworks>net40;net45;net461;netstandard2.0;net5.0;net6.0</TargetFrameworks>
<PackageId>CSharpFunctionalExtensions</PackageId>
<Authors>Vladimir Khorikov</Authors>
<Description>CSharpFunctionalExtensions - functional extensions for C#</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>C# Functional</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://enterprisecraftsmanship.com/ps-func</PackageProjectUrl>
<RepositoryUrl>https://github.com/vkhorikov/CSharpFunctionalExtensions/</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<LangVersion>9.0</LangVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<NoWarn>1591;1701;1702</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
Expand All @@ -38,14 +23,14 @@

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>CSharpFunctionalExtensions.Tests</_Parameter1>
<_Parameter1>CSharpFunctionalExtensions.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168" />
<PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -54,9 +39,9 @@
</ItemGroup>

<ItemGroup Condition="!$(DefineConstants.Contains('NET5_0_OR_GREATER')) and !$(DefineConstants.Contains('NETCORE'))">
<Compile Remove="Result\Json\Serialization\**" />
<EmbeddedResource Remove="Result\Json\Serialization\**" />
<None Remove="Result\Json\Serialization\**" />
<Compile Remove="Result\Json\Serialization\**"/>
<EmbeddedResource Remove="Result\Json\Serialization\**"/>
<None Remove="Result\Json\Serialization\**"/>
<Compile Update="Result\Methods\Extensions\BindIf.Task.cs">
<DependentUpon>BindIf.cs</DependentUpon>
</Compile>
Expand Down Expand Up @@ -118,13 +103,13 @@
<DependentUpon>GetValueOrDefault.cs</DependentUpon>
</Compile>
<Compile Update="Maybe\Extensions\Map.Task.cs">
<DependentUpon>Map.cs</DependentUpon>
<DependentUpon>Map.cs</DependentUpon>
</Compile>
<Compile Update="Maybe\Extensions\AsMaybe.Task.cs">
<DependentUpon>AsMaybe.cs</DependentUpon>
<DependentUpon>AsMaybe.cs</DependentUpon>
</Compile>
<Compile Update="Maybe\Extensions\AsMaybe.ValueTask.cs">
<DependentUpon>AsMaybe.cs</DependentUpon>
<DependentUpon>AsMaybe.cs</DependentUpon>
</Compile>
<Compile Update="Result\Methods\Extensions\MapIf.Task.cs">
<DependentUpon>MapIf.cs</DependentUpon>
Expand Down Expand Up @@ -664,7 +649,7 @@
<DependentUpon>MapTry.ValueTask.cs</DependentUpon>
</Compile>
<Compile Update="Result\Methods\Extensions\GetValueOrDefault.Task.cs">
<DependentUpon>GetValueOrDefault.cs</DependentUpon>
<DependentUpon>GetValueOrDefault.cs</DependentUpon>
</Compile>
<Compile Update="Result\Methods\Extensions\GetValueOrDefault.Task.Right.cs">
<DependentUpon>GetValueOrDefault.Task.cs</DependentUpon>
Expand Down
21 changes: 21 additions & 0 deletions Common.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net40;net45;net461;netstandard2.0;net5.0;net6.0</TargetFrameworks>
<Authors>Vladimir Khorikov</Authors>
<Description>CSharpFunctionalExtensions - functional extensions for C#</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>C# Functional</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://enterprisecraftsmanship.com/ps-func</PackageProjectUrl>
<RepositoryUrl>https://github.com/vkhorikov/CSharpFunctionalExtensions/</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<LangVersion>9.0</LangVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<NoWarn>1591;1701;1702</NoWarn>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/sdk:6.0 as build
ARG Version
WORKDIR /app

COPY ./Common.Build.props ./
COPY ./CSharpFunctionalExtensions/CSharpFunctionalExtensions.csproj ./CSharpFunctionalExtensions/
COPY ./CSharpFunctionalExtensions.StrongName/CSharpFunctionalExtensions.StrongName.csproj ./CSharpFunctionalExtensions.StrongName/
COPY ./CSharpFunctionalExtensions.Tests/CSharpFunctionalExtensions.Tests.csproj ./CSharpFunctionalExtensions.Tests/
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ stages:
- job: BuildAndTest
displayName: Build and test
dependsOn: Version
condition: succeeded('Version')
variables:
newVersion: $[ dependencies.Version.outputs['readNewVersionStep.newVersion'] ]
steps:
Expand Down Expand Up @@ -77,7 +78,7 @@ stages:
contentTypeHeader2: 'Content-Type: application/octet-stream'
authHeader: 'Authorization: Bearer $(gitHubToken)'
createReleaseRequest: '{ "tag_name": "v$(newVersion)", "target_commitish": "master", "name": "v$(newVersion)", "body": "$(releaseInfo)", "draft": false, "prerelease": false }'
condition: ne(dependencies.Version.outputs['readNewVersionStep.newVersion'], dependencies.Version.outputs['readCurrentVersionStep.currentVersion'])
condition: and(succeeded('Version'), succeeded('BuildAndTest'), ne(dependencies.Version.outputs['readNewVersionStep.newVersion'], dependencies.Version.outputs['readCurrentVersionStep.currentVersion']))
steps:
- script: |
echo $(newVersion)
Expand Down

0 comments on commit 71f669c

Please sign in to comment.