Skip to content

Commit b43afa4

Browse files
authored
Only use DotnetDispatcher package (#47)
1 parent 837639c commit b43afa4

20 files changed

+60
-93
lines changed

.github/workflows/Build_main_and_publish_to_nuget.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
- name: 'Publish: artifacts'
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@v3
4444
with:
4545
name: artifacts
4646
path: artifacts

.github/workflows/Continuous_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
- name: 'Publish: artifacts'
42-
uses: actions/upload-artifact@v4
42+
uses: actions/upload-artifact@v3
4343
with:
4444
name: artifacts
4545
path: artifacts

.github/workflows/Manual_publish_to_Github_Nuget.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
- name: 'Publish: artifacts'
39-
uses: actions/upload-artifact@v4
39+
uses: actions/upload-artifact@v3
4040
with:
4141
name: artifacts
4242
path: artifacts

build/Build.cs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
2424
InvokedTargets = new[] { nameof(Pack), nameof(PublishToGitHubNuget) },
2525
EnableGitHubToken = true
26-
)]
26+
)]
2727
[GitHubActions(
2828
"Build main and publish to nuget",
2929
GitHubActionsImage.UbuntuLatest,
3030
OnPushBranches = new[] { "main" },
3131
InvokedTargets = new[]
3232
{ nameof(Clean), nameof(Compile), nameof(Pack), nameof(PublishToGitHubNuget), nameof(Publish) },
3333
ImportSecrets = new[] { nameof(NuGetApiKey) },
34-
EnableGitHubToken = true)]
34+
EnableGitHubToken = true
35+
)]
3536
class Build : NukeBuild
3637
{
3738
readonly AbsolutePath ArtifactsDirectory = RootDirectory / "artifacts";
@@ -40,11 +41,11 @@ class Build : NukeBuild
4041
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
4142

4243
[LatestNuGetVersion(
43-
"DotnetDispatcher.Core",
44+
"DotnetDispatcher",
4445
IncludePrerelease = false)]
4546
readonly NuGetVersion DotnetDispatcherVersion;
4647

47-
[Parameter] [Secret] readonly string NuGetApiKey;
48+
[Parameter][Secret] readonly string NuGetApiKey;
4849

4950
[GitRepository] readonly GitRepository Repository;
5051

@@ -55,7 +56,7 @@ class Build : NukeBuild
5556
.Before(Restore)
5657
.Executes(() =>
5758
{
58-
EnsureCleanDirectory(ArtifactsDirectory);
59+
ArtifactsDirectory.CreateOrCleanDirectory();
5960
});
6061

6162
Target Restore => _ => _
@@ -96,17 +97,20 @@ class Build : NukeBuild
9697
.Executes(() =>
9798
{
9899
var newMajor = 0;
99-
var newMinor = 4;
100-
var newPatch = DotnetDispatcherVersion.Patch + 1;
100+
var newMinor = 8;
101+
var newPatch = DotnetDispatcherVersion?.Patch ?? 0 + 1;
101102

102-
if (newMajor > DotnetDispatcherVersion.Major)
103-
{
104-
newMinor = 0;
105-
newPatch = 0;
106-
}
107-
else if (newMinor > DotnetDispatcherVersion.Minor)
103+
if (DotnetDispatcherVersion != null)
108104
{
109-
newPatch = 0;
105+
if (newMajor > DotnetDispatcherVersion.Major)
106+
{
107+
newMinor = 0;
108+
newPatch = 0;
109+
}
110+
else if (newMinor > DotnetDispatcherVersion.Minor)
111+
{
112+
newPatch = 0;
113+
}
110114
}
111115

112116
var newVersion = new NuGetVersion(newMajor, newMinor, newPatch,
@@ -119,8 +123,7 @@ class Build : NukeBuild
119123
.SetNoRestore(true)
120124
.SetVersion(newVersion.ToString())
121125
.SetVerbosity(DotNetVerbosity.normal)
122-
.CombineWith(Solution.GetSolutionFolder("src").Projects.Where(_ => _.Name.Contains("DotnetDispatcher")),
123-
(settings, project) => settings.SetProject(project))
126+
.SetProject(Solution.src.DotnetDispatcher)
124127
);
125128
});
126129

dotnet-dispatcher.sln

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9955EE7F-B7DF-4AF7-99E1-E17572BFB61D}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDispatcher.Attributes", "src\DotnetDispatcher.Attributes\DotnetDispatcher.Attributes.csproj", "{D729374E-250F-4472-AF37-3579002969EC}"
9-
EndProject
108
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDispatcher.Generator", "src\DotnetDispatcher.Generator\DotnetDispatcher.Generator.csproj", "{623EB4EA-907F-4650-AB13-5F9BE39B6A8C}"
119
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDispatcher.Core", "src\DotnetDispatcher.Core\DotnetDispatcher.Core.csproj", "{D5233C43-C155-476C-92FD-436842364008}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDispatcher", "src\DotnetDispatcher\DotnetDispatcher.csproj", "{D5233C43-C155-476C-92FD-436842364008}"
1311
EndProject
1412
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{BF6A64D8-4626-4316-8DC7-1A96B445F0AE}"
1513
EndProject
@@ -25,10 +23,6 @@ Global
2523
Release|Any CPU = Release|Any CPU
2624
EndGlobalSection
2725
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28-
{D729374E-250F-4472-AF37-3579002969EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29-
{D729374E-250F-4472-AF37-3579002969EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
30-
{D729374E-250F-4472-AF37-3579002969EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
31-
{D729374E-250F-4472-AF37-3579002969EC}.Release|Any CPU.Build.0 = Release|Any CPU
3226
{623EB4EA-907F-4650-AB13-5F9BE39B6A8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3327
{623EB4EA-907F-4650-AB13-5F9BE39B6A8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
3428
{623EB4EA-907F-4650-AB13-5F9BE39B6A8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -52,7 +46,6 @@ Global
5246
HideSolutionNode = FALSE
5347
EndGlobalSection
5448
GlobalSection(NestedProjects) = preSolution
55-
{D729374E-250F-4472-AF37-3579002969EC} = {9955EE7F-B7DF-4AF7-99E1-E17572BFB61D}
5649
{623EB4EA-907F-4650-AB13-5F9BE39B6A8C} = {9955EE7F-B7DF-4AF7-99E1-E17572BFB61D}
5750
{D5233C43-C155-476C-92FD-436842364008} = {9955EE7F-B7DF-4AF7-99E1-E17572BFB61D}
5851
{D8732E0B-60EA-4619-A8E8-8F6E12342780} = {289AEDBE-E0C7-4BAD-96E1-928F794759E1}

src/DotnetDispatcher.Attributes/DotnetDispatcher.Attributes.csproj

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

src/DotnetDispatcher.Attributes/GenerateDispatcherAttribute.cs

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

src/DotnetDispatcher.Generator/DotnetDispatcher.Generator.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageProjectUrl>https://github.com/psimsa/dotnet-dispatcher</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/psimsa/dotnet-dispatcher</RepositoryUrl>
1414
<Product>$(AssemblyName)</Product>
15-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
15+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1616
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1717
<PackageReadmeFile>README.md</PackageReadmeFile>
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -35,7 +35,4 @@
3535
<PackagePath>\</PackagePath>
3636
</None>
3737
</ItemGroup>
38-
<ItemGroup>
39-
<ProjectReference Include="..\DotnetDispatcher.Attributes\DotnetDispatcher.Attributes.csproj" />
40-
</ItemGroup>
4138
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
3+
namespace DotnetDispatcher.Attributes;
4+
5+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
6+
public class GenerateDispatcherAttribute : Attribute
7+
{
8+
private readonly Type _handlerType;
9+
private readonly Type _queryType;
10+
11+
public GenerateDispatcherAttribute(Type queryType)
12+
{
13+
_queryType = queryType;
14+
}
15+
16+
public GenerateDispatcherAttribute(Type queryType, Type handlerType)
17+
{
18+
_queryType = queryType;
19+
_handlerType = handlerType;
20+
}
21+
}

0 commit comments

Comments
 (0)