Skip to content

Commit

Permalink
Update packaging for v2 (#45)
Browse files Browse the repository at this point in the history
* update packaging

* fix whitespace

* Rename api approval file

* Fix failing approval

* Further cleanup for project files

* Remove unused ILMerge.exe

* Remove need for NServiceBus.Newtonsoft.Json in test

* Remove Integration project

Since it wasn't working correctly anyway

* Add SourceLink support
  • Loading branch information
dbelcham authored and Scooletz committed Nov 13, 2017
1 parent 6a019bf commit 22fc35c
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 770 deletions.
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

</Project>
25 changes: 0 additions & 25 deletions src/Directory.Build.targets

This file was deleted.

22 changes: 0 additions & 22 deletions src/Integration/Integration.sln

This file was deleted.

568 changes: 0 additions & 568 deletions src/Integration/Integration.sln.DotSettings

This file was deleted.

14 changes: 0 additions & 14 deletions src/Integration/MyEndpoint/MyEndpoint.csproj

This file was deleted.

10 changes: 0 additions & 10 deletions src/Integration/MyEndpoint/MyHandler.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/Integration/MyEndpoint/MyMessage.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/Integration/MyEndpoint/Program.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/Integration/MyEndpoint/app.manifest

This file was deleted.

20 changes: 0 additions & 20 deletions src/Integration/nuget.config

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute(@"NServiceBus.Metrics.PerformanceCounters.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100D32BC524DCB1205998C155A4F36BF873587D3602822ECD7B49CD775B2E6A006EE6B9164AB2E3103A6A4D1310C6E5C26818A32FE86710141A2D1F02EB564381CD64C88131BCCA478CDB5072F06DB991DE33DAC1C82BAF40D9F61DD6B40300A4673B693B51CD10A8B9B7D8AB64450431FA422514D6DABCAF70DF785B1E4E6E8AAF")]
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName=".NET Framework 4.5.2")]

namespace NServiceBus.Metrics.PerformanceCounters
{

[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.All)]
public sealed class PerformanceCounterSettingsAttribute : System.Attribute
{
Expand All @@ -15,7 +13,6 @@ public PerformanceCounterSettingsAttribute() { }
}
namespace NServiceBus
{

public class static PerformanceCountersExtensions
{
public static NServiceBus.PerformanceCountersSettings EnableWindowsPerformanceCounters(this NServiceBus.EndpointConfiguration endpointConfiguration) { }
Expand All @@ -24,8 +21,7 @@ public class PerformanceCountersSettings
{
public void EnableSLAPerformanceCounters(System.TimeSpan sla) { }
[System.ObsoleteAttribute("This interval is no longer used for reporting. Counters values are updated as soo" +
"n as they are reported. Will be treated as an error from version 2.0.0. Will be " +
"removed in version 3.0.0.", false)]
"n as they are reported. Will be removed in version 3.0.0.", true)]
public void UpdateCounterEvery(System.TimeSpan updateInterval) { }
}
}
26 changes: 21 additions & 5 deletions src/NServiceBus.Metrics.PerformanceCounters.Tests/APIApprovals.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System.IO;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using ApiApprover;
using NServiceBus.Metrics.PerformanceCounters;
using ApprovalTests;
using NUnit.Framework;
using PublicApiGenerator;

[TestFixture]
public class APIApprovals
Expand All @@ -11,7 +14,20 @@ public class APIApprovals
[MethodImpl(MethodImplOptions.NoInlining)]
public void Approve()
{
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
PublicApiApprover.ApprovePublicApi(typeof(PerformanceCounterSettingsAttribute).Assembly);
var combine = Path.Combine(TestContext.CurrentContext.TestDirectory, "NServiceBus.Metrics.PerformanceCounters.dll");
var assembly = Assembly.LoadFile(combine);
var publicApi = Filter(ApiGenerator.GeneratePublicApi(assembly));
Approvals.Verify(publicApi);
}

