Skip to content

Commit ad04873

Browse files
authored
Improvements to build settings and C#8. (#14)
1 parent 1a9f3d9 commit ad04873

File tree

13 files changed

+101
-71
lines changed

13 files changed

+101
-71
lines changed

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@ env:
66
global:
77
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
88
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
9-
matrix:
9+
jobs:
1010
include:
1111
- os: linux
12-
dist: xenial
13-
dotnet: 2.2
12+
dist: bionic
13+
dotnet: 3.1
1414
- os: osx
15-
osx_image: xcode9 # OSX 10.12
16-
dotnet: 2.2.104
15+
osx_image: xcode11.2
16+
dotnet: 3.1.301
1717
before_install:
1818
- ulimit -n 4096
1919
script:
2020
- dotnet build -c Release
21-
- dotnet test --configuration Release --no-build
22-
notifications:
23-
on_success: always
24-
on_failure: always
25-
on_start: always
21+
- dotnet test -c Release --no-build

Directory.Build.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Authors>Winton</Authors>
4+
<Company>Winton</Company>
5+
<Copyright>Copyright 2020 Winton</Copyright>
6+
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rules.ruleset</CodeAnalysisRuleSet>
7+
<LangVersion>8.0</LangVersion>
8+
<Nullable>enable</Nullable>
9+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
18+
</ItemGroup>
19+
</Project>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Winton.DomainModelling.Abstractions
22

