Skip to content

Commit

Permalink
Fixed versioning. (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgernand authored Dec 17, 2021
1 parent 8298bdd commit 33cce8e
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 221 deletions.
5 changes: 0 additions & 5 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
next-version: 6.0.0
mode: Mainline

branches:
master:
regex: ^master$|^main$
72 changes: 6 additions & 66 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,31 @@ trigger:

variables:
BuildConfiguration: Release
DotNetCoreVersion: 6.0.100
DotNetCoreVersion: 6.0.101

stages:
- stage: BuildAndTest
jobs:
- job: BuildAndTest
pool:
vmImage: 'windows-latest'
name: Default
steps:
- checkout: self
persistCredentials: 'true'
clean: true
# Run GitVersion to acquire the current build version.
- task: GitVersion@5
displayName: 'Acquire and Apply Version'
inputs:
updateAssemblyInfo: true
updateAssemblyInfoFilename: 'src/SolutionInfo.cs'
additionalArguments: '/ensureassemblyinfo'
configFilePath: 'GitVersion.yml'
# Install the desired .NET SDK.
- task: UseDotNet@2
displayName: 'Acquire .NET SDK'
inputs:
packageType: 'sdk'
version: $(DotNetCoreVersion)
includePreviewVersions: true
includePreviewVersions: false
# Build all projects.
- task: DotNetCoreCLI@2
displayName: 'Build Projects'
inputs:
projects: '**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
nugetConfigPath: NuGet.config
# Run all available tests.
- task: DotNetCoreCLI@2
displayName: 'Execute Tests'
Expand All @@ -49,70 +40,19 @@ stages:
projects: '**/*Tests/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
nobuild: true
# Set the version to a environment variable. This will be used in the NuGet pack task.
- script: echo %Action%%SemVerEnv%
displayName: 'Set Package Version Variable'
env:
Action: '##vso[task.setvariable variable=NuGetPackageVersion]'
SemVerEnv: $(GitVersion.SemVer)
# Create the NuGet packages.
- task: DotNetCoreCLI@2
displayName: 'NuGet Pack Packages'
displayName: 'Pack Packages'
inputs:
command: 'pack'
packagesToPack: 'src/**/*.csproj'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'NuGetPackageVersion'
verbosityPack: Minimal
includesymbols: false
# Copy created NuGet packages to the builds artifacts directory.
- task: PublishBuildArtifacts@1
displayName: 'NuGet Publish Package Artifacts'
displayName: 'Publish Package Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
#- stage: DeployPackages
# dependsOn: BuildAndTest
# # Only publish packages for main, develop (alpha) and release (beta) branches.
# condition: and(succeeded('BuildAndTest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
# jobs:
# - job: DeployPackages
# pool:
# vmImage: 'windows-latest'
# steps:
# - checkout: self
# persistCredentials: 'true'
# clean: true
# # Run GitVersion to acquire the current build version.
# - task: GitVersion@5
# displayName: 'Acquire and Apply Version'
# inputs:
# updateAssemblyInfo: false
# configFilePath: 'GitVersion.yml'
# # Download the created packages.
# - task: DownloadBuildArtifacts@0
# inputs:
# buildType: 'current'
# downloadType: 'single'
# artifactName: 'drop'
# downloadPath: '$(System.ArtifactsDirectory)'
# # Publish the NuGet packages to the package feed.
# # https://www.programmingwithwolfgang.com/azure-devops-publish-nuget/
# - task: DotNetCoreCLI@2
# condition: not(contains(variables['Build.BuildNumber'], '-ci'))
# displayName: 'NuGet Push Packages'
# inputs:
# command: custom
# custom: nuget
# arguments: >
# push $(System.ArtifactsDirectory)/**/*.nupkg
# -s https://api.nuget.org/v3/index.json
# -k $(NuGetApiKey)
# #command: 'push'
# #packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg'
# #nuGetFeedType: 'external'
# #publishFeedCredentials: 'Foundation'
# #verbosityRestore: Normal
# #includesymbols: false
publishLocation: 'Container'
18 changes: 9 additions & 9 deletions Directory.Build.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

<PropertyGroup>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<Company>Fluxera Software Development GmbH</Company>
<Copyright>Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.</Copyright>
<Product>Fluxera Software Foundation</Product>
</PropertyGroup>

<PropertyGroup>
<Version>6.0.0</Version>
<AssemblyVersion>6.0.0</AssemblyVersion>
<FileVersion>6.0.0</FileVersion>
<Copyright>Copyright © 2014-2021 Fluxera Software Development GmbH. All rights reserved.</Copyright>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -30,7 +25,12 @@
<NeutralLanguage>en</NeutralLanguage>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>

<Target Name="Update Version" BeforeTargets="Build" Condition="'$(TF_BUILD)' == 'true'">
<Message Text="Version = $(GITVERSION_FullSemVer)" Importance="High" />
<Message Text="##vso[build.updatebuildnumber]$(GITVERSION_FullSemVer)" Importance="High" />
</Target>

</Project>
10 changes: 0 additions & 10 deletions src/Fluxera.Entity/AggregateRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
{
using JetBrains.Annotations;

/// <summary>
/// A base class for all aggregate root entities. Uses <see cref="string"/> as type for the ID.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
[PublicAPI]
public abstract class AggregateRoot<TAggregateRoot> : Entity<TAggregateRoot>
where TAggregateRoot : AggregateRoot<TAggregateRoot>
{
}

/// <summary>
/// A base class for all aggregate root entities.
/// </summary>
Expand Down
38 changes: 14 additions & 24 deletions src/Fluxera.Entity/DomainEvents/ItemAdded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,28 @@
{
using JetBrains.Annotations;

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}"/>
/// has been added to the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}" />
/// has been added to the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
[PublicAPI]
public sealed class ItemAdded<TAggregateRoot, TKey> : IDomainEvent
public sealed class ItemAdded<TAggregateRoot, TKey> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot, TKey>
{
/// <summary>
/// Creates a new instance of the <see cref="ItemAdded{TAggregateRoot,TKey}" /> type.
/// </summary>
/// <param name="item">The underlying item of this event.</param>
public ItemAdded(TAggregateRoot item)
{
this.Item = item;
}

public TAggregateRoot Item { get; }
}

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot}"/>
/// has been added to the data storage. This event uses a <see cref="string"/> for the ID type.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
[PublicAPI]
public sealed class ItemAdded<TAggregateRoot> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot>
{
public ItemAdded(TAggregateRoot item)
{
this.Item = item;
}

/// <summary>
/// Gets the underlying item.
/// </summary>
public TAggregateRoot Item { get; }
}
}
49 changes: 20 additions & 29 deletions src/Fluxera.Entity/DomainEvents/ItemRemoved.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,35 @@ namespace Fluxera.Entity.DomainEvents
{
using JetBrains.Annotations;

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}"/>
/// has been removed to the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}" />
/// has been removed to the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
[PublicAPI]
public sealed class ItemRemoved<TAggregateRoot, TKey> : IDomainEvent
public sealed class ItemRemoved<TAggregateRoot, TKey> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot, TKey>
{
public ItemRemoved(TAggregateRoot item, string id)
/// <summary>
/// Creates a new instance of the <see cref="ItemRemoved{TAggregateRoot,TKey}" /> type.
/// </summary>
/// <param name="item">The underlying item of this event.</param>
/// <param name="id">The id of the underlying item of this event.</param>
public ItemRemoved(TAggregateRoot item, TKey id)
{
this.Item = item;
this.ID = id;
}

/// <summary>
/// Gets the underlying item.
/// </summary>
public TAggregateRoot Item { get; }

public string ID { get; }
}

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot}"/>
/// has been removed to the data storage. This event uses a <see cref="string"/> for the ID type.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
[PublicAPI]
public sealed class ItemRemoved<TAggregateRoot> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot>
{
public ItemRemoved(TAggregateRoot item, string id)
{
this.Item = item;
this.ID = id;
}

public TAggregateRoot Item { get; }

public string ID { get; }
/// <summary>
/// Gets the id of underlying item.
/// </summary>
public TKey ID { get; }
}
}
38 changes: 14 additions & 24 deletions src/Fluxera.Entity/DomainEvents/ItemUpdated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,28 @@
{
using JetBrains.Annotations;

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}"/>
/// has been updated in the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot, TKey}" />
/// has been updated in the data storage.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
/// <typeparam name="TKey">The ID type.</typeparam>
[PublicAPI]
public sealed class ItemUpdated<TAggregateRoot, TKey> : IDomainEvent
public sealed class ItemUpdated<TAggregateRoot, TKey> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot, TKey>
{
/// <summary>
/// Creates a new instance of the <see cref="ItemUpdated{TAggregateRoot,TKey}" /> type.
/// </summary>
/// <param name="item">The underlying item of this event.</param>
public ItemUpdated(TAggregateRoot item)
{
this.Item = item;
}

public TAggregateRoot Item { get; }
}

/// <summary>
/// A domain event that indicates that a new item of <see cref="AggregateRoot{TAggregateRoot}"/>
/// has been updated in the data storage. This event uses a <see cref="string"/> for the ID type.
/// </summary>
/// <typeparam name="TAggregateRoot">The aggregate root type.</typeparam>
[PublicAPI]
public sealed class ItemUpdated<TAggregateRoot> : IDomainEvent
where TAggregateRoot : AggregateRoot<TAggregateRoot>
{
public ItemUpdated(TAggregateRoot item)
{
this.Item = item;
}

/// <summary>
/// Gets the underlying item.
/// </summary>
public TAggregateRoot Item { get; }
}
}
Loading

0 comments on commit 33cce8e

Please sign in to comment.