string Filter(string text)
{
return string.Join(Environment.NewLine, text.Split(new[]
{
Environment.NewLine
}, StringSplitOptions.RemoveEmptyEntries)
.Where(l => !l.StartsWith("[assembly: ReleaseDateAttribute("))
.Where(l => !string.IsNullOrWhiteSpace(l))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static EndpointConfiguration BuildEndpoint(string s)
endpointConfiguration.UseTransport<LearningTransport>();
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UseSerialization<NewtonsoftSerializer>();
//endpointConfiguration.UseSerialization<NewtonsoftSerializer>();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
var recoverability = endpointConfiguration.Recoverability();
recoverability.Immediate(c => c.NumberOfRetries(0));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
<SignAssembly>true</SignAssembly>
<Optimize>False</Optimize>
</PropertyGroup>

<ItemGroup>
<Compile Remove="*.approved.cs" />
<Compile Remove="*.received.cs" />
<Compile Include="..\ScriptBuilderTask.Tests\CSharpCodeGenerationTests.Generates.approved.cs" Link="CSharpCodeGenerationTests.Generates.approved.cs" />
<PackageReference Include="ApprovalTests" Version="3.*" />
<PackageReference Include="ApprovalUtilities" Version="3.*" />
<PackageReference Include="Mono.Cecil" Version="0.10.0-*" />
<PackageReference Include="NServiceBus" Version="6.4.2" />
<PackageReference Include="NServiceBus.Metrics" Version="[2.0.0, 3.0.0)" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="1.1.0" />
<PackageReference Include="NUnit" Version="3.*" />
<PackageReference Include="ApiApprover" Version="6.1.0-*" />
<PackageReference Include="PublicApiGenerator" Version="6.1.0-*" />
<ProjectReference Include="..\NServiceBus.Metrics.PerformanceCounters\NServiceBus.Metrics.PerformanceCounters.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="NServiceBus" Version="6.4.2" />
<PackageReference Include="NServiceBus.Metrics" Version="2.0.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ApprovalTests" Version="3.0.13" />
<PackageReference Include="PublicApiGenerator" Version="6.4.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\ScriptBuilderTask.Tests\CSharpCodeGenerationTests.Generates.approved.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Tests
{
using System;
using System.Runtime.CompilerServices;
using ApprovalTests;
using NUnit.Framework;

Expand All @@ -25,6 +26,7 @@ public void Get_the_same_counter_twice_returns_the_same()
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void Should_throw_for_endpoint_name_too_long()
{
var cache = new PerformanceCountersCache();
Expand Down
8 changes: 7 additions & 1 deletion src/NServiceBus.Metrics.PerformanceCounters.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.27004.2002
MinimumVisualStudioVersion = 15.0.26403.3
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Metrics.PerformanceCounters", "NServiceBus.Metrics.PerformanceCounters\NServiceBus.Metrics.PerformanceCounters.csproj", "{DF381B87-8EB9-4F30-9E92-0849641ED01A}"
EndProject
Expand All @@ -11,6 +11,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScriptBuilderTask", "Script
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScriptBuilderTask.Tests", "ScriptBuilderTask.Tests\ScriptBuilderTask.Tests.csproj", "{8174164E-52B8-4878-BFB0-34C81A31930E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1B573EC5-07D6-4E25-9687-FB5A536B4FD9}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
..\GitVersion.yml = ..\GitVersion.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBus.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OutputPath>..\..\binaries\</OutputPath>
<Description>Enables access to performance counters</Description>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\ScriptBuilderTask\CounterNameConventions.cs" Link="CounterNameConventions.cs" />
<PackageReference Include="NServiceBus.Metrics" Version="[2.0.0, 3.0.0)" />
<PackageReference Include="Fody" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Obsolete.Fody" Version="4.3.2" PrivateAssets="All" />
<PackageReference Include="Particular.CodeRules" Version="0.2.0" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="0.1.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersionTask" Version="4.0.0-*" PrivateAssets="All" />
<PackageReference Include="NServiceBus.Metrics" Version="[2.0.0, 3.0.0)" />
<PackageReference Include="Obsolete.Fody" Version="4.3.2" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.5.0" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.5.0" />
</ItemGroup>

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Enables access to performance counters</Description>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\ScriptBuilderTask\CounterNameConventions.cs" />
</ItemGroup>

<Target Name="WritePackageVersionForIntegration" BeforeTargets="GenerateNuspec">
<WriteLinesToFile Lines="&lt;Project&gt;&lt;PropertyGroup&gt;&lt;IntegrationVersion&gt;$(PackageVersion)&lt;/IntegrationVersion&gt;&lt;/PropertyGroup&gt;&lt;/Project&gt;" File="..\Integration\Directory.Build.props" Overwrite="true" />
</Target>
</Project>
Loading

0 comments on commit 22fc35c

Please sign in to comment.