Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit bcf30ec

Browse files
committed
Refector to use common Directory.Build.props + SourceLink + Embedded .pdbs
1 parent 2b796e5 commit bcf30ec

10 files changed

Lines changed: 134 additions & 111 deletions

File tree

NuGet/NuGetPack.cmd

Lines changed: 0 additions & 2 deletions
This file was deleted.

NuGet/NuGetPush.cmd

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/build.bat

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
22

3-
%MSBUILD% build.proj /target:Default;NuGetPack /property:Configuration=Release;MinorVersion=1;PatchVersion=0
4-
5-
msbuild /p:Configuration=Release ..\src\ServiceStack.Redis.sln
3+
%MSBUILD% build.proj /property:Configuration=Release;MinorVersion=4;PatchVersion=1

build/build.proj

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Default"
3-
xmlns='http://schemas.microsoft.com/developer/msbuild/2003' ToolsVersion="4.0">
3+
xmlns='http://schemas.microsoft.com/developer/msbuild/2003' ToolsVersion="4.0">
44
<Import Project="$(MSBuildProjectDirectory)/build.tasks" />
55

66
<PropertyGroup>
@@ -17,80 +17,68 @@
1717
<NuGetPackageDir>$(BuildSolutionDir)/NuGet/</NuGetPackageDir>
1818
<Version>$(MajorVersion).$(MinorVersion).$(PatchVersion).0</Version>
1919
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion>
20+
<EnvVersion>$(MajorVersion).$(MinorVersion)$(PatchVersion)</EnvVersion>
2021
</PropertyGroup>
2122

22-
<ItemGroup>
23-
<NugetPackageFilesToDelete Include="$(NuGetPackageDir)/*.nupkg"/>
24-
</ItemGroup>
25-
2623
<PropertyGroup>
2724
<DoBuildSolutionsDependsOn>
2825
BeforeBuildSolutions;
2926
BuildSolutions
3027
</DoBuildSolutionsDependsOn>
3128
</PropertyGroup>
3229

33-
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)" />
34-
35-
<Target Name="TeamCityBuild">
36-
<CallTarget Targets="UpdateVersion" />
37-
<CallTarget Targets="Default" />
38-
</Target>
39-
4030
<Target Name="BeforeBuildSolutions">
4131
<Message Text="*****Before building solution*****" Importance="high"/>
4232
<CallTarget Targets="UpdateVersion" />
4333
</Target>
4434

4535
<Target Name="BuildSolutions">
36+
<ItemGroup>
37+
<NugetPackageFilesToDelete Include="$(NuGetPackageDir)/*.nupkg"/>
38+
</ItemGroup>
39+
<Delete Files="@(NugetPackageFilesToDelete)" />
40+
<CallTarget Targets="ClearNuGetRestoreCaches" />
41+
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Redis.sln" Targets="Restore" />
42+
4643
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Redis.sln" Targets="Build"
47-
Properties="Configuration=$(Configuration)" />
44+
Properties="Configuration=$(Configuration)" />
45+
</Target>
46+
47+
<!-- need to remove old caches from nuget restore from .Core csproj's -->
48+
<Target Name="ClearNuGetRestoreCaches">
49+
<RemoveDir Directories="$(SrcDir)/ServiceStack.Redis/obj" />
4850
</Target>
4951

5052
<Target Name="UpdateVersion">
53+
<!-- Update Version -->
5154
<ItemGroup>
52-
<RegexTransform Include="$(SrcDir)/**/AssemblyInfo.cs">
53-
<Find>AssemblyFileVersion\(\"\d+\.\d+\.\d+\.\d+\"\)</Find>
54-
<ReplaceWith>AssemblyFileVersion("$(Version)")</ReplaceWith>
55-
</RegexTransform>
56-
<!--Update Min Dependency Version -->
57-
<RegexTransform Include="$(NuGetPackageDir)/**/*.nuspec">
58-
<Find>version="5\.[^"]*"</Find>
59-
<ReplaceWith>version="$(PackageVersion)"</ReplaceWith>
55+
<RegexTransform Include="$(BuildSolutionDir)/src/Directory.Build.props">
56+
<Find>&lt;Version&gt;[^&lt;]*</Find>
57+
<ReplaceWith>&lt;Version&gt;$(PackageVersion)</ReplaceWith>
6058
</RegexTransform>
6159
</ItemGroup>
6260

6361
<RegexTransform Items="@(RegexTransform)" />
6462
</Target>
6563

66-
<Target Name="NuGetPack">
67-
<Delete Files="@(NugetPackageFilesToDelete)" />
68-
69-
<ItemGroup>
70-
<RedisFiles Include="$(SrcDir)/ServiceStack.Redis/bin/$(Configuration)/net45/ServiceStack.Redis.*"></RedisFiles>
71-
<RedisCoreFiles Include="$(SrcDir)/ServiceStack.Redis/bin/$(Configuration)/netstandard2.0/ServiceStack.Redis.*"></RedisCoreFiles>
72-
</ItemGroup>
64+
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)">
7365

