Skip to content

Commit b900e4a

Browse files
committed
Added IncludeNativeLibrariesForSelfExtract to include sqlite. Will have separate windows, linux, macos builds at some stage
1 parent 743fd66 commit b900e4a

5 files changed

Lines changed: 30 additions & 20 deletions

File tree

Tests/Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>
77
<PlatformTarget>x64</PlatformTarget>
8+
<Platforms>AnyCPU;x64</Platforms>
89
</PropertyGroup>
910

1011
<ItemGroup>

thsearch.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@ EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1212
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
1314
Release|Any CPU = Release|Any CPU
15+
Release|x64 = Release|x64
1416
EndGlobalSection
1517
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1618
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1719
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|x64.ActiveCfg = Debug|Any CPU
21+
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|x64.Build.0 = Debug|Any CPU
1822
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|Any CPU.ActiveCfg = Release|Any CPU
1923
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|x64.ActiveCfg = Release|x64
25+
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|x64.Build.0 = Release|x64
2026
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2127
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|x64.ActiveCfg = Debug|x64
29+
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|x64.Build.0 = Debug|x64
2230
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
2331
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|x64.ActiveCfg = Release|x64
33+
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|x64.Build.0 = Release|x64
2434
EndGlobalSection
2535
GlobalSection(SolutionProperties) = preSolution
2636
HideSolutionNode = FALSE

thsearch/Program.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal static void Main(string[] args)
1919
int numberOfResults = 10;
2020

2121
// TODO: Tests
22-
// TODO: File access issues
22+
// TODO: Add support for: csv, docx, xlsx, pptx
2323

2424
switch (args.Length)
2525
{
@@ -56,7 +56,6 @@ internal static void Main(string[] args)
5656
return;
5757
}
5858

59-
6059
configPath = Path.Combine(currentDirectory, configName + ".txt");
6160

6261
ConfigFileParser config = new ConfigFileParser(configPath);
@@ -67,7 +66,6 @@ internal static void Main(string[] args)
6766

6867
IIndex index = new IndexSqlite(dbLocation);
6968

70-
7169
TxtExtractor txtExtractor = new TxtExtractor();
7270
PdfExtractor pdfExtractor = new PdfExtractor();
7371
HtmlExtractor htmlExtractor = new HtmlExtractor();
@@ -77,7 +75,6 @@ internal static void Main(string[] args)
7775
ITokenizer tokenizer = new TokenizerSpans();
7876

7977
FileProducer fileProducer = new FileProducer (config.IncludedDirectories, config.ExcludedDirectories, config.FileExtensions, config.ExcludedWords);
80-
8178

8279
FileConsumer fileConsumer = new FileConsumer(index, stringExtractor, tokenizer);
8380

@@ -86,7 +83,6 @@ internal static void Main(string[] args)
8683
// used for pruning later
8784
List<string> foundFiles = new List<string>();
8885

89-
9086
var producerTask = Task.Run(() =>
9187
{
9288
foreach (FileModel file in fileProducer)

thsearch/Properties/PublishProfiles/FolderProfile.pubxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
55
<Project>
66
<PropertyGroup>
77
<Configuration>Release</Configuration>
8-
<Platform>Any CPU</Platform>
8+
<Platform>x64</Platform>
99
<PublishDir>bin\Release\net6.0\</PublishDir>
1010
<PublishProtocol>FileSystem</PublishProtocol>
1111
<_TargetId>Folder</_TargetId>

thsearch/thsearch.csproj

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net6.0</TargetFramework>
6-
<PublishSingleFile>true</PublishSingleFile>
7-
<SelfContained>true</SelfContained>
8-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
9-
<PublishTrimmed>true</PublishTrimmed>
10-
<PublishReadyToRun>true</PublishReadyToRun>
6+
<PublishSingleFile>true</PublishSingleFile>
7+
<SelfContained>true</SelfContained>
8+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
9+
<PublishTrimmed>true</PublishTrimmed>
10+
<PublishReadyToRun>true</PublishReadyToRun>
1111
<ImplicitUsings>enable</ImplicitUsings>
12-
<Nullable>enable</Nullable>
12+
<Nullable>disable</Nullable>
1313
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
14-
<Title>thsearch - The multithread searcher</Title>
15-
<Version>1.0.2.0</Version>
16-
<Description>A multithread, fixed location, text content searcher. Specify the paths you want to search, and the file extensions, and then call it
17-
as follows: thsearch.exe searchterm. </Description>
14+
<Title>thsearch</Title>
15+
<Version>2.0.0.0</Version>
16+
<Description>Fast ranked content searching of documents </Description>
1817
<PlatformTarget>x64</PlatformTarget>
18+
<Platforms>AnyCPU;x64</Platforms>
1919
<ErrorReport>none</ErrorReport>
20+
<!-- Includes sqlite library. See: https://stackoverflow.com/questions/74661400/eliminate-e-sqlite3-dll-during-single-file-compilation -->
21+
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
2022
</PropertyGroup>
2123

2224
<ItemGroup>
@@ -30,9 +32,10 @@ as follows: thsearch.exe searchterm. </Description>
3032
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.4" />
3133
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
3234
<PackageReference Include="PdfPig" Version="0.1.7" />
33-
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
34-
<PackageReference Include="System.Data.SQLite" Version="1.0.117" />
35-
<PackageReference Include="Terminal.Gui" Version="1.10.0" />
35+
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.4" />
36+
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.4" />
37+
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.4" />
38+
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.4" />
3639
</ItemGroup>
3740

3841
<ItemGroup>

0 commit comments

Comments
 (0)