Skip to content

Commit

Permalink
Updated to C# 7.3, dropped support for netstandard1.3; +semver: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jun 3, 2018
1 parent e68e182 commit 1d7d85d
Show file tree
Hide file tree
Showing 29 changed files with 37 additions and 116 deletions.
8 changes: 4 additions & 4 deletions Common.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<Microsoft_Extensions_Logging_Version>2.0.0</Microsoft_Extensions_Logging_Version>
<Microsoft_Extensions_DependencyModel_Version>2.0.4</Microsoft_Extensions_DependencyModel_Version>
<SourceLink_Version>2.8.1</SourceLink_Version>
<Microsoft_NET_Test_Sdk_Version>15.7.0</Microsoft_NET_Test_Sdk_Version>
<Microsoft_NET_Test_Sdk_Version>15.7.2</Microsoft_NET_Test_Sdk_Version>
<xunit_Version>2.3.1</xunit_Version>
<FluentAssertions_Version>5.3.0</FluentAssertions_Version>
<FakeItEasy_Version>4.5.1</FakeItEasy_Version>
<FluentAssertions_Version>5.3.2</FluentAssertions_Version>
<FakeItEasy_Version>4.6.0</FakeItEasy_Version>
<Autofac_FakeItEasy_Version>5.0.0</Autofac_FakeItEasy_Version>
<Bogus_Version>22.0.8</Bogus_Version>
<Bogus_Version>22.1.2</Bogus_Version>
<RSG_Testing_Version>0.4.1</RSG_Testing_Version>
</PropertyGroup>
<!-- Overrides -->
Expand Down
3 changes: 1 addition & 2 deletions Conventions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{1E56
.travis.yml = .travis.yml
cake.config = cake.config
GitVersion.yml = GitVersion.yml
global.json = global.json
NuGet.config = NuGet.config
Readme.md = Readme.md
EndProjectSection
Expand Down Expand Up @@ -47,7 +46,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{C4335B
sample\Directory.Build.props = sample\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.DependencyOne", "sample\Sample.DependencyOne\Sample.DependencyOne.csproj", "{0AE273C5-B6D1-451D-BBE8-EC004AE90ED5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.DependencyOne", "sample\Sample.DependencyOne\Sample.DependencyOne.csproj", "{0AE273C5-B6D1-451D-BBE8-EC004AE90ED5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.DependencyThree", "sample\Sample.DependencyThree\Sample.DependencyThree.csproj", "{95BE10B9-389E-4709-A359-76143AF3800C}"
EndProject
Expand Down
6 changes: 0 additions & 6 deletions cake.config

This file was deleted.

2 changes: 1 addition & 1 deletion cakefile.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load "nuget:?package=Rocket.Surgery.Cake.Library&version=0.3.2";
#load "nuget:?package=Rocket.Surgery.Cake.Library&version=0.4.0";

Task("Default")
.IsDependentOn("dotnet");
Expand Down
2 changes: 1 addition & 1 deletion sample/Sample.DependencyOne/Sample.DependencyOne.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sample/Sample.DependencyTwo/Sample.DependencyTwo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Conventions.Abstractions/IConventionBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Rocket.Surgery.Builders;
using Rocket.Surgery.Conventions.Reflection;
using Rocket.Surgery.Conventions.Scanners;
Expand All @@ -7,6 +8,7 @@ namespace Rocket.Surgery.Conventions
public interface IConventionBuilder<out TBuilder, in TConvention, in TDelegate> : IBuilder, IConventionContainer<TBuilder, TConvention, TDelegate>
where TBuilder : IBuilder
where TConvention : IConvention
where TDelegate : Delegate
{
IAssemblyProvider AssemblyProvider { get; }
IAssemblyCandidateFinder AssemblyCandidateFinder { get; }
Expand Down
1 change: 1 addition & 0 deletions src/Conventions.Abstractions/IConventionComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Rocket.Surgery.Conventions
public interface IConventionComposer<TContext, TContribution, TDelegate> : IConvention<TContext>
where TContribution : IConvention<TContext>
where TContext : IConventionContext
where TDelegate : Delegate
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Rocket.Surgery.Builders.Abstractions" Version="$(RSG_Builders_Version)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface IConventionContainer
public interface IConventionContainer<out TBuilder, in TConvention, in TDelegate>
where TConvention : IConvention
where TBuilder : IBuilder
where TDelegate : Delegate
{
/// <summary>
/// Add a delegate to the scanner, that runs before scanning.
Expand Down
4 changes: 3 additions & 1 deletion src/Conventions.Abstractions/Scanners/IConventionProvider.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;

namespace Rocket.Surgery.Conventions.Scanners
Expand All @@ -16,7 +17,8 @@ public interface IConventionProvider
/// <returns>DelegateOrConvention&lt;TContribution, TDelegate&gt;</returns>
/// TODO Edit XML Comment Template for Get`1
IEnumerable<DelegateOrConvention> Get<TContribution, TDelegate>()
where TContribution : IConvention;
where TContribution : IConvention
where TDelegate : Delegate;

/// <summary>
/// Gets a all the conventions from the provider
Expand Down
3 changes: 3 additions & 0 deletions src/Conventions/Composer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Microsoft.Extensions.Logging;
using Rocket.Surgery.Conventions.Scanners;

Expand All @@ -11,6 +12,7 @@ public static class Composer
class ComposerImpl<TContext, TContribution, TDelegate> : ConventionComposer<TContext, TContribution, TDelegate>
where TContribution : IConvention<TContext>
where TContext : IConventionContext
where TDelegate : Delegate
{ public ComposerImpl(IConventionScanner scanner) : base(scanner) { } }

/// <summary>
Expand All @@ -27,6 +29,7 @@ public static void Register<TContext, TContribution, TDelegate>(
TContext context)
where TContribution : IConvention<TContext>
where TContext : IConventionContext
where TDelegate : Delegate
{
new ComposerImpl<TContext, TContribution, TDelegate>(scanner).Register(context);
}
Expand Down
1 change: 1 addition & 0 deletions src/Conventions/ConventionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Rocket.Surgery.Conventions
public abstract class ConventionBuilder<TBuilder, TConvention, TDelegate> : ConventionContainerBuilder<TBuilder, TConvention, TDelegate>, IConventionBuilder<TBuilder, TConvention, TDelegate>
where TBuilder : IBuilder
where TConvention : IConvention
where TDelegate : Delegate
{
protected ConventionBuilder(IConventionScanner scanner, IAssemblyProvider assemblyProvider, IAssemblyCandidateFinder assemblyCandidateFinder) : base(scanner)
{
Expand Down
1 change: 1 addition & 0 deletions src/Conventions/ConventionComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void RegisterGeneric<T>(IConvention<T> convention, T context)
public abstract class ConventionComposer<TContext, TContribution, TDelegate> : ConventionComposerBase, IConventionComposer<TContext, TContribution, TDelegate>
where TContribution : IConvention<TContext>
where TContext : IConventionContext
where TDelegate : Delegate
{
private readonly IConventionScanner _scanner;

Expand Down
1 change: 1 addition & 0 deletions src/Conventions/ConventionContainerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Rocket.Surgery.Conventions
public abstract class ConventionContainerBuilder<TBuilder, TConvention, TDelegate> : Builder, IConventionContainer<TBuilder, TConvention, TDelegate>
where TBuilder : IBuilder
where TConvention : IConvention
where TDelegate : Delegate
{
protected readonly IConventionScanner Scanner;

Expand Down
35 changes: 0 additions & 35 deletions src/Conventions/Logging/NullLogger.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/Conventions/Logging/NullScope.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !NETSTANDARD1_3
using Microsoft.Extensions.DependencyModel;
using Microsoft.Extensions.DependencyModel;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -59,4 +58,3 @@ internal IEnumerable<Assembly> GetCandidateLibraries(string[] candidates)
}
}
}
#endif
4 changes: 1 addition & 3 deletions src/Conventions/Reflection/AppDomainAssemblyProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !NETSTANDARD1_3
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -44,4 +43,3 @@ private void LogValue(Assembly value) =>
);
}
}
#endif
2 changes: 0 additions & 2 deletions src/Conventions/Reflection/AssemblyCandidateResolver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if !NETSTANDARD1_3
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -130,4 +129,3 @@ public override string ToString()
}
}
}
#endif
4 changes: 1 addition & 3 deletions src/Conventions/Reflection/DefaultAssemblyCandidateFinder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !NETSTANDARD1_3
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down Expand Up @@ -57,4 +56,3 @@ internal IEnumerable<Assembly> GetCandidateLibraries(string[] candidates)
}
}
}
#endif
4 changes: 2 additions & 2 deletions src/Conventions/Rocket.Surgery.Conventions.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451;netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Conventions.Abstractions\Rocket.Surgery.Conventions.Abstractions.csproj" />
Expand Down
5 changes: 3 additions & 2 deletions src/Conventions/Scanners/ConventionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public ConventionProvider(IEnumerable<IConvention> contributions, IEnumerable<Ty

public IEnumerable<DelegateOrConvention> Get<TContribution, TDelegate>()
where TContribution : IConvention
where TDelegate : Delegate
{
return _prependedConventionsOrDelegates
.Union(_conventions)
Expand All @@ -31,9 +32,9 @@ public IEnumerable<DelegateOrConvention> Get<TContribution, TDelegate>()
return new DelegateOrConvention(a);
}
// ReSharper disable once ConvertIfStatementToReturnStatement
if (x.GetType() == typeof(TDelegate))
if (x is Delegate d)
{
return new DelegateOrConvention((Delegate)x);
return new DelegateOrConvention(d);
}
return DelegateOrConvention.None;
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !NETCOREAPP1_1
using System;
using System;
using System.Linq;
using FakeItEasy;
using FluentAssertions;
Expand Down Expand Up @@ -51,4 +50,3 @@ public void FindsAssembliesInCandidates_Empty()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !NETCOREAPP1_1
using System.Linq;
using System.Linq;
using System.Reflection;
using FluentAssertions;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -94,4 +93,3 @@ public void FindsAssembliesInCandidates_Empty()
}
}
}
#endif
15 changes: 0 additions & 15 deletions test/Conventions.Tests/GenericConventionComposerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ public TestConventionComposer(IConventionScanner scanner) : base(scanner)
}
}

public class NotADelegateComposer : ConventionComposer<ITestConventionContext, ITestConvention, string>
{
public NotADelegateComposer(IConventionScanner scanner) : base(scanner)
{
}
}

public GenericConventionComposerTests(ITestOutputHelper outputHelper) : base(outputHelper)
{
}
Expand All @@ -41,14 +34,6 @@ public void ShouldConstructComposer()
composer.Should().NotBeNull();
}

[Fact]
public void ShouldThrowIfDelegateIsNotADelegate()
{
var scanner = A.Fake<IConventionScanner>();
Action action = () => new NotADelegateComposer(scanner);
action.Should().Throw<ArgumentException>();
}

[Fact]
public void RegisterShouldCallConvention()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;netcoreapp2.1;net461</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Rocket.Surgery.Builders" Version="$(RSG_Builders_Version)" />
Expand Down
4 changes: 1 addition & 3 deletions tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.26.1" />
<package id="Cake.BuildSystems.Module" version="0.2.0" />
<package id="Cake.Bakery" version="0.2.0" />
<package id="Cake" version="0.28.0" />
</packages>

0 comments on commit 1d7d85d

Please sign in to comment.