-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2 refactoring & redesign to allow better customization. (#5)
* Refactoring & redesign. * Added azure pipelines yaml * Added badges * Coverage 80% * Added GitVersion
- Loading branch information
1 parent
0fb8084
commit 07abbc2
Showing
79 changed files
with
2,699 additions
and
1,052 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
bin | ||
obj | ||
.vs | ||
OfxClientIntegrationTests.cs | ||
OfxClientIntegrationTests.cs | ||
coverage.cobertura.xml | ||
.codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Project> | ||
<PropertyGroup> | ||
<SkipCodeCoverageReport Condition="$(SkipCodeCoverageReport) == ''">false</SkipCodeCoverageReport> | ||
<CoverletOutputFormat>cobertura</CoverletOutputFormat> | ||
<CollectCoverage>true</CollectCoverage> | ||
<ExcludeByFile>**/OFX_XSD_Generated.cs</ExcludeByFile> | ||
<!-- <Threshold>80</Threshold> --> | ||
<ThresholdType>line</ThresholdType> | ||
<ThresholdStat>total</ThresholdStat> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
<ItemGroup> | ||
<PackageReference Include="ReportGenerator" Version="4.3.6" > | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Target Name="GenerateCoverageReport" AfterTargets="GenerateCoverageResult" Condition="!$(SkipCodeCoverageReport)"> | ||
<ItemGroup> | ||
<CoverageFiles Include="coverage.cobertura.xml" /> | ||
</ItemGroup> | ||
<ReportGenerator ReportFiles="@(CoverageFiles)" TargetDirectory="../../.codecov" ReportTypes="Html" /> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
assembly-versioning-scheme: Major | ||
mode: ContinuousDeployment | ||
next-version: 2.0.0 | ||
increment: Patch | ||
legacy-semver-padding: 1 | ||
build-metadata-padding: 1 | ||
commits-since-version-source-padding: 1 | ||
continuous-delivery-fallback-tag: 'ci' | ||
branches: | ||
master: | ||
regex: master | ||
mode: ContinuousDeployment | ||
tag: '' | ||
increment: inherit | ||
prevent-increment-of-merged-branch-version: true | ||
tag-number-pattern: '[/-](?<number>\d+)[-/]' | ||
pull-request: | ||
regex: (pull|pull\-requests|pr)[/-] | ||
mode: ContinuousDeployment | ||
tag: "dev" | ||
increment: Patch | ||
tag-number-pattern: '[/-](?<number>\d+)[-/]' | ||
develop: | ||
regex: (!master)? | ||
mode: ContinuousDeployment | ||
tag: useBranchName | ||
increment: Patch | ||
ignore: | ||
sha: [] | ||
merge-message-formats: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
# ofx | ||
# ofx | ||
|
||
[![Nuget](https://img.shields.io/nuget/vpre/Mocoding.Ofx)](https://www.nuget.org/packages/Mocoding.Ofx) | ||
[![Build Status](https://dev.azure.com/mocoding/GitHub/_apis/build/status/mocoding-software.ofx?branchName=master)](https://dev.azure.com/mocoding/GitHub/_build/latest?definitionId=83&branchName=master) | ||
[![Code Coverage](https://img.shields.io/azure-devops/coverage/mocoding/GitHub/83/master)](https://dev.azure.com/mocoding/GitHub/_build?definitionId=83) | ||
![Nuget Downloads](https://img.shields.io/nuget/dt/Mocoding.Ofx) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# ASP.NET Core | ||
# Build and test ASP.NET Core projects targeting .NET Core. | ||
# Add steps that run tests, create a NuGet package, deploy, and more: | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core | ||
|
||
# name: $(majorVersion).$(minorVersion).$(patchVersion)$(channelVersion)$(buildVersion)$(Rev:.r) | ||
|
||
trigger: | ||
branches: | ||
include: | ||
- master | ||
tags: | ||
include: | ||
- v* | ||
|
||
pool: | ||
vmImage: "ubuntu-18.04" | ||
|
||
variables: | ||
buildConfiguration: "Release" | ||
projectName: "Mocoding.Ofx" | ||
solutionFile: "ofx.sln" | ||
# majorVersion: 2 | ||
# minorVersion: 0 | ||
# patchVersion: 0 | ||
# channelVersion: "-rc" | ||
# buildVersion: $[format('-{0}.build', variables['Build.SourceBranchName'])] | ||
|
||
steps: | ||
- task: UseGitVersion@5 | ||
inputs: | ||
versionSpec: '5.0.0' | ||
useConfigFile: true | ||
configFilePath: 'GitVersion.yml' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet restore" | ||
inputs: | ||
command: restore | ||
projects: $(solutionFile) | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet build" | ||
inputs: | ||
command: build | ||
projects: $(solutionFile) | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet test" | ||
inputs: | ||
command: test | ||
projects: 'test/**/*.Tests.csproj' | ||
arguments: "--no-build /p:SkipCodeCoverageReport=true /p:Threshold=80 /p:CoverletOutput=$(Agent.TempDirectory)/" | ||
|
||
- task: PublishCodeCoverageResults@1 | ||
displayName: "publish code coverage" | ||
inputs: | ||
codeCoverageTool: "Cobertura" | ||
summaryFileLocation: "$(Agent.TempDirectory)/*.xml" | ||
condition: succeededOrFailed() | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet pack $(projectName)" | ||
inputs: | ||
command: pack | ||
packagesToPack: "src/$(projectName)/$(projectName).csproj" | ||
configuration: $(buildConfiguration) | ||
packDirectory: "$(Build.StagingDirectory)/$(projectName)" | ||
buildProperties: "Version=$(Build.BuildNumber)" | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet pack $(projectName).Client" | ||
inputs: | ||
command: pack | ||
packagesToPack: "src/$(projectName).Client/$(projectName).Client.csproj" | ||
configuration: $(buildConfiguration) | ||
packDirectory: "$(Build.StagingDirectory)/$(projectName)" | ||
buildProperties: "Version=$(Build.BuildNumber)" | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: "dotnet pack $(projectName).Client.Discover" | ||
inputs: | ||
command: pack | ||
packagesToPack: "src/$(projectName).Client.Discover/$(projectName).Client.Discover.csproj" | ||
configuration: $(buildConfiguration) | ||
packDirectory: "$(Build.StagingDirectory)/$(projectName)" | ||
buildProperties: "Version=$(Build.BuildNumber)" | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: "Publish Artifact: nupkg" | ||
inputs: | ||
PathtoPublish: "$(Build.StagingDirectory)" | ||
ArtifactName: nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
version: "2.4" | ||
|
||
services: | ||
devbox: | ||
devbox: &devbox | ||
image: mocoding/ofx | ||
command: /bin/sh | ||
build: | ||
context: ./ | ||
dockerfile: docker/Dockerfile | ||
volumes: | ||
- .:/app | ||
- .:/app | ||
|
||
test: | ||
<<: *devbox |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@startuml | ||
|
||
skinparam componentStyle uml2 | ||
|
||
' hide class circle | ||
' hide interface circle | ||
' hide abstract circle | ||
' hide enum circle | ||
|
||
' hide fields | ||
|
||
hide interface fields | ||
hide class fields | ||
hide abstract fields | ||
hide enum methods | ||
|
||
|
||
enum OfxVersionEnum { | ||
Version1x= 1, | ||
Version2x= 2, | ||
} | ||
|
||
interface IOfxSerializer | ||
{ | ||
Serialize(model: OFX) : string | ||
Deserialize(intputString: string) : OFX | ||
} | ||
|
||
interface IOfxSerializerFactory { | ||
IOfxSerializer Create(version: OfxVersionEnum) | ||
} | ||
|
||
abstract class BaseSerializer { | ||
+ {abstract} Serialize(model:OFX) : string | ||
+ {abstract} Deserialize(inputString:string) : OFX | ||
|
||
# SerializeInternal(request:OFX) : string | ||
# DeserializeInternal(input:string) : OFX | ||
} | ||
|
||
class XmlSerializer { | ||
+ <<override>> Serialize(model:OFX) : string | ||
+ <<override>> Deserialize(inputString:string) : OFX | ||
} | ||
|
||
class SgmlSerializer { | ||
+ <<override>> Serialize(model:OFX) : string | ||
+ <<override>> Deserialize(inputString:string) : OFX | ||
} | ||
|
||
class DefaultOfxSerializerFactory { | ||
+ Create(version:OfxVersionEnum) : IOfxSerializer | ||
} | ||
|
||
IOfxSerializer <|--- BaseSerializer | ||
IOfxSerializerFactory <|--- DefaultOfxSerializerFactory | ||
BaseSerializer <|--- XmlSerializer | ||
BaseSerializer <|--- SgmlSerializer | ||
|
||
IOfxSerializerFactory -right-> IOfxSerializer | ||
|
||
center footer @ Mocoding 2019 | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.