Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BBT-mmarkovic committed Mar 21, 2023
2 parents d8e990a + ffd94f4 commit 97236df
Show file tree
Hide file tree
Showing 30 changed files with 240 additions and 233 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ jobs:

- name: Package NuGet
run: |
nuget pack ../nuspec/nuget/BBT.StructureTools.nuspec
nuget pack ../nuspec/nuget/BBT.StructureTools.Extensions.nuspec
dotnet pack -c $BUILD_CONFIG -p:PackageVersion=$BUILD_VERSION
- name: Publish NuGet
run: |
nuget push ./BBT.StructureTools.$BUILD_VERSION.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORG}}
nuget push ./BBT.StructureTools.Extensions.$BUILD_VERSION.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORG}}
nuget push ./BBT.StructureTools/bin/Release/BBT.StructureTools.$BUILD_VERSION.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORG}}
nuget push ./BBT.StructureTools.Extensions/bin/Release/BBT.StructureTools.Extensions.$BUILD_VERSION.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORG}}
32 changes: 0 additions & 32 deletions nuspec/nuget/BBT.StructureTools.Extensions.nuspec

This file was deleted.

32 changes: 0 additions & 32 deletions nuspec/nuget/BBT.StructureTools.nuspec

This file was deleted.

Binary file removed nuspec/nuget/icon.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<AssemblyTitle>BBT.StructureTools.Extensions</AssemblyTitle>
<CodeAnalysisRuleSet>..\BBT.StructureTools.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\$(Configuration)\BBT.StructureTools.XML</DocumentationFile>
<DocumentationFile>bin\$(Configuration)\BBT.StructureTools.xml</DocumentationFile>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup>
<Title>BBT.StructureTools.Extensions</Title>
<Title>BBT StructureTools Extensions</Title>
<Description>Extensions to BBT.StructureTools (e.g. implementations of ICreateConvertHelper and IConvertHelperFactory interfaces).</Description>
<Product>BBT.StructureTools</Product>
<Company>BBT Software AG</Company>
<Authors>BBT Software AG</Authors>
<Copyright>Copyright © BBT Software AG</Copyright>
<PackageTags>copy compare convert</PackageTags>
<PackageId>BBT.StructureTools.Extensions</PackageId>
<PackageTags>StructureTools Functional</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>http://bbtsoftware.github.io/BBT.StructureTools/</PackageProjectUrl>
<PackageProjectUrl>https://github.com/bbtsoftware/BBT.StructureTools/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/bbtsoftware/BBT.StructureTools.git</RepositoryUrl>
<PackageReleaseNotes>https://github.com/bbtsoftware/BBT.StructureTools/releases/tag/2.0.1</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/bbtsoftware/BBT.StructureTools/releases/tag/3.0.0</PackageReleaseNotes>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb;.xml</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -32,16 +35,13 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BBT.StructureTools\BBT.StructureTools.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="icon.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ public CreateConvertFromStrategyHelper(IGenericStrategyProvider<ICreateConvertSt
}

/// <inheritdoc/>
public TTarget CreateTarget(TSource source, ICollection<IBaseAdditionalProcessing> additionalProcessings)
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
source.NotNull(nameof(source));
additionalProcessings.NotNull(nameof(additionalProcessings));
var strategy = this.strategyProvider.GetStrategy(source);
strategy.Convert(source, target, additionalProcessings);
}

