Skip to content

Commit aa41d27

Browse files
authored
Merge pull request #16 from AppCoreNet/dev
Release v0.4.0
2 parents ad575ef + 5d0a226 commit aa41d27

File tree

66 files changed

+1067
-1021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1067
-1021
lines changed

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
<Authors>AppCore .NET Contributors</Authors>
44
<Company>The AppCore .NET project</Company>
55
<Product>AppCore .NET model validation</Product>
6-
<Copyright>Copyright (c) 2018-2020 the AppCore .NET project</Copyright>
6+
<Copyright>Copyright (c) 2018-2022 the AppCore .NET project</Copyright>
77
<Version>1.0.0</Version>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>
99
<RepositoryUrl>https://github.com/AppCoreNet/Validation</RepositoryUrl>
1010
<RepositoryType>git</RepositoryType>
11+
<Nullable>enable</Nullable>
1112
<LangVersion>latest</LangVersion>
12-
<NoWarn>$(NoWarn);NU5105</NoWarn>
1313
<!--
1414
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1515
<RestoreLockedMode Condition="'$(CI)' == 'true'">true</RestoreLockedMode>
1616
-->
17+
<DefineConstants>$(DefineConstants);ENABLE_NULLABLE</DefineConstants>
1718
</PropertyGroup>
1819

1920
<Import Project="./build/shared/dotnet/common.props" />

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Adds support for using DataAnnotations.
4242
To use DataAnnotations configure the provider when registering the facility:
4343
```
4444
services.AddAppCore()
45-
.AddModelValidation(v => v.UseDataAnnotations());
45+
.AddModelValidation(v => v.AddDataAnnotations());
4646
```
4747

4848
### FluentValidation
@@ -51,7 +51,7 @@ Adds support for using FluentValidation.
5151
To use FluentValidation, configure the provider and add validators when registering the facility:
5252
```
5353
services.AddAppCore()
54-
.AddModelValidation(v => v.UseFluentValidation(fv => fv.WithValidator<MyValidator>()));
54+
.AddModelValidation(v => v.AddFluentValidation(fv => fv.AddValidator<MyValidator>())));
5555
```
5656

5757
## Contributing

build/dependency-versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<AppCore_Shared_Version>0.3.0</AppCore_Shared_Version>
4-
<AppCore_DI_Version>0.3.0</AppCore_DI_Version>
3+
<AppCore_Shared_Version>0.4.3</AppCore_Shared_Version>
4+
<AppCore_Extensions_Version>0.4.0</AppCore_Extensions_Version>
55
</PropertyGroup>
66
</Project>

build/shared/azure-pipelines/build-steps.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
parameters:
22
configuration: 'Debug'
3+
testFilter: ''
34

45
steps:
5-
- pwsh: ./build.ps1 --configuration='${{ parameters.configuration }}'
6+
- pwsh: ./build.ps1 --configuration "${{ parameters.configuration }}"
67
displayName: Build
7-
- pwsh: ./build.ps1 --target=Test --skip-target='Build' --configuration='${{ parameters.configuration }}' --artifactsDir='$(Build.ArtifactStagingDirectory)'
8+
- pwsh: ./build.ps1 --target "Test" --skip-target "Build" --configuration "${{ parameters.configuration }}" --test-filter "${{ parameters.testFilter }}" --artifactsDir "$(Build.ArtifactStagingDirectory)"
89
displayName: Run Tests
910
- task: PublishTestResults@2
1011
displayName: Publish Test Results

build/shared/azure-pipelines/install-steps.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
steps:
2-
- task: UseDotNet@2
3-
displayName: 'Install .NET Core SDK 2.1'
4-
inputs:
5-
version: '2.1.x'
2+
63
- task: UseDotNet@2
74
displayName: 'Install .NET Core SDK 3.1'
85
inputs:
96
version: '3.1.x'
107
- task: UseDotNet@2
11-
displayName: 'Install .NET Core SDK 5'
8+
displayName: 'Install .NET SDK 5'
9+
inputs:
10+
version: '5.x'
11+
- task: UseDotNet@2
12+
displayName: 'Install .NET SDK 6'
1213
inputs:
13-
version: '5.0.x'
14+
version: '6.x'
1415
- task: NuGetToolInstaller@1
1516
displayName: 'Install NuGet 5.4'
1617
inputs:
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
22
configuration: 'Debug'
3+
testFilter: ''
34

