Skip to content

Commit

Permalink
Merge pull request #346 from nzdev/v3/feature/api-compat
Browse files Browse the repository at this point in the history
Record v3 shipped API using Microsoft.CodeAnalysis.PublicApiAnalyzers
  • Loading branch information
Shazwazza authored Aug 15, 2023
2 parents 3b05112 + 4ddf969 commit 4ee5bf1
Show file tree
Hide file tree
Showing 13 changed files with 793 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Examine.Core/EmptySearchResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ IEnumerator IEnumerable.GetEnumerator()
public long TotalItemCount => 0;


#pragma warning disable IDE0060 // Remove unused parameter
public IEnumerable<ISearchResult> Skip(int skip)
{
#pragma warning restore IDE0060 // Remove unused parameter
{
return Enumerable.Empty<ISearchResult>();
}

#pragma warning disable IDE0060 // Remove unused parameter
public IEnumerable<ISearchResult> SkipTake(int skip, int? take = null)
#pragma warning restore IDE0060 // Remove unused parameter
{
return Enumerable.Empty<ISearchResult>();
}
Expand Down
4 changes: 4 additions & 0 deletions src/Examine.Core/Examine.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup>
Expand Down
311 changes: 311 additions & 0 deletions src/Examine.Core/PublicAPI.Shipped.txt

Large diffs are not rendered by default.

Empty file.
4 changes: 4 additions & 0 deletions src/Examine.Host/Examine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="5.0.5" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
</ItemGroup>

Expand Down
15 changes: 15 additions & 0 deletions src/Examine.Host/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Examine.AspNetCoreApplicationIdentifier
Examine.AspNetCoreApplicationIdentifier.AspNetCoreApplicationIdentifier(System.IServiceProvider services) -> void
Examine.AspNetCoreApplicationIdentifier.GetApplicationUniqueIdentifier() -> string
Examine.CurrentEnvironmentApplicationRoot
Examine.CurrentEnvironmentApplicationRoot.ApplicationRoot.get -> System.IO.DirectoryInfo
Examine.CurrentEnvironmentApplicationRoot.CurrentEnvironmentApplicationRoot() -> void
Examine.IApplicationRoot
Examine.IApplicationRoot.ApplicationRoot.get -> System.IO.DirectoryInfo
Examine.ServicesCollectionExtensions
static Examine.ServicesCollectionExtensions.AddExamine(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.IO.DirectoryInfo appRootDirectory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary<string, Examine.Lucene.IFieldValueTypeFactory> indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex<TIndex, TDirectoryFactory>(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary<string, Examine.Lucene.IFieldValueTypeFactory> indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex<TIndex>(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary<string, Examine.Lucene.IFieldValueTypeFactory> indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Examine.ServicesCollectionExtensions.AddExamineLuceneMultiSearcher(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, string[] indexNames, Lucene.Net.Analysis.Analyzer analyzer = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Examine.ServicesCollectionExtensions.AddExamineSearcher<TSearcher>(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, System.Func<System.IServiceProvider, System.Collections.Generic.IList<object>> parameterFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
Empty file.
4 changes: 4 additions & 0 deletions src/Examine.Lucene/Examine.Lucene.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<Version>4.8.0-beta00016</Version>
</PackageReference>
<PackageReference Include="Lucene.Net.Replicator" Version="4.8.0-beta00016" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Threading">
<Version>4.3.0</Version>
</PackageReference>
Expand Down
4 changes: 4 additions & 0 deletions src/Examine.Lucene/Indexing/IndexFieldRangeValueType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ protected IndexFieldRangeValueType(string fieldName, ILoggerFactory logger, bool
{
}

#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters
public abstract Query GetQuery(T? lower, T? upper, bool lowerInclusive = true, bool upperInclusive = true);
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters

#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters
public Query GetQuery(string lower, string upper, bool lowerInclusive = true, bool upperInclusive = true)
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
{
var lowerParsed = TryConvert<T>(lower, out var lowerValue);
var upperParsed = TryConvert<T>(upper, out var upperValue);
Expand Down
4 changes: 3 additions & 1 deletion src/Examine.Lucene/Providers/BaseLuceneSearcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ protected BaseLuceneSearcher(string name, Analyzer analyzer)
public abstract ISearchContext GetSearchContext();

/// <inheritdoc />
public override IQuery CreateQuery(string category = null, BooleanOperation defaultOperation = BooleanOperation.And)
#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
public override IQuery CreateQuery(string category = null, BooleanOperation defaultOperation = BooleanOperation.And)
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
=> CreateQuery(category, defaultOperation, LuceneAnalyzer, new LuceneSearchOptions());

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Examine.Lucene/Providers/MultiIndexSearcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public class MultiIndexSearcher : BaseLuceneSearcher
/// <param name="name"></param>
/// <param name="indexes"></param>
/// <param name="analyzer"></param>
#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters
public MultiIndexSearcher(string name, IEnumerable<IIndex> indexes, Analyzer analyzer = null)
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
: base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion))
{
_searchers = new Lazy<IEnumerable<ISearcher>>(() => indexes.Select(x => x.Searcher));
Expand All @@ -33,7 +35,9 @@ public MultiIndexSearcher(string name, IEnumerable<IIndex> indexes, Analyzer ana
/// <param name="name"></param>
/// <param name="searchers"></param>
/// <param name="analyzer"></param>
#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters
public MultiIndexSearcher(string name, Lazy<IEnumerable<ISearcher>> searchers, Analyzer analyzer = null)
#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters
: base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion))
{
_searchers = searchers;
Expand Down
Loading

0 comments on commit 4ee5bf1

Please sign in to comment.