66+
<!-- ServiceStack.Redis -->
7467
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Redis/ServiceStack.Redis.csproj"
75-
Targets="Build"
76-
Properties="Version=$(PackageVersion);Configuration=$(Configuration)" />
77-
78-
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Redis/lib/net45" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Redis/lib/net45')" />
79-
<Copy SourceFiles="%(RedisFiles.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Redis/lib/net45" />
80-
81-
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Redis/lib/netstandard2.0" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Redis/lib/netstandard2.0')" />
82-
<Copy SourceFiles="%(RedisCoreFiles.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Redis/lib/netstandard2.0" />
83-
84-
<Exec Command="&quot;$(NuGetPath)&quot; pack &quot;$(NuGetPackageDir)/ServiceStack.Redis/servicestack.redis.nuspec&quot; -OutputDirectory &quot;$(NuGetPackageDir)&quot; -Version $(PackageVersion) -Symbols"
85-
LogStandardErrorAsError="true" />
68+
Targets="Build;Pack"
69+
Properties="Configuration=$(Configuration)" />
8670

8771
<!-- ServiceStack.Redis.Core -->
72+
<CallTarget Targets="ClearNuGetRestoreCaches" />
73+
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Redis/ServiceStack.Redis.Core.csproj" Targets="Restore" />
74+
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.Redis/ServiceStack.Redis.Core.csproj"
75+
Targets="Build;Pack"
76+
Properties="Configuration=$(Configuration)" />
8877

89-
<MakeDir Directories="$(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard2.0" Condition="!Exists('$(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard2.0')" />
90-
<Copy SourceFiles="%(RedisCoreFiles.Identity)" DestinationFolder="$(NuGetPackageDir)/ServiceStack.Redis.Core/lib/netstandard2.0" />
91-
92-
<Exec Command="&quot;$(NuGetPath)&quot; pack &quot;$(NuGetPackageDir)/ServiceStack.Redis.Core/servicestack.redis.core.nuspec&quot; -OutputDirectory &quot;$(NuGetPackageDir)&quot; -Version $(PackageVersion) -Symbols"
93-
LogStandardErrorAsError="true" />
78+
<ItemGroup>
79+
<NugetPackagesToMove Include="$(BuildSolutionDir)/src/**/bin/$(Configuration)/*.nupkg"/>
80+
</ItemGroup>
81+
<Move SourceFiles="@(NugetPackagesToMove)" DestinationFolder="$(NuGetPackageDir)" />
9482

9583
</Target>
9684
</Project>

src/Directory.Build.props

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<Version>5.0.0</Version>
5+
<Authors>ServiceStack</Authors>
6+
<Company>ServiceStack, Inc.</Company>
7+
<Copyright>&#169; 2008-2018 ServiceStack, Inc</Copyright>
8+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
9+
<PackageProjectUrl>https://github.com/ServiceStack/ServiceStack.Redis</PackageProjectUrl>
10+
<PackageLicenseUrl>https://servicestack.net/terms</PackageLicenseUrl>
11+
<PackageIconUrl>https://servicestack.net/img/logo-64.png</PackageIconUrl>
12+
<PackageReleaseNotes>https://docs.servicestack.net/release-notes-history</PackageReleaseNotes>
13+
<RepositoryType>git</RepositoryType>
14+
<RepositoryUrl>https://github.com/ServiceStack/ServiceStack.Redis.git</RepositoryUrl>
15+
<DebugType>embedded</DebugType>
16+
<LangVersion>latest</LangVersion>
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
19+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
20+
</PropertyGroup>
21+
22+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
23+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
24+
<Optimize>true</Optimize>
25+
</PropertyGroup>
26+
27+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
28+
<DefineConstants>$(DefineConstants);NET45</DefineConstants>
29+
<SignAssembly>True</SignAssembly>
30+
<DelaySign>False</DelaySign>
31+
<AssemblyOriginatorKeyFile>../servicestack.snk</AssemblyOriginatorKeyFile>
32+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
33+
</PropertyGroup>
34+
35+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
36+
<DefineConstants>$(DefineConstants);NETSTANDARD2_0</DefineConstants>
37+
</PropertyGroup>
38+
39+
<ItemGroup>
40+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>
41+
</ItemGroup>
42+
43+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
44+
<DefineConstants>DEBUG</DefineConstants>
45+
</PropertyGroup>
46+
47+
</Project>

src/NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="ServiceStack CI feed" value="http://build.servicestack.net/guestAuth/app/nuget/v1/FeedService.svc" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