45
jobs:
56
- job: Linux
@@ -9,10 +10,11 @@ jobs:
910
- template: ./install-steps.yml
1011
- template: ./build-steps.yml
1112
parameters:
12-
configuration: $(configuration)
13+
configuration: '${{ parameters.configuration }}'
14+
testFilter: '${{ parameters.testFilter }}'
1315
- template: ./publish-steps.yml
1416
parameters:
15-
configuration: $(configuration)
17+
configuration: '${{ parameters.configuration }}'
1618

1719
- job: MacOS
1820
pool:
@@ -21,7 +23,8 @@ jobs:
2123
- template: ./install-steps.yml
2224
- template: ./build-steps.yml
2325
parameters:
24-
configuration: $(configuration)
26+
configuration: '${{ parameters.configuration }}'
27+
testFilter: '${{ parameters.testFilter }}'
2528

2629
- job: Windows
2730
pool:
@@ -30,4 +33,5 @@ jobs:
3033
- template: ./install-steps.yml
3134
- template: ./build-steps.yml
3235
parameters:
33-
configuration: $(configuration)
36+
configuration: '${{ parameters.configuration }}'
37+
testFilter: '${{ parameters.testFilter }}'

build/shared/azure-pipelines/publish-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ parameters:
22
configuration: 'Debug'
33

44
steps:
5-
- pwsh: ./build.ps1 --target=Publish --configuration='${{ parameters.configuration }}' --artifactsDir='$(Build.ArtifactStagingDirectory)'
5+
- pwsh: ./build.ps1 --target "Publish" --configuration "${{ parameters.configuration }}" --artifactsDir "$(Build.ArtifactStagingDirectory)"
66
displayName: Publish
77
- task: NuGetCommand@2
88
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

build/shared/cake/dotnetcore.cake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ public class BuildParametersDotNetCore
2020

2121
public string TestSolution { get; set; }
2222
public string TestProjectsPattern { get; set; } = "**/test/**/*.csproj";
23+
public string TestFilter { get; set; }
2324

2425
public bool CollectCoverage { get; set; } = true;
2526
public bool CollectTestAssemblyCoverage { get; set; } = false;
2627
}
2728

29+
BuildParametersInit.Add((p,c) => {
30+
p.DotNetCore.TestFilter = c.Argument("test-filter", "");
31+
});
32+
2833
public bool DotNetCoreNewSolution(string solutionFile, FilePathCollection projectFiles)
2934
{
3035
bool needsUpdate = true;
@@ -169,6 +174,7 @@ Task("DotNetCore.Test")
169174
return args;
170175
},
171176
Configuration = p.Configuration,
177+
Filter = p.DotNetCore.TestFilter,
172178
ResultsDirectory = testResultsDir,
173179
Loggers = new string[] { "trx" },
174180
NoRestore = true,

build/shared/cake/parameters.cake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
static List<Action<BuildParameters, ICakeContext>> BuildParametersInit = new List<Action<BuildParameters, ICakeContext>>();
2+
13
public partial class BuildParameters
24
{
35
private readonly ICakeContext _context;
@@ -25,6 +27,9 @@ public partial class BuildParameters
2527
Version = BuildVersion.Create(context)
2628
};
2729

30+
foreach(Action<BuildParameters, ICakeContext> initFunc in BuildParametersInit)
31+
initFunc(p, context);
32+
2833
init?.Invoke(p);
2934
return p;
3035
}

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "6.0.101",
4+
"rollForward": "latestFeature"
5+
}
6+
}

0 commit comments

Comments
 (0)