Skip to content

Commit

Permalink
Update nuget packages
Browse files Browse the repository at this point in the history
* use interface

* update nuget packages

* remove unnecessary codes
  • Loading branch information
qiuhaotc authored Apr 19, 2021
1 parent e2cbbd9 commit b4064d8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/CodeIndex.Common/CodeIndex.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="4.7.6" />
<PackageReference Include="NLog" Version="4.7.9" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex.ConsoleApp/CodeIndex.ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.6.5" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.7.2" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/CodeIndex.IndexBuilder/CodeIndex.IndexBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00013" />
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00013" />
<PackageReference Include="Lucene.Net.ICU" Version="4.8.0-beta00013" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00013" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00014" />
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00014" />
<PackageReference Include="Lucene.Net.ICU" Version="4.8.0-beta00014" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00014" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/CodeIndex.IndexBuilder/CodeIndexBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace CodeIndex.IndexBuilder
{
public class CodeIndexBuilder : IDisposable
{
public CodeIndexBuilder(string name, LucenePoolLight codeIndexPool, LucenePoolLight hintIndexPool, ILogger log)
public CodeIndexBuilder(string name, ILucenePool codeIndexPool, ILucenePool hintIndexPool, ILogger log)
{
name.RequireNotNullOrEmpty(nameof(name));
codeIndexPool.RequireNotNull(nameof(codeIndexPool));
Expand All @@ -29,8 +29,8 @@ public CodeIndexBuilder(string name, LucenePoolLight codeIndexPool, LucenePoolLi
}

public string Name { get; }
public LucenePoolLight CodeIndexPool { get; }
public LucenePoolLight HintIndexPool { get; }
public ILucenePool CodeIndexPool { get; }
public ILucenePool HintIndexPool { get; }
public ILogger Log { get; }

public void InitIndexFolderIfNeeded()
Expand Down
2 changes: 2 additions & 0 deletions src/CodeIndex.IndexBuilder/ILucenePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public interface ILucenePool : IDisposable

void DeleteAllIndex();

void Commit();

bool Exists(Query query);

string LuceneIndex { get; }
Expand Down
12 changes: 4 additions & 8 deletions src/CodeIndex.Server/CodeIndex.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<None Remove="Pages\LuceneWithLineNumber.razor~RF1a20608c.TMP" />
</ItemGroup>

<ItemGroup>
<None Update="nlog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -21,10 +17,10 @@
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.2.0-preview1.20073.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.3" />
<PackageReference Include="NSwag.AspNetCore" Version="13.9.4" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
<PackageReference Include="NSwag.AspNetCore" Version="13.10.9" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex.Test/CodeIndex.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="nunit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex.Test/Utils/SearcherForTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace CodeIndex.Test
{
public static class SearcherForTest
{
public static CodeSource[] SearchCode(this LucenePoolLight lucenePool, Query searchQuery, int maxResults = int.MaxValue)
public static CodeSource[] SearchCode(this ILucenePool lucenePool, Query searchQuery, int maxResults = int.MaxValue)
{
return lucenePool.Search(searchQuery, maxResults).Select(CodeIndexBuilder.GetCodeSourceFromDocument).ToArray();
}

public static CodeWord[] SearchWord(this LucenePoolLight lucenePool, Query searchQuery, int maxResults = int.MaxValue)
public static CodeWord[] SearchWord(this ILucenePool lucenePool, Query searchQuery, int maxResults = int.MaxValue)
{
return lucenePool.Search(searchQuery, maxResults).Select(u => new CodeWord
{
Expand Down

0 comments on commit b4064d8

Please sign in to comment.