src/ServiceStack.Redis.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{38F69F8F
1212
..\README.md = ..\README.md
1313
..\NuGet\ServiceStack.Redis.Core\servicestack.redis.core.nuspec = ..\NuGet\ServiceStack.Redis.Core\servicestack.redis.core.nuspec
1414
..\NuGet\ServiceStack.Redis\servicestack.redis.nuspec = ..\NuGet\ServiceStack.Redis\servicestack.redis.nuspec
15+
Directory.Build.props = Directory.Build.props
1516
EndProjectSection
1617
EndProject
1718
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceStack.Redis", "ServiceStack.Redis\ServiceStack.Redis.csproj", "{AF99F19B-4C04-4F58-81EF-B092F1FCC540}"
Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,5 @@
1-
using System.Reflection;
2-
using System.Runtime.CompilerServices;
31
using System.Runtime.InteropServices;
42

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
8-
[assembly: AssemblyTitle("ServiceStack.Redis")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("ServiceStack.Redis")]
13-
[assembly: AssemblyCopyright("Copyright (c) ServiceStack 2017")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
203
[assembly: ComVisible(false)]
21-
22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
234
[assembly: Guid("70a33fa7-9f81-418d-bb25-6a4be6648ae4")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("5.0.0.0")]
36-
[assembly: AssemblyFileVersion("5.0.0.0")]
5+
[assembly: System.Reflection.AssemblyVersion("5.0.0.0")]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PackageId>ServiceStack.Redis.Core</PackageId>
4+
<AssemblyName>ServiceStack.Redis</AssemblyName>
5+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
6+
<Title>ServiceStack.Redis .NET Standard 2.0</Title>
7+
<PackageDescription>
8+
C# Redis Client for the worlds fastest distributed NoSQL datastore.
9+
Byte[], String and POCO Typed clients.
10+
Thread-Safe Basic and Pooled client managers included.
11+
</PackageDescription>
12+
<PackageTags>Redis;NoSQL;Client;Distributed;Cache;PubSub;Messaging;Transactions</PackageTags>
13+
</PropertyGroup>
14+
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
15+
<Reference Include="System.Net" />
16+
<Reference Include="..\..\lib\net45\ServiceStack.Interfaces.dll" />
17+
<Reference Include="..\..\lib\net45\ServiceStack.Text.dll" />
18+
<Reference Include="..\..\lib\net45\ServiceStack.Common.dll" />
19+
<PackageReference Include="ServiceStack.Common" Version="5.0.0" ExcludeAssets="all" />
20+
</ItemGroup>
21+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
22+
<PackageReference Include="System.Net.Security" Version="4.3.2" />
23+
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
24+
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
25+
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
26+
<PackageReference Include="System.Data.Common" Version="4.3.0" />
27+
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
28+
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Interfaces.dll" />
29+
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Text.dll" />
30+
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Common.dll" />
31+
<PackageReference Include="ServiceStack.Common" Version="5.0.0" ExcludeAssets="all" />
32+
</ItemGroup>
33+
</Project>
Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
4-
<AssemblyName>ServiceStack.Redis</AssemblyName>
53
<PackageId>ServiceStack.Redis</PackageId>
6-
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
7-
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
8-
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
9-
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
10-
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
11-
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
12-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
13-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
14-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
17-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
18-
<Optimize>true</Optimize>
19-
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
21-
<DebugType>portable</DebugType>
22-
</PropertyGroup>
23-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
24-
<DefineConstants>$(DefineConstants);NET45</DefineConstants>
25-
<SignAssembly>True</SignAssembly>
26-
<DelaySign>False</DelaySign>
27-
<AssemblyOriginatorKeyFile>../servicestack.snk</AssemblyOriginatorKeyFile>
4+
<AssemblyName>ServiceStack.Redis</AssemblyName>
5+
<Title>C# Redis client for the Redis NoSQL DB</Title>
6+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
7+
<PackageDescription>
8+
C# Redis Client for the worlds fastest distributed NoSQL datastore.
9+
Byte[], String and POCO Typed clients.
10+
Thread-Safe Basic and Pooled client managers included.
11+
</PackageDescription>
12+
<PackageTags>Redis;NoSQL;Client;Distributed;Cache;PubSub;Messaging;Transactions</PackageTags>
2813
</PropertyGroup>
2914
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
3015
<Reference Include="System.Net" />
3116
<Reference Include="..\..\lib\net45\ServiceStack.Interfaces.dll" />
3217
<Reference Include="..\..\lib\net45\ServiceStack.Text.dll" />
3318
<Reference Include="..\..\lib\net45\ServiceStack.Common.dll" />
19+
<PackageReference Include="ServiceStack.Common" Version="$(Version)" />
3420
</ItemGroup>
35-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
36-
<DefineConstants>$(DefineConstants);NETSTANDARD1_3</DefineConstants>
37-
</PropertyGroup>
3821
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
3922
<PackageReference Include="System.Net.Security" Version="4.3.2" />
4023
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
@@ -45,5 +28,7 @@
4528
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Interfaces.dll" />
4629
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Text.dll" />
4730
<Reference Include="..\..\lib\netstandard2.0\ServiceStack.Common.dll" />
31+
<PackageReference Include="ServiceStack.Common" Version="$(Version)" />
4832
</ItemGroup>
33+
4934
</Project>

0 commit comments

Comments
 (0)