Skip to content

Commit 3338b46

Browse files
author
Roman Alekseev
committed
nuget support
- remove dependencyinjection project - add .nuspec file - set project properties
1 parent 8047592 commit 3338b46

File tree

12 files changed

+92
-63
lines changed

12 files changed

+92
-63
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ script:
1212
- dotnet test -c Release
1313
- cd ../Profiler.PerformanceTests
1414
- dotnet test -c Release
15+
- cd ..
16+
deploy:
17+
skip_cleanup: true
18+
provider: script
19+
script: dotnet pack -c Release --no-build && dotnet nuget push ./Profiler/bin/Release/Profiler.0.1.2.nupkg --api-key $NUGET_API_KEY --source $NUGET_SOURCE
20+
on:
21+
tags: true

src/Profiler.Demo.Stopwatch/Profiler.Demo.Stopwatch.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
<TargetFramework>netcoreapp2.2</TargetFramework>
66
</PropertyGroup>
77

8+
<PropertyGroup>
9+
<IsPackable>false</IsPackable>
10+
</PropertyGroup>
11+
812
<ItemGroup>
913
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
1014
</ItemGroup>
1115

1216
<ItemGroup>
13-
<ProjectReference Include="..\Profiler.DependencyInjection\Profiler.DependencyInjection.csproj" />
1417
<ProjectReference Include="..\Profiler\Profiler.csproj" />
1518
</ItemGroup>
1619

src/Profiler.DependencyInjection/Profiler.DependencyInjection.csproj

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

src/Profiler.DependencyInjection/ProfilerConfigurationExtensions.cs

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

src/Profiler.FuzzingTests/Profiler.FuzzingTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
</PropertyGroup>
56

7+
<PropertyGroup>
68
<IsPackable>false</IsPackable>
79
</PropertyGroup>
810

src/Profiler.PerformanceTests/Profiler.PerformanceTests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
</PropertyGroup>
56

7+
<PropertyGroup>
68
<IsPackable>false</IsPackable>
79
</PropertyGroup>
810

@@ -18,7 +20,6 @@
1820
</ItemGroup>
1921

2022
<ItemGroup>
21-
<ProjectReference Include="..\Profiler.DependencyInjection\Profiler.DependencyInjection.csproj" />
2223
<ProjectReference Include="..\Profiler\Profiler.csproj" />
2324
</ItemGroup>
2425

src/Profiler.PerformanceTests/ProfilerTests.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ public void Profiler_CreateSections_Enter_Exit(int count, int keysCount, int dep
7777
{
7878
var reportWriter = new StubReportWriter();
7979

80-
var serviceCollection = new ServiceCollection();
81-
serviceCollection.AddProfiler(settings => settings.CreateReportWriter = () => reportWriter);
82-
var serviceProvider = serviceCollection.BuildServiceProvider();
83-
84-
var profiler = serviceProvider.GetService<IProfiler>();
80+
var conf = new ProfilerConfiguration();
81+
conf.CreateReportWriter = () => reportWriter;
82+
var profiler = conf.CreateProfiler();
8583

8684
string[] keys = new string[count];
8785
for (int i = 0; i < keysCount; i++) keys[i] = i.ToString();
@@ -134,11 +132,9 @@ public async Task Profiler_CreateSections_Enter_AsyncYield_Exit(int count, int k
134132
{
135133
var reportWriter = new StubReportWriter();
136134

137-
var serviceCollection = new ServiceCollection();
138-
serviceCollection.AddProfiler(settings => settings.CreateReportWriter = () => reportWriter);
139-
var serviceProvider = serviceCollection.BuildServiceProvider();
140-
141-
var profiler = serviceProvider.GetService<IProfiler>();
135+
var conf = new ProfilerConfiguration();
136+
conf.CreateReportWriter = () => reportWriter;
137+
var profiler = conf.CreateProfiler();
142138

143139
string[] keys = new string[count];
144140
for (int i = 0; i < keysCount; i++) keys[i] = i.ToString();

src/Profiler.Tests/Profiler.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
</PropertyGroup>
56

7+
<PropertyGroup>
68
<IsPackable>false</IsPackable>
79
</PropertyGroup>
810

src/Profiler.UnitTests/Profiler.UnitTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
</PropertyGroup>
56

7+
<PropertyGroup>
68
<IsPackable>false</IsPackable>
79
</PropertyGroup>
810

src/Profiler.sln

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Profiler.Demo.Stopwatch", "
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Profiler.UnitTests", "Profiler.UnitTests\Profiler.UnitTests.csproj", "{CDE6F808-4CE9-4A00-B759-140D8AF6C28A}"
1313
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Profiler.DependencyInjection", "Profiler.DependencyInjection\Profiler.DependencyInjection.csproj", "{7FB8AC4A-39C1-4990-A793-602FC0CF34D7}"
15-
EndProject
1614
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Profiler.FuzzingTests", "Profiler.FuzzingTests\Profiler.FuzzingTests.csproj", "{164857F8-18F8-4CFE-8638-BD2EBB6729BD}"
1715
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Profiler.PerformanceTests", "Profiler.PerformanceTests\Profiler.PerformanceTests.csproj", "{F15CA89D-CD48-41E6-9A32-9571C44177AC}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Profiler.PerformanceTests", "Profiler.PerformanceTests\Profiler.PerformanceTests.csproj", "{F15CA89D-CD48-41E6-9A32-9571C44177AC}"
1917
EndProject
2018
Global
2119
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -39,10 +37,6 @@ Global
3937
{CDE6F808-4CE9-4A00-B759-140D8AF6C28A}.Debug|Any CPU.Build.0 = Debug|Any CPU
4038
{CDE6F808-4CE9-4A00-B759-140D8AF6C28A}.Release|Any CPU.ActiveCfg = Release|Any CPU
4139
{CDE6F808-4CE9-4A00-B759-140D8AF6C28A}.Release|Any CPU.Build.0 = Release|Any CPU
42-
{7FB8AC4A-39C1-4990-A793-602FC0CF34D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43-
{7FB8AC4A-39C1-4990-A793-602FC0CF34D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
44-
{7FB8AC4A-39C1-4990-A793-602FC0CF34D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
45-
{7FB8AC4A-39C1-4990-A793-602FC0CF34D7}.Release|Any CPU.Build.0 = Release|Any CPU
4640
{164857F8-18F8-4CFE-8638-BD2EBB6729BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4741
{164857F8-18F8-4CFE-8638-BD2EBB6729BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
4842
{164857F8-18F8-4CFE-8638-BD2EBB6729BD}.Release|Any CPU.ActiveCfg = Release|Any CPU

0 commit comments

Comments
 (0)