Skip to content

Commit

Permalink
Added IncludeNativeLibrariesForSelfExtract to include sqlite. Will ha…
Browse files Browse the repository at this point in the history
…ve separate windows, linux, macos builds at some stage
  • Loading branch information
bn-l committed Mar 25, 2023
1 parent 743fd66 commit b900e4a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
1 change: 1 addition & 0 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions thsearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,27 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|x64.ActiveCfg = Debug|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Debug|x64.Build.0 = Debug|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|Any CPU.Build.0 = Release|Any CPU
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|x64.ActiveCfg = Release|x64
{6B348EA6-7F88-4FD6-B5C3-477B6139B547}.Release|x64.Build.0 = Release|x64
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|x64.ActiveCfg = Debug|x64
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Debug|x64.Build.0 = Debug|x64
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|Any CPU.Build.0 = Release|Any CPU
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|x64.ActiveCfg = Release|x64
{B1921D82-4401-46B8-A979-0F3EEE213CEB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 1 addition & 5 deletions thsearch/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static void Main(string[] args)
int numberOfResults = 10;

// TODO: Tests
// TODO: File access issues
// TODO: Add support for: csv, docx, xlsx, pptx

switch (args.Length)
{
Expand Down Expand Up @@ -56,7 +56,6 @@ internal static void Main(string[] args)
return;
}


configPath = Path.Combine(currentDirectory, configName + ".txt");

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

IIndex index = new IndexSqlite(dbLocation);


TxtExtractor txtExtractor = new TxtExtractor();
PdfExtractor pdfExtractor = new PdfExtractor();
HtmlExtractor htmlExtractor = new HtmlExtractor();
Expand All @@ -77,7 +75,6 @@ internal static void Main(string[] args)
ITokenizer tokenizer = new TokenizerSpans();

FileProducer fileProducer = new FileProducer (config.IncludedDirectories, config.ExcludedDirectories, config.FileExtensions, config.ExcludedWords);


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

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


var producerTask = Task.Run(() =>
{
foreach (FileModel file in fileProducer)
Expand Down
2 changes: 1 addition & 1 deletion thsearch/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<Platform>x64</Platform>
<PublishDir>bin\Release\net6.0\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
Expand Down
31 changes: 17 additions & 14 deletions thsearch/thsearch.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Nullable>disable</Nullable>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<Title>thsearch - The multithread searcher</Title>
<Version>1.0.2.0</Version>
<Description>A multithread, fixed location, text content searcher. Specify the paths you want to search, and the file extensions, and then call it
as follows: thsearch.exe searchterm. </Description>
<Title>thsearch</Title>
<Version>2.0.0.0</Version>
<Description>Fast ranked content searching of documents </Description>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU;x64</Platforms>
<ErrorReport>none</ErrorReport>
<!-- Includes sqlite library. See: https://stackoverflow.com/questions/74661400/eliminate-e-sqlite3-dll-during-single-file-compilation -->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>

<ItemGroup>
Expand All @@ -30,9 +32,10 @@ as follows: thsearch.exe searchterm. </Description>
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="PdfPig" Version="0.1.7" />
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.117" />
<PackageReference Include="Terminal.Gui" Version="1.10.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.4" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.4" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.4" />
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit b900e4a

Please sign in to comment.