/// <inheritdoc/>
public TTarget Create(TSource source)
{
var strategy = this.strategyProvider.GetStrategy(source);

var concreteTarget = strategy.CreateTarget(source);
strategy.Convert(source, concreteTarget, additionalProcessings);

return concreteTarget;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ public CreateConvertFromStrategyHelperReverse(IGenericStrategyProvider<ICreateCo
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
TReverseRelation reverseRelation,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
source.NotNull(nameof(source));
reverseRelation.NotNull(nameof(reverseRelation));
var strategy = this.strategyProvider.GetStrategy(source);
strategy.Convert(source, target, additionalProcessings);
}

/// <inheritdoc/>
public TTarget Create(TSource source, TReverseRelation reverseRelation)
{
var strategy = this.strategyProvider.GetStrategy(source);
var concreteTarget = strategy.CreateTarget(source);
concreteTarget.SetPropertyValue(this.reverseRelationExpr, reverseRelation);
strategy.Convert(source, concreteTarget, additionalProcessings);

return concreteTarget;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,18 @@ public void SetupReverseRelation(Expression<Func<TTarget, TReverseRelation>> rev
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
TReverseRelation reverseRelation,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public TTarget Create(TSource source, TReverseRelation reverseRelation)
{
source.NotNull(nameof(source));
reverseRelation.NotNull(nameof(reverseRelation));
additionalProcessings.NotNull(nameof(additionalProcessings));

var target = this.instanceCreator.Create();
target.SetPropertyValue(this.reverseRelationExpr, reverseRelation);
this.convert.Convert(source, target, additionalProcessings);
return target;
}

/// <inheritdoc/>
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
this.convert.Convert(source, target, additionalProcessings);
}
}

/// <inheritdoc/>
Expand Down Expand Up @@ -92,15 +90,15 @@ public CreateTargetConvertTargetHelper(
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
source.NotNull(nameof(source));
additionalProcessings.NotNull(nameof(additionalProcessings));
this.convert.Convert(source, target, additionalProcessings);
}

/// <inheritdoc/>
public TTarget Create(TSource source)
{
var target = this.instanceCreator.Create();
this.convert.Convert(source, target, additionalProcessings);
return target;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,18 @@ public void SetupReverseRelation(Expression<Func<TTarget, TReverseRelation>> rev
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
TReverseRelation reverseRelation,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public TTarget Create(TSource source, TReverseRelation reverseRelation)
{
source.NotNull(nameof(source));
reverseRelation.NotNull(nameof(reverseRelation));
additionalProcessings.NotNull(nameof(additionalProcessings));

var target = this.instanceCreator.Create();
target.SetPropertyValue(this.reverseRelationExpr, reverseRelation);
this.convert.Convert(source, target, additionalProcessings);
return target;
}

/// <inheritdoc/>
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
this.convert.Convert(source, target, additionalProcessings);
}
}

/// <inheritdoc/>
Expand Down Expand Up @@ -93,15 +91,15 @@ public CreateTargetImplConvertTargetHelper(
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
source.NotNull(nameof(source));
additionalProcessings.NotNull(nameof(additionalProcessings));
this.convert.Convert(source, target, additionalProcessings);
}

/// <inheritdoc/>
public TTarget Create(TSource source)
{
var target = this.instanceCreator.Create();
this.convert.Convert(source, target, additionalProcessings);
return target;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public CreateTargetImplConvertTargetImplHelper(
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public void Convert(TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
source.NotNull(nameof(source));
additionalProcessings.NotNull(nameof(additionalProcessings));
this.convert.Convert(source, (TTargetImpl)target, additionalProcessings);
}

/// <inheritdoc/>
public TTarget Create(TSource source)
{
var target = this.instanceCreator.Create();
this.convert.Convert(source, target, additionalProcessings);

return target;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,19 @@ public void SetupReverseRelation(Expression<Func<TTarget, TReverseRelation>> rev
}

/// <inheritdoc/>
public TTarget CreateTarget(
TSource source,
TReverseRelation reverseRelation,
ICollection<IBaseAdditionalProcessing> additionalProcessings)
public TTarget Create(TSource source, TReverseRelation reverseRelation)
{
source.NotNull(nameof(source));
reverseRelation.NotNull(nameof(reverseRelation));
additionalProcessings.NotNull(nameof(additionalProcessings));

var target = this.instanceCreator.Create();
target.SetPropertyValue(this.reverseRelationExpr, reverseRelation);
this.convert.Convert(source, target, additionalProcessings);

return target;
}

/// <inheritdoc/>
public void Convert(
TSource source, TTarget target, ICollection<IBaseAdditionalProcessing> additionalProcessings)
{
this.convert.Convert(source, (TTargetImpl)target, additionalProcessings);
}
}
}
4 changes: 2 additions & 2 deletions src/BBT.StructureTools.Tests/BBT.StructureTools.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.9.0">
<PackageReference Include="FluentAssertions" Version="6.10.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert()

var processings = new List<IBaseAdditionalProcessing>();
var source = new SourceDerivedLeaf();
var target = testCandidate.CreateTarget(source, processings);
var target = testCandidate.Create(source);
testCandidate.Convert(source, target, processings);

target.Should().NotBeNull();
target.Should().BeOfType<TargetDerivedLeaf>();
Expand All @@ -55,7 +56,8 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert()
var processings = new List<IBaseAdditionalProcessing>();
var source = new SourceDerivedLeaf();
var reverseRelation = new TargetRoot();
var target = testCandidate.CreateTarget(source, reverseRelation, processings);
var target = testCandidate.Create(source, reverseRelation);
testCandidate.Convert(source, target, processings);

target.Should().NotBeNull();
target.Should().BeOfType<TargetDerivedLeaf>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public void CreateTarget_NoReverseRelation_CreateAndConvert()

var processings = new List<IBaseAdditionalProcessing>();
var source = new SourceTreeLeaf();
var target = testCandidate.CreateTarget(source, processings);
var target = testCandidate.Create(source);
testCandidate.Convert(source, target, processings);

target.Should().NotBeNull();
target.OriginId.Should().Be(source.Id);
Expand All @@ -48,7 +49,8 @@ public void CreateTarget_WithReverseRelation_CreateAndConvert()
var processings = new List<IBaseAdditionalProcessing>();
var source = new SourceTreeLeaf();
var reverseRelation = new TargetTree();
var target = testCandidate.CreateTarget(source, reverseRelation, processings);
var target = testCandidate.Create(source, reverseRelation);
testCandidate.Convert(source, target, processings);

target.Should().NotBeNull();
target.OriginId.Should().Be(source.Id);
Expand Down
Loading

0 comments on commit 97236df

Please sign in to comment.