From 331174c68a88bcb5dea836a7400090630a5972be Mon Sep 17 00:00:00 2001 From: Jay Ofemi Date: Tue, 11 Jun 2024 16:15:36 -0700 Subject: [PATCH 1/2] Leave debugStream as null on construction of parser token managers * When debugStream is set to Console.Out by default, StandardSyntaxParserTokenManager throws an exception when constructing a StandardQueryParser on OSes that do not support System.Console, such as iOS and Android. * debugStream can be set later using the setter, if needed. * The above is the same for QueryParserTokenManager when constructing a QueryParser. * See issue https://github.com/apache/lucenenet/issues/936 for details. --- src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs | 4 ++-- .../Standard/Parser/StandardSyntaxParserTokenManager.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs index f63f658282..b7e7ea01ce 100644 --- a/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Classic/QueryParserTokenManager.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Support.IO; +using Lucene.Net.Support.IO; using System; using System.Diagnostics.CodeAnalysis; using System.IO; @@ -31,7 +31,7 @@ public class QueryParserTokenManager //: QueryParserConstants { /// Debug output. #pragma warning disable IDE0052 // Remove unread private members - private TextWriter debugStream = Console.Out; // LUCENENET specific - made private, since we already have a setter + private TextWriter debugStream; // LUCENENET specific - made private, since we already have a setter #pragma warning restore IDE0052 // Remove unread private members /// Set debug output. public virtual void SetDebugStream(TextWriter ds) diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParserTokenManager.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParserTokenManager.cs index 57646672fc..cca7cc3f53 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParserTokenManager.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParserTokenManager.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Support.IO; +using Lucene.Net.Support.IO; using System.Diagnostics.CodeAnalysis; using System; using System.IO; @@ -32,7 +32,7 @@ public class StandardSyntaxParserTokenManager /*: StandardSyntaxParserConstants* { /// Debug output. #pragma warning disable IDE0052 // Remove unread private members - private TextWriter debugStream = Console.Out; // LUCENENET specific - made private, since we already have a setter + private TextWriter debugStream; // LUCENENET specific - made private, since we already have a setter #pragma warning restore IDE0052 // Remove unread private members /// Set debug output. public void SetDebugStream(TextWriter ds) { debugStream = new SafeTextWriterWrapper(ds); } From 7d6240783a4a51f890c7b65fc24cd0f7589d8098 Mon Sep 17 00:00:00 2001 From: Harlan Hugh Date: Tue, 23 Jul 2024 18:14:06 -0700 Subject: [PATCH 2/2] Only target net6.0 Otherwise the following error occurs when attempting to publish to the iOS App Store: Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90, 5): [NETSDK1124] Trimming assemblies requires .NET Core 3.0 or higher. --- .../Lucene.Net.Analysis.Common.csproj | 8 ++++---- src/Lucene.Net.Queries/Lucene.Net.Queries.csproj | 6 +++--- .../Lucene.Net.QueryParser.csproj | 12 ++++++------ src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj | 6 +++--- src/Lucene.Net/Lucene.Net.csproj | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj index 5a64acc9e1..49f7a97adf 100644 --- a/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj +++ b/src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj @@ -26,11 +26,11 @@ Analyzers for indexing content in different languages and domains for the Lucene.NET full-text search engine library from The Apache Software Foundation. analysis-common/overview.html - + - + - net6.0;netstandard2.1;netstandard2.0;net462 + net6.0 Lucene.Net.Analysis.Common $(PackageTags);analysis @@ -38,7 +38,7 @@ $(NoWarn);1591;1573 - + diff --git a/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj b/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj index 90833c84bf..c6b1c88bcc 100644 --- a/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj +++ b/src/Lucene.Net.Queries/Lucene.Net.Queries.csproj @@ -28,9 +28,9 @@ - + - net6.0;netstandard2.1;netstandard2.0;net462 + net6.0 Lucene.Net.Queries $(PackageTags);query;queries @@ -38,7 +38,7 @@ $(NoWarn);1591;1573 - + diff --git a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj index fe8ba4d3ba..d7a8efbc3c 100644 --- a/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj +++ b/src/Lucene.Net.QueryParser/Lucene.Net.QueryParser.csproj @@ -28,22 +28,22 @@ - + - net6.0;netstandard2.1;netstandard2.0;net462 + net6.0 Lucene.Net.QueryParsers - + Lucene.Net.QueryParser $(PackageTags);query;queryparser bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - + $(NoWarn);1591;1573 $(NoWarn);IDE0060 - - + + diff --git a/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj b/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj index 2dcb6620eb..db26dda1fe 100644 --- a/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj +++ b/src/Lucene.Net.Sandbox/Lucene.Net.Sandbox.csproj @@ -28,9 +28,9 @@ - + - net6.0;netstandard2.1;netstandard2.0;net462 + net6.0 Lucene.Net.Sandbox $(PackageTags);sandbox @@ -38,7 +38,7 @@ $(NoWarn);1591;1573 - + diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj index 2491eccf46..c0a6aa7c45 100644 --- a/src/Lucene.Net/Lucene.Net.csproj +++ b/src/Lucene.Net/Lucene.Net.csproj @@ -22,9 +22,9 @@ - + - net6.0;netstandard2.1;netstandard2.0;net462 + net6.0 Lucene.Net Lucene.Net is a full-text search engine library capable of advanced text analysis, indexing, and searching. It can be used to easily add search capabilities to applications. Lucene.Net is a C# port of the popular Java Lucene search engine framework from The Apache Software Foundation, targeted at .NET Framework and .NET Core users. @@ -36,7 +36,7 @@ true - + $(SolutionDir)src\dotnet\ @@ -99,7 +99,7 @@ - +