3-
[![Build status](https://ci.appveyor.com/api/projects/status/7mba8m947ed603r1?svg=true)](https://ci.appveyor.com/project/wintoncode/winton-domainmodelling-abstractions/branch/master)
4-
[![Travis Build Status](https://travis-ci.org/wintoncode/Winton.DomainModelling.Abstractions.svg?branch=master)](https://travis-ci.org/wintoncode/Winton.DomainModelling.Abstractions)
3+
[![Appveyor](https://ci.appveyor.com/api/projects/status/7mba8m947ed603r1?svg=true)](https://ci.appveyor.com/project/wintoncode/winton-domainmodelling-abstractions/branch/master)
4+
[![Travis CI](https://travis-ci.com/wintoncode/Winton.DomainModelling.Abstractions.svg?branch=master)](https://travis-ci.com/wintoncode/Winton.DomainModelling.Abstractions)
55
[![NuGet version](https://img.shields.io/nuget/v/Winton.DomainModelling.Abstractions.svg)](https://www.nuget.org/packages/Winton.DomainModelling.Abstractions)
66
[![NuGet version](https://img.shields.io/nuget/vpre/Winton.DomainModelling.Abstractions.svg)](https://www.nuget.org/packages/Winton.DomainModelling.Abstractions)
77

Rules.ruleset

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules" Description=" " ToolsVersion="16.0">
3+
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
4+
<Rule Id="CA2007" Action="None" />
5+
</Rules>
6+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
7+
<Rule Id="SA1101" Action="None" />
8+
<Rule Id="SA1413" Action="None" />
9+
</Rules>
10+
</RuleSet>

Winton.DomainModelling.Abstractions.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2026
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30128.74
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{859C9252-D63B-4ECB-9AB5-0BA8415C76AE}"
77
ProjectSection(SolutionItems) = preProject
88
.gitignore = .gitignore
99
.travis.yml = .travis.yml
1010
appveyor.yml = appveyor.yml
1111
CONTRIBUTING.md = CONTRIBUTING.md
12+
Directory.Build.props = Directory.Build.props
1213
GitVersion.yml = GitVersion.yml
1314
icon.jpg = icon.jpg
1415
LICENSE = LICENSE
1516
README.md = README.md
17+
Rules.ruleset = Rules.ruleset
1618
stylecop.json = stylecop.json
1719
EndProjectSection
1820
EndProject
1921
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{697902B3-26B1-490D-BC64-39298D6DAFC4}"
2022
EndProject
2123
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{02075BDC-A66D-4346-8093-2F2667660F36}"
24+
ProjectSection(SolutionItems) = preProject
25+
test\Directory.Build.props = test\Directory.Build.props
26+
test\Rules.ruleset = test\Rules.ruleset
27+
EndProjectSection
2228
EndProject
2329
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Winton.DomainModelling.Abstractions", "src\Winton.DomainModelling.Abstractions\Winton.DomainModelling.Abstractions.csproj", "{4CC49F58-367B-4E87-8925-49D913FA7BD1}"
2430
EndProject

appveyor.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
version: '{build}'
21
environment:
3-
CLI_VERSION: latest
4-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
5-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
6-
image: Visual Studio 2017
2+
CLI_VERSION: latest
3+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
4+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
5+
image: Visual Studio 2019
76
configuration:
87
- Release
9-
skip_tags: true
108
before_build:
11-
- dotnet tool install -g GitVersion.Tool --version 4.0.1-beta1-58
9+
- dotnet tool install -g GitVersion.Tool
1210
- dotnet gitversion /l console /output buildserver
1311
build_script:
1412
- dotnet build -c Release -p:Version=%GitVersion_NuGetVersion%
1513
test_script:
1614
- dotnet test -c Release --no-build
1715
artifacts:
18-
- path: .\**\*.nupkg
19-
name: NuGet
20-
nuget:
21-
disable_publish_on_pr: true
16+
- name: NuGet
17+
path: .\**\*.nupkg
18+
- name: Symbols
19+
path: .\**\*.snupkg
2220
deploy:
23-
- provider: NuGet
24-
api_key:
25-
secure: K7GBfAz5cr3lqVzn2+KbM45GA2ZeDjOpgnDU2jpw76PxBL2Qph3OBcfXWuGb+wwD
26-
on:
27-
branch:
28-
- master
29-
- /release\/[0-9]\.[0-9]/
21+
- provider: NuGet
22+
api_key:
23+
secure: +CD+4G+gMInD/BjNvO24NW9u1udGdsx0fUi6bh0muNezQ9fP0sHnS1f96f0OXUy6
24+
on:
25+
branch:
26+
- master
27+
- /release\/[0-9]\.[0-9]/

src/Winton.DomainModelling.Abstractions/Entity.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected Entity(TEntityId id)
3333
/// <param name="left">The first entity.</param>
3434
/// <param name="right">The second entity.</param>
3535
/// <returns><see langword="true" /> if the entities have the same ID; otherwise, <see langword="false" />.</returns>
36-
public static bool operator ==(Entity<TEntityId> left, Entity<TEntityId> right)
36+
public static bool operator ==(Entity<TEntityId>? left, Entity<TEntityId>? right)
3737
{
3838
return Equals(left, right);
3939
}
@@ -44,7 +44,7 @@ protected Entity(TEntityId id)
4444
/// <param name="left">The first entity.</param>
4545
/// <param name="right">The second entity.</param>
4646
/// <returns><see langword="true" /> if the entities have different IDs; otherwise, <see langword="false" />.</returns>
47-
public static bool operator !=(Entity<TEntityId> left, Entity<TEntityId> right)
47+
public static bool operator !=(Entity<TEntityId>? left, Entity<TEntityId>? right)
4848
{
4949
return !Equals(left, right);
5050
}
@@ -58,7 +58,7 @@ protected Entity(TEntityId id)
5858
/// <see langword="true" /> if the current entity has the same ID as the <paramref name="other" /> entity;
5959
/// otherwise, <see langword="false" />.
6060
/// </returns>
61-
public bool Equals(Entity<TEntityId> other)
61+
public bool Equals(Entity<TEntityId>? other)
6262
{
6363
if (other is null)
6464
{
@@ -75,7 +75,7 @@ public bool Equals(Entity<TEntityId> other)
7575
return false;
7676
}
7777

78-
return !Id.Equals(default(TEntityId)) && !other.Id.Equals(default(TEntityId)) && Id.Equals(other.Id);
78+
return !Id.Equals(default!) && !other.Id.Equals(default!) && Id.Equals(other.Id);
7979
}
8080

8181
/// <summary>
@@ -86,7 +86,7 @@ public bool Equals(Entity<TEntityId> other)
8686
/// <see langword="true" /> if the specified object is equal to the current object; otherwise,
8787
/// <see langword="false" />.
8888
/// </returns>
89-
public override bool Equals(object obj)
89+
public override bool Equals(object? obj)
9090
{
9191
return Equals(obj as Entity<TEntityId>);
9292
}

src/Winton.DomainModelling.Abstractions/Unit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public struct Unit : IEquatable<Unit>, IComparable<Unit>, IComparable
1616
/// <summary>
1717
/// Gets the default and only value of the <see cref="Unit" /> type.
1818
/// </summary>
19-
public static Unit Value { get; } = default(Unit);
19+
public static Unit Value { get; } = default;
2020

2121
/// <summary>
2222
/// Determines whether the first <cref see="Unit" /> is equal to the second <cref see="Unit" />.
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,35 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Authors>Winton</Authors>
5-
<Company>Winton</Company>
6-
<Copyright>Copyright 2018 Winton</Copyright>
74
<Description>Provides common abstractions for domain modelling.</Description>
85
<GenerateDocumentationFile>True</GenerateDocumentationFile>
9-
<NoWarn>$(NoWarn);SA1101</NoWarn>
6+
<IncludeSymbols>true</IncludeSymbols>
107
<PackageId>Winton.DomainModelling.Abstractions</PackageId>
11-
<PackageIconUrl>https://raw.githubusercontent.com/wintoncode/Winton.DomainModelling.Abstractions/master/icon.jpg</PackageIconUrl>
8+
<PackageIcon>icon.jpg</PackageIcon>
129
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1310
<PackageProjectUrl>https://github.com/wintoncode/Winton.DomainModelling.Abstractions</PackageProjectUrl>
1411
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
1512
<PackageTags>Winton, Domain, Driven, Design, Modelling, Abstractions, DDD</PackageTags>
16-
<PackageVersion>$(NuGetVersion)</PackageVersion>
13+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1714
<RepositoryType>git</RepositoryType>
1815
<RepositoryUrl>https://github.com/wintoncode/Winton.DomainModelling.Abstractions</RepositoryUrl>
1916
<RootNamespace>Winton.DomainModelling</RootNamespace>
17+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2018
<TargetFramework>netstandard1.0</TargetFramework>
2119
<Title>Winton Domain Modelling Abstractions</Title>
22-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
23-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
24-
<IncludeSymbols>true</IncludeSymbols>
25-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2620
</PropertyGroup>
2721

28-
<ItemGroup>
29-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
30-
</ItemGroup>
31-
3222
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
3323
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
3424
</PropertyGroup>
3525

3626
<ItemGroup>
37-
<AdditionalFiles Include="../../stylecop.json" />
27+
<None Include="../../icon.jpg" Pack="true" PackagePath="" />
3828
<None Include="../../LICENSE" Pack="true" PackagePath=""/>
3929
</ItemGroup>
4030

4131
<ItemGroup>
42-
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
32+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4333
</ItemGroup>
4434

4535
</Project>

test/Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
3+
<PropertyGroup>
4+
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rules.ruleset</CodeAnalysisRuleSet>
5+
<GenerateDocumentationFile>False</GenerateDocumentationFile>
6+
<IsPackable>False</IsPackable>
7+
</PropertyGroup>
8+
</Project>

0 commit comments

Comments
 (0)