Skip to content

Commit 816e40e

Browse files
authored
v1.0.0
Release v1.0.0
2 parents 91d816d + 2401c8e commit 816e40e

File tree

8 files changed

+718
-1
lines changed

8 files changed

+718
-1
lines changed

GitVersion.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mode: ContinuousDelivery
2+
next-version: 1.0.0
3+
branches: {}
4+
ignore:
5+
sha: []

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Xer.Cqrs.EventStack.Extensions.Attributes
2+
Attribute registration extension for Xer.Cqrs.EventStack
3+
4+
# Build
5+
| Branch | Status |
6+
|--------|--------|
7+
| Master | [![Build status](https://ci.appveyor.com/api/projects/status/91k3s51cguc7qcrb?svg=true)](https://ci.appveyor.com/project/XerProjects25246/xer-cqrs-eventstack-extensions-attributes) |
8+
| Dev | [![Build status](https://ci.appveyor.com/api/projects/status/91k3s51cguc7qcrb/branch/dev?svg=true)](https://ci.appveyor.com/project/XerProjects25246/xer-cqrs-eventstack-extensions-attributes/branch/dev) |
9+
10+
# Nuget
11+
[![NuGet](https://img.shields.io/nuget/vpre/xer.cqrs.eventstack.extensions.attributes.svg)](https://www.nuget.org/packages/Xer.Cqrs.EventStack.Extensions.Attributes/)

Src/Xer.Cqrs.EventStack.Extensions.Attributes/Xer.Cqrs.EventStack.Extensions.Attributes.csproj

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

33
<PropertyGroup>
44
<TargetFramework>netstandard1.0</TargetFramework>
5+
<Authors>jeyjeyemem;mvput;xerprojects-contributors;</Authors>
6+
<Description>A very simple library for handling events on applications based on the CQRS pattern.</Description>
7+
<Copyright>Copyright (c) XerProjects contributors</Copyright>
8+
<PackageLicenseUrl>https://github.com/XerProjects/Xer.Cqrs.EventStack.Extensions.Attributes/blob/master/LICENSE</PackageLicenseUrl>
9+
<PackageProjectUrl>https://github.com/XerProjects/Xer.Cqrs.EventStack.Extensions.Attributes</PackageProjectUrl>
10+
<PackageTags>cqrs;attribute;domain-event;eventing;event;event-handler;event-message;</PackageTags>
511
</PropertyGroup>
612

713
<ItemGroup>
8-
<PackageReference Include="Xer.Delegator" Version="0.4.0" />
14+
<PackageReference Include="Xer.Delegator" Version="1.0.0" />
915
</ItemGroup>
1016

1117
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<metadata>
4+
<id>Xer.Cqrs.EventStack.Extensions.Attributes</id>
5+
<version>1.0.0</version>
6+
<title>Xer.Cqrs.EventStack.Extensions.Attributes</title>
7+
<authors>jeyjeyemem</authors>
8+
<owners>jeyjeyemem</owners>
9+
<licenseUrl>https://github.com/XerProjects/Xer.Cqrs.EventStack.Extensions.Attributes/blob/master/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/XerProjects/Xer.Cqrs.EventStack.Extensions.Attributes</projectUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>Attribute-based registration extension for Xer.Cqrs.EventStack.</description>
13+
<summary>Attribute-based registration extension for Xer.Cqrs.EventStack.</summary>
14+
<releaseNotes>
15+
- Initial release
16+
</releaseNotes>
17+
<copyright>Copyright 2017</copyright>
18+
<tags>CQRS Event Handler Attribute</tags>
19+
</metadata>
20+
<files>
21+
<file src="bin\Release\netstandard1.0\*.dll" target="lib\netstandard1.0" />
22+
</files>
23+
</package>

Tools/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Cake" version="0.26.1" />
4+
</packages>

build.cake

Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// ADDINS/TOOLS
3+
///////////////////////////////////////////////////////////////////////////////
4+
#tool "nuget:?package=GitVersion.CommandLine"
5+
#addin nuget:?package=Cake.Git
6+
7+
///////////////////////////////////////////////////////////////////////////////
8+
// ARGUMENTS
9+
///////////////////////////////////////////////////////////////////////////////
10+
11+
var target = Argument<string>("target", "Default");
12+
var configuration = Argument<string>("configuration", "Release");
13+
14+
///////////////////////////////////////////////////////////////////////////////
15+
// GLOBAL VARIABLES
16+
///////////////////////////////////////////////////////////////////////////////
17+
18+
var solutions = GetFiles("./**/*.sln");
19+
var projects = GetFiles("./**/*.csproj").Select(x => x.GetDirectory());
20+
21+
GitVersion gitVersion;
22+
23+
///////////////////////////////////////////////////////////////////////////////
24+
// SETUP / TEARDOWN
25+
///////////////////////////////////////////////////////////////////////////////
26+
27+
Setup(context =>
28+
{
29+
gitVersion = GitVersion(new GitVersionSettings {
30+
UpdateAssemblyInfo = true
31+
});
32+
33+
BuildParameters.Initialize(Context);
34+
35+
// Executed BEFORE the first task.
36+
Information("Xer.Cqrs.EventStack.Extensions.Attributes");
37+
Information("Parameters");
38+
Information("///////////////////////////////////////////////////////////////////////////////");
39+
Information("Branch: {0}", BuildParameters.Instance.BranchName);
40+
Information("Version semver: {0}", gitVersion.LegacySemVerPadded);
41+
Information("Version assembly: {0}", gitVersion.MajorMinorPatch);
42+
Information("Version informational: {0}", gitVersion.InformationalVersion);
43+
Information("Master branch: {0}", BuildParameters.Instance.IsMasterBranch);
44+
Information("Dev branch: {0}", BuildParameters.Instance.IsDevBranch);
45+
Information("Hotfix branch: {0}", BuildParameters.Instance.IsHotFixBranch);
46+
Information("Publish to myget: {0}", BuildParameters.Instance.ShouldPublishMyGet);
47+
Information("Publish to nuget: {0}", BuildParameters.Instance.ShouldPublishNuGet);
48+
Information("///////////////////////////////////////////////////////////////////////////////");
49+
});
50+
51+
Teardown(context =>
52+
{
53+
// Executed AFTER the last task.
54+
Information("Finished running tasks.");
55+
});
56+
57+
///////////////////////////////////////////////////////////////////////////////
58+
// TASK DEFINITIONS
59+
///////////////////////////////////////////////////////////////////////////////
60+
61+
Task("Clean")
62+
.Description("Cleans all directories that are used during the build process.")
63+
.Does(() =>
64+
{
65+
if (projects.Count() == 0)
66+
{
67+
Information("No projects found.");
68+
return;
69+
}
70+
71+
// Clean solution directories.
72+
foreach (var project in projects)
73+
{
74+
Information("Cleaning {0}", project);
75+
DotNetCoreClean(project.FullPath);
76+
}
77+
});
78+
79+
Task("Restore")
80+
.Description("Restores all the NuGet packages that are used by the specified solution.")
81+
.Does(() =>
82+
{
83+
if (solutions.Count() == 0)
84+
{
85+
Information("No solutions found.");
86+
return;
87+
}
88+
89+
var settings = new DotNetCoreRestoreSettings
90+
{
91+
ArgumentCustomization = args => args
92+
.Append("/p:Version={0}", gitVersion.LegacySemVerPadded)
93+
.Append("/p:AssemblyVersion={0}", gitVersion.MajorMinorPatch)
94+
.Append("/p:FileVersion={0}", gitVersion.MajorMinorPatch)
95+
.Append("/p:AssemblyInformationalVersion={0}", gitVersion.InformationalVersion)
96+
};
97+
98+
// Restore all NuGet packages.
99+
foreach (var solution in solutions)
100+
{
101+
Information("Restoring {0}...", solution);
102+
103+
DotNetCoreRestore(solution.FullPath, settings);
104+
}
105+
});
106+
107+
Task("Build")
108+
.Description("Builds all the different parts of the project.")
109+
.IsDependentOn("Clean")
110+
.IsDependentOn("Restore")
111+
.Does(() =>
112+
{
113+
if (solutions.Count() == 0)
114+
{
115+
Information("No solutions found.");
116+
return;
117+
}
118+
119+
var settings = new DotNetCoreBuildSettings
120+
{
121+
Configuration = configuration,
122+
ArgumentCustomization = args => args
123+
.Append("/p:Version={0}", gitVersion.LegacySemVerPadded)
124+
.Append("/p:AssemblyVersion={0}", gitVersion.MajorMinorPatch)
125+
.Append("/p:FileVersion={0}", gitVersion.MajorMinorPatch)
126+
.Append("/p:AssemblyInformationalVersion={0}", gitVersion.InformationalVersion)
127+
};
128+
129+
// Build all solutions.
130+
foreach (var solution in solutions)
131+
{
132+
Information("Building {0}", solution);
133+
134+
DotNetCoreBuild(solution.FullPath, settings);
135+
}
136+
});
137+
138+
Task("Test")
139+
.Description("Execute all unit test projects.")
140+
.IsDependentOn("Build")
141+
.Does(() =>
142+
{
143+
var projects = GetFiles("./Tests/**/*.Tests.csproj");
144+
145+
if (projects.Count == 0)
146+
{
147+
Information("No test projects found.");
148+
return;
149+
}
150+
151+
var settings = new DotNetCoreTestSettings
152+
{
153+
Configuration = configuration,
154+
NoBuild = true,
155+
};
156+
157+
foreach (var project in projects)
158+
{
159+
DotNetCoreTest(project.FullPath, settings);
160+
}
161+
});
162+
163+
Task("Pack")
164+
.IsDependentOn("Test")
165+
.Does(() =>
166+
{
167+
var projects = GetFiles("./src/**/*.csproj");
168+
169+
if (projects.Count() == 0)
170+
{
171+
Information("No projects found.");
172+
return;
173+
}
174+
175+
var settings = new DotNetCorePackSettings
176+
{
177+
OutputDirectory = "./BuildArtifacts",
178+
NoBuild = true,
179+
Configuration = configuration,
180+
ArgumentCustomization = (args) => args
181+
.Append("/p:Version={0}", gitVersion.LegacySemVerPadded)
182+
.Append("/p:AssemblyVersion={0}", gitVersion.MajorMinorPatch)
183+
.Append("/p:FileVersion={0}", gitVersion.MajorMinorPatch)
184+
.Append("/p:AssemblyInformationalVersion={0}", gitVersion.InformationalVersion)
185+
};
186+
187+
foreach (var project in projects)
188+
{
189+
DotNetCorePack(project.ToString(), settings);
190+
}
191+
});
192+
193+
Task("PublishMyGet")
194+
.WithCriteria(() => BuildParameters.Instance.ShouldPublishMyGet)
195+
.IsDependentOn("Pack")
196+
.Does(() =>
197+
{
198+
var nupkgs = GetFiles("./**/*.nupkg");
199+
200+
if (nupkgs.Count() == 0)
201+
{
202+
Information("No nupkgs found.");
203+
return;
204+
}
205+
206+
foreach (var nupkgFile in nupkgs)
207+
{
208+
Information("Pulishing to myget {0}", nupkgFile);
209+
210+
NuGetPush(nupkgFile, new NuGetPushSettings
211+
{
212+
Source = BuildParameters.Instance.MyGetFeed,
213+
ApiKey = BuildParameters.Instance.MyGetApiKey
214+
});
215+
}
216+
});
217+
218+
Task("PublishNuGet")
219+
.WithCriteria(() => BuildParameters.Instance.ShouldPublishNuGet)
220+
.IsDependentOn("Pack")
221+
.Does(() =>
222+
{
223+
var nupkgs = GetFiles("./**/*.nupkg");
224+
225+
if (nupkgs.Count() == 0)
226+
{
227+
Information("No nupkgs found.");
228+
return;
229+
}
230+
231+
foreach (var nupkgFile in nupkgs)
232+
{
233+
Information("Pulishing to nuget {0}", nupkgFile);
234+
NuGetPush(nupkgFile, new NuGetPushSettings
235+
{
236+
Source = BuildParameters.Instance.NuGetFeed,
237+
ApiKey = BuildParameters.Instance.NuGetApiKey
238+
});
239+
}
240+
});
241+
242+
243+
///////////////////////////////////////////////////////////////////////////////
244+
// TARGETS
245+
///////////////////////////////////////////////////////////////////////////////
246+
247+
Task("Default")
248+
.Description("This is the default task which will be ran if no specific target is passed in.")
249+
.IsDependentOn("PublishNuGet")
250+
.IsDependentOn("PublishMyGet");
251+
252+
///////////////////////////////////////////////////////////////////////////////
253+
// EXECUTION
254+
///////////////////////////////////////////////////////////////////////////////
255+
256+
RunTarget(target);
257+
258+
public class BuildParameters
259+
{
260+
private static BuildParameters _buildParameters;
261+
262+
public static BuildParameters Instance => _buildParameters;
263+
264+
private ICakeContext _context;
265+
266+
private BuildParameters(ICakeContext context)
267+
{
268+
_context = context;
269+
}
270+
271+
public static void Initialize(ICakeContext context)
272+
{
273+
if(_buildParameters != null)
274+
{
275+
return;
276+
}
277+
278+
_buildParameters = new BuildParameters(context);
279+
}
280+
281+
public bool IsAppVeyorBuild => _context.BuildSystem().AppVeyor.IsRunningOnAppVeyor;
282+
283+
public bool IsLocalBuild => _context.BuildSystem().IsLocalBuild;
284+
285+
public string BranchName
286+
{
287+
get
288+
{
289+
return IsLocalBuild
290+
? _context.GitBranchCurrent(".").FriendlyName
291+
: _context.BuildSystem().AppVeyor.Environment.Repository.Branch;
292+
}
293+
}
294+
295+
public string MyGetFeed => _context.EnvironmentVariable("MYGET_SOURCE");
296+
297+
public string MyGetApiKey => _context.EnvironmentVariable("MYGET_API_KEY");
298+
299+
public string NuGetFeed => _context.EnvironmentVariable("NUGET_SOURCE");
300+
301+
public string NuGetApiKey => _context.EnvironmentVariable("NUGET_API_KEY");
302+
303+
public bool IsMasterBranch => StringComparer.OrdinalIgnoreCase.Equals("master", BranchName);
304+
305+
public bool IsDevBranch => StringComparer.OrdinalIgnoreCase.Equals("dev", BranchName);
306+
307+
public bool IsReleaseBranch => BranchName.StartsWith("release", StringComparison.OrdinalIgnoreCase);
308+
309+
public bool IsHotFixBranch => BranchName.StartsWith("hotfix", StringComparison.OrdinalIgnoreCase);
310+
311+
public bool ShouldPublishMyGet => !string.IsNullOrWhiteSpace(MyGetApiKey) && !string.IsNullOrWhiteSpace(MyGetFeed);
312+
313+
public bool ShouldPublishNuGet => !string.IsNullOrWhiteSpace(NuGetApiKey)
314+
&& !string.IsNullOrWhiteSpace(NuGetFeed)
315+
&& (IsMasterBranch || IsHotFixBranch);
316+
}

0 commit comments

Comments
 (0)