From 12b797b2f97b0dc3161311241594eebabed5f32e Mon Sep 17 00:00:00 2001 From: pjoiner Date: Sat, 16 Sep 2023 14:50:23 -0500 Subject: [PATCH 1/8] Moved metadata builders to Builders namespace --- src/DWC_A/ArchiveWriter.cs | 1 - .../{Meta => Builders}/ArchiveMetaDataBuilder.cs | 14 +++++++------- .../{Meta => Builders}/CoreFileMetaDataBuilder.cs | 5 +++-- .../ExtensionFileMetaDataBuilder.cs | 3 ++- .../{Meta => Builders}/FieldMetaDataBuilder.cs | 4 +++- .../{Meta => Builders}/FieldsMetaDataBuilder.cs | 7 ++++--- src/Tests/ArchiveMetaDataBuilderTests.cs | 1 - src/Tests/ArchiveWriterFixture.cs | 2 +- src/Tests/ArchiveWriterTests.cs | 1 - src/Tests/CoreFileMetaDataBuilderTests.cs | 2 +- src/Tests/ExtensionFileMetadataBuilderTests.cs | 2 +- src/Tests/FieldMetaDataBuilderTests.cs | 3 ++- src/Tests/GetListExtensionsTests.cs | 3 ++- src/Tests/Tests.csproj | 12 ++++++------ 14 files changed, 32 insertions(+), 28 deletions(-) rename src/DWC_A/{Meta => Builders}/ArchiveMetaDataBuilder.cs (89%) rename src/DWC_A/{Meta => Builders}/CoreFileMetaDataBuilder.cs (96%) rename src/DWC_A/{Meta => Builders}/ExtensionFileMetaDataBuilder.cs (98%) rename src/DWC_A/{Meta => Builders}/FieldMetaDataBuilder.cs (98%) rename src/DWC_A/{Meta => Builders}/FieldsMetaDataBuilder.cs (90%) diff --git a/src/DWC_A/ArchiveWriter.cs b/src/DWC_A/ArchiveWriter.cs index 47f9896..3820eef 100644 --- a/src/DWC_A/ArchiveWriter.cs +++ b/src/DWC_A/ArchiveWriter.cs @@ -1,5 +1,4 @@ using DwC_A.Builders; -using DwC_A.Meta; using System.Collections.Generic; using System.IO; using System.IO.Compression; diff --git a/src/DWC_A/Meta/ArchiveMetaDataBuilder.cs b/src/DWC_A/Builders/ArchiveMetaDataBuilder.cs similarity index 89% rename from src/DWC_A/Meta/ArchiveMetaDataBuilder.cs rename to src/DWC_A/Builders/ArchiveMetaDataBuilder.cs index 199b03f..37ab84e 100644 --- a/src/DWC_A/Meta/ArchiveMetaDataBuilder.cs +++ b/src/DWC_A/Builders/ArchiveMetaDataBuilder.cs @@ -1,8 +1,8 @@ -using DwC_A.Builders; +using DwC_A.Meta; using System.IO; using System.Xml.Serialization; -namespace DwC_A.Meta +namespace DwC_A.Builders { public class ArchiveMetaDataBuilder { @@ -48,7 +48,7 @@ public Archive Build() public string Serialize() { var path = GetPath(); - var metaDataFileName = System.IO.Path.Combine(path, fileName); + var metaDataFileName = Path.Combine(path, fileName); var overrides = GetXmlAttributeOverrides(); XmlSerializer serializer = new XmlSerializer(typeof(Archive), overrides); using (Stream stream = new FileStream(metaDataFileName, FileMode.Create)) @@ -60,7 +60,7 @@ public string Serialize() private string GetPath() { - if(context == null) + if (context == null) { return BuilderContext.Default.Path; } @@ -80,14 +80,14 @@ private XmlAttributeOverrides GetXmlAttributeOverrides() "dateFormat" }; var overrides = new XmlAttributeOverrides(); - foreach(var attributeName in attributeNames) + foreach (var attributeName in attributeNames) { var attribute = new XmlAttributes() { XmlDefaultValue = null, XmlAttribute = new XmlAttributeAttribute() - { - AttributeName = attributeName + { + AttributeName = attributeName } }; var memberName = Capitalize(attributeName); diff --git a/src/DWC_A/Meta/CoreFileMetaDataBuilder.cs b/src/DWC_A/Builders/CoreFileMetaDataBuilder.cs similarity index 96% rename from src/DWC_A/Meta/CoreFileMetaDataBuilder.cs rename to src/DWC_A/Builders/CoreFileMetaDataBuilder.cs index 1405f7a..4cdcc86 100644 --- a/src/DWC_A/Meta/CoreFileMetaDataBuilder.cs +++ b/src/DWC_A/Builders/CoreFileMetaDataBuilder.cs @@ -1,6 +1,7 @@ using System.Text; +using DwC_A.Meta; -namespace DwC_A.Meta +namespace DwC_A.Builders { public class CoreFileMetaDataBuilder { @@ -83,7 +84,7 @@ public CoreFileMetaDataBuilder AddField(FieldMetaDataBuilder field) public CoreFileMetaDataBuilder AddFields(FieldsMetaDataBuilder fields) { - foreach(var field in fields.Build()) + foreach (var field in fields.Build()) { AddField(field); } diff --git a/src/DWC_A/Meta/ExtensionFileMetaDataBuilder.cs b/src/DWC_A/Builders/ExtensionFileMetaDataBuilder.cs similarity index 98% rename from src/DWC_A/Meta/ExtensionFileMetaDataBuilder.cs rename to src/DWC_A/Builders/ExtensionFileMetaDataBuilder.cs index ac2c99b..621e3ae 100644 --- a/src/DWC_A/Meta/ExtensionFileMetaDataBuilder.cs +++ b/src/DWC_A/Builders/ExtensionFileMetaDataBuilder.cs @@ -1,6 +1,7 @@ using System.Text; +using DwC_A.Meta; -namespace DwC_A.Meta +namespace DwC_A.Builders { public class ExtensionFileMetaDataBuilder { diff --git a/src/DWC_A/Meta/FieldMetaDataBuilder.cs b/src/DWC_A/Builders/FieldMetaDataBuilder.cs similarity index 98% rename from src/DWC_A/Meta/FieldMetaDataBuilder.cs rename to src/DWC_A/Builders/FieldMetaDataBuilder.cs index a8a9be4..bfcb06c 100644 --- a/src/DWC_A/Meta/FieldMetaDataBuilder.cs +++ b/src/DWC_A/Builders/FieldMetaDataBuilder.cs @@ -1,4 +1,6 @@ -namespace DwC_A.Meta +using DwC_A.Meta; + +namespace DwC_A.Builders { /// /// Builds field metadata definitions diff --git a/src/DWC_A/Meta/FieldsMetaDataBuilder.cs b/src/DWC_A/Builders/FieldsMetaDataBuilder.cs similarity index 90% rename from src/DWC_A/Meta/FieldsMetaDataBuilder.cs rename to src/DWC_A/Builders/FieldsMetaDataBuilder.cs index defde19..e1e2f83 100644 --- a/src/DWC_A/Meta/FieldsMetaDataBuilder.cs +++ b/src/DWC_A/Builders/FieldsMetaDataBuilder.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using DwC_A.Meta; -namespace DwC_A.Meta +namespace DwC_A.Builders { /// /// Creates a collection of field metadata @@ -41,10 +42,10 @@ public FieldsMetaDataBuilder AutomaticallyIndex() /// /// This method will create a FieldMetaDataBuilder and pass it to a lamba defined to fill in the field metadat /// this - public FieldsMetaDataBuilder AddField( Func fieldMetaData ) + public FieldsMetaDataBuilder AddField(Func fieldMetaData) { var fieldMetaDataBuilder = FieldMetaDataBuilder.Field(); - if(automaticallyIndex) + if (automaticallyIndex) { fieldMetaDataBuilder.Index(index++); } diff --git a/src/Tests/ArchiveMetaDataBuilderTests.cs b/src/Tests/ArchiveMetaDataBuilderTests.cs index 0f7128e..26314e5 100644 --- a/src/Tests/ArchiveMetaDataBuilderTests.cs +++ b/src/Tests/ArchiveMetaDataBuilderTests.cs @@ -1,5 +1,4 @@ using DwC_A.Builders; -using DwC_A.Meta; using DwC_A.Terms; using System.Text; using Xunit; diff --git a/src/Tests/ArchiveWriterFixture.cs b/src/Tests/ArchiveWriterFixture.cs index 3588a1e..ce5cc48 100644 --- a/src/Tests/ArchiveWriterFixture.cs +++ b/src/Tests/ArchiveWriterFixture.cs @@ -1,4 +1,4 @@ -using DwC_A.Meta; +using DwC_A.Builders; using DwC_A.Terms; using System.Collections.Generic; using System.IO; diff --git a/src/Tests/ArchiveWriterTests.cs b/src/Tests/ArchiveWriterTests.cs index 1ebb628..58c6f43 100644 --- a/src/Tests/ArchiveWriterTests.cs +++ b/src/Tests/ArchiveWriterTests.cs @@ -1,6 +1,5 @@ using DwC_A; using DwC_A.Builders; -using DwC_A.Meta; using DwC_A.Terms; using DwC_A.Writers; using System; diff --git a/src/Tests/CoreFileMetaDataBuilderTests.cs b/src/Tests/CoreFileMetaDataBuilderTests.cs index cfe2421..97ec2c8 100644 --- a/src/Tests/CoreFileMetaDataBuilderTests.cs +++ b/src/Tests/CoreFileMetaDataBuilderTests.cs @@ -1,4 +1,4 @@ -using DwC_A.Meta; +using DwC_A.Builders; using DwC_A.Terms; using System.Text; using Xunit; diff --git a/src/Tests/ExtensionFileMetadataBuilderTests.cs b/src/Tests/ExtensionFileMetadataBuilderTests.cs index 89c0c27..fadeb8a 100644 --- a/src/Tests/ExtensionFileMetadataBuilderTests.cs +++ b/src/Tests/ExtensionFileMetadataBuilderTests.cs @@ -1,4 +1,4 @@ -using DwC_A.Meta; +using DwC_A.Builders; using DwC_A.Terms; using System.Text; using Xunit; diff --git a/src/Tests/FieldMetaDataBuilderTests.cs b/src/Tests/FieldMetaDataBuilderTests.cs index e8704bd..02ab400 100644 --- a/src/Tests/FieldMetaDataBuilderTests.cs +++ b/src/Tests/FieldMetaDataBuilderTests.cs @@ -1,4 +1,5 @@ -using DwC_A.Meta; +using DwC_A.Builders; +using DwC_A.Meta; using DwC_A.Terms; using Xunit; diff --git a/src/Tests/GetListExtensionsTests.cs b/src/Tests/GetListExtensionsTests.cs index 701fc56..8dd7d3a 100644 --- a/src/Tests/GetListExtensionsTests.cs +++ b/src/Tests/GetListExtensionsTests.cs @@ -1,4 +1,5 @@ using DwC_A; +using DwC_A.Builders; using DwC_A.Exceptions; using DwC_A.Extensions; using DwC_A.Meta; @@ -11,7 +12,7 @@ namespace Tests { public class GetListExtensionsTests { - Mock mockRow = new Mock(); + private readonly Mock mockRow = new(); public GetListExtensionsTests() { diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index 2c34686..68b99a7 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -10,15 +10,15 @@ - + all runtime; build; native; contentfiles; analyzers - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive From d7e8889e532d5ffb4247b1341f24db30ee8f21c5 Mon Sep 17 00:00:00 2001 From: pjoiner Date: Sat, 16 Sep 2023 15:26:49 -0500 Subject: [PATCH 2/8] Added sourcelink --- src/DWC_A/DwC-A_dotnet.csproj | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/DWC_A/DwC-A_dotnet.csproj b/src/DWC_A/DwC-A_dotnet.csproj index c493c2e..212eab8 100644 --- a/src/DWC_A/DwC-A_dotnet.csproj +++ b/src/DWC_A/DwC-A_dotnet.csproj @@ -17,7 +17,7 @@ git A simple Darwin Core Archive Reader for dotnet DwC-A darwin-core Biodiversity - 0.7.0 + 0.8.0 full @@ -26,10 +26,12 @@ DwC-A_dotnet.xml 1701;1702;1591 - 0.7.0.0 - 0.7.0.0 + 0.8.0.0 + 0.8.0.0 Readme.md LICENSE + True + snupkg @@ -47,7 +49,11 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From 3d74c2f44f97b852cb139244744ea1e54701cab2 Mon Sep 17 00:00:00 2001 From: pjoiner Date: Sat, 28 Oct 2023 13:55:20 -0500 Subject: [PATCH 3/8] Updated Terms --- src/DWC_A/Terms/Terms.cs | Bin 165100 -> 172070 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/DWC_A/Terms/Terms.cs b/src/DWC_A/Terms/Terms.cs index 7c4b24579e423ffe779a552a1de6706d8e11e1b7..5aea16c68997814548e3183393e1f78360f38f51 100644 GIT binary patch delta 4970 zcmdT|dvKM-75~oW-aKv|TnGV#gxm`T0>)G*LO_TKZIDSZ4+yA;G*?M57?NueAl#uz z5JZuPfd!T@3@;f9HH5&YY-{C_fEpYs!J$@dfg1}|s6d=nq>g5KcE9`WmkSKje><7E z+1>NobIzW}?m6E#s~vleJ6hg_uzA`N?Ky1%y_U;$FUbox7xZI}Mq*Crfr0&LS#*w? zA9MU!Z;1KY+P=h@YZ94ThgkhHXLX3VqUZLVuO?LNeQm&(5D^fq70~@>`cq$YAG*bv zqV^mZ_)M5N5%TpRLvjeq_z&!+M~98n{Yled&@VKPR;3kb^R;rVLMzcK<-7!EW%T@a z?s3I(-GzunNGr#KmLQ^3bK%U3t72Y+W0#hUqcWVAB61$htc`teAtD#zpTG-*2kGznY>TVuH zy9+W5VL3AoTiy+#lsz>yB*KLzl4mjkUwC+{VlPys)$$v8>W=QE2}3M7nMHv&z<4I=s}`W2=67W$zG+%8m^t@6ffY z9CYgH7}gO>xk1vVONXt^YLkhH|toJdfrAJpdSlbJb zE%vY>r7)Z3)fXyx1^U7Ih}*^M-iB%`AF}9`b+4-p0TJGYDC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4a_hNbVrkAE1$PFsCHAfk~xYp4ot@c&m9B#fLfN3LyY_4uYn9halRlW+0fD zkxb}OnMa`CM!78yt^}~};VRS|`Io^R1*d;!&M=9SsoZ;Y_0zc=o zk99+CsDG%}4=xqi3#Va09v8KShtoi5qrB!_q5k#@I27!2qiHB`kzH((Fkv)Jw z%Q!yBIA}Om-rvBG^~ucHsq%d&pGlluMO=YO>;Fijk?4LkJq$iGT-Evkd>%%}u0y`M zcO4uka>^Ex=g%-my|a6{(nNj?8~6%jR12dA3|C1O|cuW%{Z-?AN!Qz2gb9JVqdsUbvkBI z!W@iO6FM^J8obYgzn(A4IC&E=uJobi(iDo<5zm5Sll8A|Dkc!Do z!7g|@1>d8~$>>m-$v9yqN-^(G7-saAiFazrQrrQIeMOVsRM(baUZ}$Rh_Vl(ht?+Y zzzy%h1gfn>2i;GEENb?$g&|d4RhSgS6Rwa_EXdWwNL~aL9Kx^CWCOY%+n#v)Nn>NZ zCErUA_HsQ^4q&DA3o1z!=oC4dO&upCGewyPFxOb=YWWd#FzD|`kMN}0jS!Ly#|dJk l)YNDb?hMWxXGm8yuVY^LF&#YAavW3C)#JDt6+g!`{5RksAJG5+ From 8aa8721c6529c9d2045c5eb02cb248b4d036cf7f Mon Sep 17 00:00:00 2001 From: pjoiner Date: Sat, 28 Oct 2023 15:10:40 -0500 Subject: [PATCH 4/8] #74 Added 0.7.0 to benchmarks --- Benchmarks/Benchmarks.csproj | 2 +- Benchmarks/Config.cs | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index 7c432ec..6169854 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -67,7 +67,7 @@ - + diff --git a/Benchmarks/Config.cs b/Benchmarks/Config.cs index 9a8ee83..46683ca 100644 --- a/Benchmarks/Config.cs +++ b/Benchmarks/Config.cs @@ -10,23 +10,32 @@ public Config() { var baseJob = Job.ShortRun; #if LOCALBUILD - var package_0_7_0 = baseJob.WithId("0.7.0"); - AddJob(package_0_7_0.WithRuntime(ClrRuntime.Net48)); - AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core50)); - AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core60)); - AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core70)); + var package_0_8_0 = baseJob.WithId("0.8.0"); + AddJob(package_0_8_0.WithRuntime(ClrRuntime.Net48)); + AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core50)); + AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core60)); + AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core70)); + //AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core80)); #else var package_0_5_2 = baseJob.WithNuGet("DwC-A_dotnet", "0.5.2").WithId("0.5.2"); var package_0_6_2 = baseJob.WithNuGet("DwC-A_dotnet", "0.6.2").WithId("0.6.2"); + var package_0_7_0 = baseJob.WithNuGet("DwC-A_dotnet", "0.7.0").WithId("0.7.0"); AddJob(package_0_5_2.WithRuntime(ClrRuntime.Net48)); AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core70)); + //AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core80)); AddJob(package_0_6_2.WithRuntime(ClrRuntime.Net48)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core70)); + //AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core80)); + AddJob(package_0_7_0.WithRuntime(ClrRuntime.Net48)); + AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core50)); + AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core60)); + AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core70)); + //AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core80)); #endif } } From 1cd8df143ad65ecef5758374320c2688670d7200 Mon Sep 17 00:00:00 2001 From: Paul Joiner Date: Tue, 14 Nov 2023 13:38:43 -0600 Subject: [PATCH 5/8] Updated projects to dotnet 8.0 and updated benchmarks --- Benchmarks/Benchmarks.csproj | 2 +- Benchmarks/Config.cs | 8 ++++---- Benchmarks/readme.md | 4 ++-- src/DWC_A/DwC-A_dotnet.csproj | 2 +- src/DWC_A/Exceptions/FileReaderNotFoundException.cs | 10 ++-------- src/DWC_A/Exceptions/InvalidArchiveException.cs | 10 ++-------- src/DWC_A/Exceptions/TermNotFoundException.cs | 7 +------ src/Tests/Tests.csproj | 2 +- 8 files changed, 14 insertions(+), 31 deletions(-) diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj index 6169854..7184b70 100644 --- a/Benchmarks/Benchmarks.csproj +++ b/Benchmarks/Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net48;net5.0;net6.0;net7.0 + net48;net6.0;net7.0;net8.0 Debug;Release;LocalRelease diff --git a/Benchmarks/Config.cs b/Benchmarks/Config.cs index 46683ca..e3ae362 100644 --- a/Benchmarks/Config.cs +++ b/Benchmarks/Config.cs @@ -15,7 +15,7 @@ public Config() AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core70)); - //AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core80)); + AddJob(package_0_8_0.WithRuntime(CoreRuntime.Core80)); #else var package_0_5_2 = baseJob.WithNuGet("DwC-A_dotnet", "0.5.2").WithId("0.5.2"); var package_0_6_2 = baseJob.WithNuGet("DwC-A_dotnet", "0.6.2").WithId("0.6.2"); @@ -25,17 +25,17 @@ public Config() AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core70)); - //AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core80)); + AddJob(package_0_5_2.WithRuntime(CoreRuntime.Core80)); AddJob(package_0_6_2.WithRuntime(ClrRuntime.Net48)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core70)); - //AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core80)); + AddJob(package_0_6_2.WithRuntime(CoreRuntime.Core80)); AddJob(package_0_7_0.WithRuntime(ClrRuntime.Net48)); AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core50)); AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core60)); AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core70)); - //AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core80)); + AddJob(package_0_7_0.WithRuntime(CoreRuntime.Core80)); #endif } } diff --git a/Benchmarks/readme.md b/Benchmarks/readme.md index eb49d18..94619ad 100644 --- a/Benchmarks/readme.md +++ b/Benchmarks/readme.md @@ -3,10 +3,10 @@ To run benchmarks for the current release from the command line and save logs/results use the following command line. ``` -dotnet run -c LocalRelease --framework net48 net50 net60 net70 +dotnet run -c LocalRelease --framework net48 net50 net60 net70 net80 ``` To run benchmarks for the previous releases use the following command line. ``` -dotnet run -c Release --framework net48 net50 net60 net70 +dotnet run -c Release --framework net48 net50 net60 net70 net80 ``` \ No newline at end of file diff --git a/src/DWC_A/DwC-A_dotnet.csproj b/src/DWC_A/DwC-A_dotnet.csproj index 212eab8..c2a84b5 100644 --- a/src/DWC_A/DwC-A_dotnet.csproj +++ b/src/DWC_A/DwC-A_dotnet.csproj @@ -1,7 +1,7 @@ - net7.0;net6.0;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0 DwC_A true Debug;Release;LocalRelease diff --git a/src/DWC_A/Exceptions/FileReaderNotFoundException.cs b/src/DWC_A/Exceptions/FileReaderNotFoundException.cs index 25a2cac..90b11c1 100644 --- a/src/DWC_A/Exceptions/FileReaderNotFoundException.cs +++ b/src/DWC_A/Exceptions/FileReaderNotFoundException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; namespace DwC_A.Exceptions { @@ -14,19 +13,14 @@ public FileReaderNotFoundException() { } - public FileReaderNotFoundException(string fileName) : + public FileReaderNotFoundException(string fileName) : base(BuildMessage(fileName)) { } - public FileReaderNotFoundException(string fileName, Exception innerException) : + public FileReaderNotFoundException(string fileName, Exception innerException) : base(BuildMessage(fileName), innerException) { } - - protected FileReaderNotFoundException(SerializationInfo info, StreamingContext context) : - base(info, context) - { - } } } diff --git a/src/DWC_A/Exceptions/InvalidArchiveException.cs b/src/DWC_A/Exceptions/InvalidArchiveException.cs index ad63e18..524b40c 100644 --- a/src/DWC_A/Exceptions/InvalidArchiveException.cs +++ b/src/DWC_A/Exceptions/InvalidArchiveException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; namespace DwC_A.Exceptions { @@ -14,19 +13,14 @@ public InvalidArchiveException() { } - public InvalidArchiveException(string path) : + public InvalidArchiveException(string path) : base(BuildMessage(path)) { } - public InvalidArchiveException(string path, Exception innerException) : + public InvalidArchiveException(string path, Exception innerException) : base(BuildMessage(path), innerException) { } - - protected InvalidArchiveException(SerializationInfo info, StreamingContext context) : - base(info, context) - { - } } } diff --git a/src/DWC_A/Exceptions/TermNotFoundException.cs b/src/DWC_A/Exceptions/TermNotFoundException.cs index ce07fef..c372368 100644 --- a/src/DWC_A/Exceptions/TermNotFoundException.cs +++ b/src/DWC_A/Exceptions/TermNotFoundException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; namespace DwC_A.Exceptions { @@ -15,13 +14,9 @@ public TermNotFoundException(string term) : { } - public TermNotFoundException(string term, Exception innerException) : + public TermNotFoundException(string term, Exception innerException) : base(BuildMessage(term), innerException) { } - - protected TermNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } } diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index 68b99a7..967d1b0 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Debug;Release;LocalRelease From d3dcde50981651bff973ca7d408f361625dba4fa Mon Sep 17 00:00:00 2001 From: Paul Joiner <41760663+pjoiner@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:42:25 -0600 Subject: [PATCH 6/8] Update dotnet.yml to dotnet 8.0.x --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4b3082e..461c8b3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build From d70604d970f594cfb35b9a762a9a9f800447a297 Mon Sep 17 00:00:00 2001 From: Paul Joiner Date: Wed, 22 Nov 2023 14:51:05 -0600 Subject: [PATCH 7/8] Added ConfigureAwait(false) --- src/DWC_A/AsyncEnumerable/FileReader.cs | 7 ++++--- src/DWC_A/AsyncEnumerable/StreamReader.cs | 2 +- src/DWC_A/Extensions/StreamReaderExtensions.cs | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/DWC_A/AsyncEnumerable/FileReader.cs b/src/DWC_A/AsyncEnumerable/FileReader.cs index deacae2..28f80e9 100644 --- a/src/DWC_A/AsyncEnumerable/FileReader.cs +++ b/src/DWC_A/AsyncEnumerable/FileReader.cs @@ -2,6 +2,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Threading; +using System.Threading.Tasks; namespace DwC_A { @@ -13,7 +14,7 @@ public async IAsyncEnumerable GetRowsAsync([EnumeratorCancellation] Cancel using (var stream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read, config.BufferSize, true)) { - await foreach (var row in streamReader.ReadRowsAsync(stream, ct)) + await foreach (var row in streamReader.ReadRowsAsync(stream, ct).ConfigureAwait(false)) { yield return row; } @@ -23,7 +24,7 @@ public async IAsyncEnumerable GetRowsAsync([EnumeratorCancellation] Cancel public async IAsyncEnumerable GetHeaderRowsAsync([EnumeratorCancellation] CancellationToken ct = default) { int count = 0; - await foreach (var row in GetRowsAsync(ct)) + await foreach (var row in GetRowsAsync(ct).ConfigureAwait(false)) { if (count < FileMetaData.HeaderRowCount) { @@ -40,7 +41,7 @@ public async IAsyncEnumerable GetHeaderRowsAsync([EnumeratorCancellation] public async IAsyncEnumerable GetDataRowsAsync([EnumeratorCancellation] CancellationToken ct = default) { int count = 0; - await foreach (var row in GetRowsAsync(ct)) + await foreach (var row in GetRowsAsync(ct).ConfigureAwait(false)) { if (count >= FileMetaData.HeaderRowCount) { diff --git a/src/DWC_A/AsyncEnumerable/StreamReader.cs b/src/DWC_A/AsyncEnumerable/StreamReader.cs index 08e2d1b..49ed52e 100644 --- a/src/DWC_A/AsyncEnumerable/StreamReader.cs +++ b/src/DWC_A/AsyncEnumerable/StreamReader.cs @@ -15,7 +15,7 @@ public async IAsyncEnumerable ReadRowsAsync(Stream stream, using (var reader = new System.IO.StreamReader(stream, fileMetaData.Encoding)) { string line; - while ((line = await reader.ReadRowAsync(fileMetaData)) != null) + while ((line = await reader.ReadRowAsync(fileMetaData).ConfigureAwait(false)) != null) { ct.ThrowIfCancellationRequested(); yield return rowFactory.CreateRow(tokenizer.Split(line), fileMetaData.Fields); diff --git a/src/DWC_A/Extensions/StreamReaderExtensions.cs b/src/DWC_A/Extensions/StreamReaderExtensions.cs index 3431bd4..8f3e430 100644 --- a/src/DWC_A/Extensions/StreamReaderExtensions.cs +++ b/src/DWC_A/Extensions/StreamReaderExtensions.cs @@ -30,9 +30,9 @@ public static string ReadRow(this System.IO.StreamReader reader, IFileMetaData f char terminatorStart = fileMetaData.LinesTerminatedBy.FirstOrDefault(); bool inQuotes = false; char[] c = new char[1]; - while(reader.Peek() != -1) + while (reader.Peek() != -1) { - reader.Read(c,0,1); + reader.Read(c, 0, 1); if (!inQuotes && c[0] == terminatorStart) { for (int i = 1; i < fileMetaData.LineTerminatorLength; i++) @@ -61,7 +61,7 @@ public async static Task ReadRowAsync(this System.IO.StreamReader reader char Quotes = fileMetaData.FieldsEnclosedBy.FirstOrDefault(); if (Quotes == '\0') { - line.Append(await reader.ReadLineAsync()); + line.Append(await reader.ReadLineAsync().ConfigureAwait(false)); return line.Flush(); } char terminatorStart = fileMetaData.LinesTerminatedBy.FirstOrDefault(); @@ -69,12 +69,12 @@ public async static Task ReadRowAsync(this System.IO.StreamReader reader char[] c = new char[1]; while (reader.Peek() != -1) { - await reader.ReadAsync(c, 0, 1); + await reader.ReadAsync(c, 0, 1).ConfigureAwait(false); if (!inQuotes && c[0] == terminatorStart) { for (int i = 1; i < fileMetaData.LineTerminatorLength; i++) { - await reader.ReadAsync(c, 0, 1); + await reader.ReadAsync(c, 0, 1).ConfigureAwait(false); } return line.Flush(); } From 0c43dbf4679d96254f1a336bfd6ec3cbedd8d94c Mon Sep 17 00:00:00 2001 From: Paul Joiner Date: Wed, 22 Nov 2023 15:05:38 -0600 Subject: [PATCH 8/8] Updated Copyright --- src/DWC_A/DwC-A_dotnet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DWC_A/DwC-A_dotnet.csproj b/src/DWC_A/DwC-A_dotnet.csproj index c2a84b5..a0fa590 100644 --- a/src/DWC_A/DwC-A_dotnet.csproj +++ b/src/DWC_A/DwC-A_dotnet.csproj @@ -12,7 +12,7 @@ https://github.com/pjoiner/DwC-A_dotnet Paul Joiner - Copyright © Paul Joiner 2022 + Copyright © Paul Joiner 2023 https://github.com/pjoiner/DwC-A_dotnet/blob/master/LICENSE git A simple Darwin Core Archive Reader for dotnet