1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 15:32:31 +01:00

fixed sqlite3.dll copying issues.

This commit is contained in:
kay.one 2013-03-23 21:56:59 -07:00
parent b04fb32f77
commit 192ace5004
11 changed files with 32 additions and 44 deletions

View File

@ -124,8 +124,7 @@
</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\x86\*.*" "$(TargetDir)"</PostBuildEvent>
</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -75,9 +75,10 @@ namespace NzbDrone.Core.Test.Framework
private void WithObjectDb(bool memory = true) private void WithObjectDb(bool memory = true)
{ {
var factory = new DbFactory(new EnvironmentProvider()); var factory = new DbFactory();
_db = new TestDatabase(factory.Create()); var dbConnection = factory.Create();
Mocker.SetConstant(Db); _db = new TestDatabase(dbConnection);
Mocker.SetConstant(dbConnection);
} }
[SetUp] [SetUp]

View File

@ -70,10 +70,6 @@
<Reference Include="AutoMoq"> <Reference Include="AutoMoq">
<HintPath>..\packages\AutoMoq.1.6.1\lib\AutoMoq.dll</HintPath> <HintPath>..\packages\AutoMoq.1.6.1\lib\AutoMoq.dll</HintPath>
</Reference> </Reference>
<Reference Include="DeskMetrics.NET, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\DeskMetrics\DeskMetrics.NET.dll</HintPath>
</Reference>
<Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL"> <Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath> <HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference> </Reference>
@ -316,9 +312,6 @@
<Content Include="Files\JsonError.txt"> <Content Include="Files\JsonError.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="sqlite\x64\sqlite3.dll" />
<Content Include="sqlite\x86\sqlite3.dll" />
<Content Include="sqlite\x86\sqlite3.exe" />
<None Include="Files\RSS\nzbx_search.json"> <None Include="Files\RSS\nzbx_search.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
@ -422,14 +415,11 @@
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>if not exist "$(TargetDir)x86" md "$(TargetDir)x86" <PreBuildEvent>
</PreBuildEvent>
xcopy /s /y "$(SolutionDir)\SqlCe\*.*" "$(TargetDir)"</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>if not exist "$(TargetDir)x86" md "$(TargetDir)x86" <PostBuildEvent>xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\x86\*.*" "$(TargetDir)"</PostBuildEvent>
xcopy /s /y "$(SolutionDir)\SqlCe\*.*" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,7 +1,7 @@
using System; using System;
using System.Data; using System.Data;
using NzbDrone.Common;
using ServiceStack.OrmLite; using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
namespace NzbDrone.Core.Datastore namespace NzbDrone.Core.Datastore
{ {
@ -12,21 +12,23 @@ namespace NzbDrone.Core.Datastore
public class DbFactory : IDbFactory public class DbFactory : IDbFactory
{ {
private readonly EnvironmentProvider _environmentProvider; private const string MemoryConnectionString = "Data Source=:memory:;Version=3;New=True;";
public DbFactory(EnvironmentProvider environmentProvider) static DbFactory()
{ {
_environmentProvider = environmentProvider; OrmLiteConfig.DialectProvider = new SqliteOrmLiteDialectProvider();
} }
public IDbConnection Create(string dbPath = null) public IDbConnection Create(string dbPath = null)
{ {
if (string.IsNullOrWhiteSpace(dbPath)) var connectionString = MemoryConnectionString;
if (!string.IsNullOrWhiteSpace(dbPath))
{ {
dbPath = _environmentProvider.GetObjectDbFolder(); connectionString = GetConnectionString(dbPath);
} }
var dbFactory = new OrmLiteConnectionFactory(GetConnectionString(dbPath)); var dbFactory = new OrmLiteConnectionFactory(connectionString);
return dbFactory.Open(); return dbFactory.Open();
} }

View File

@ -574,9 +574,6 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="NzbDrone.ico" /> <Content Include="NzbDrone.ico" />
<Content Include="sqlite\x64\sqlite3.dll" />
<Content Include="sqlite\x86\sqlite3.dll" />
<Content Include="sqlite\x86\sqlite3.exe" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Binary file not shown.

Binary file not shown.

View File

@ -85,8 +85,8 @@ Global
{D12F7F2F-8A3C-415F-88FA-6DD061A84869}.Services|x86.Build.0 = Release|x86 {D12F7F2F-8A3C-415F-88FA-6DD061A84869}.Services|x86.Build.0 = Release|x86
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|Mixed Platforms.Build.0 = Debug|x86
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x64.ActiveCfg = Debug|x64 {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x64.ActiveCfg = Debug|x64
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x64.Build.0 = Debug|x64 {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x64.Build.0 = Debug|x64
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x86.ActiveCfg = Debug|x86 {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Debug|x86.ActiveCfg = Debug|x86
@ -109,8 +109,8 @@ Global
{FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Services|x86.Build.0 = Release|x86 {FF5EE3B6-913B-47CE-9CEB-11C51B4E1205}.Services|x86.Build.0 = Release|x86
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|Mixed Platforms.Build.0 = Debug|x86
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x64.ActiveCfg = Debug|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x64.ActiveCfg = Debug|Any CPU
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x86.ActiveCfg = Debug|x86 {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x86.ActiveCfg = Debug|x86
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x86.Build.0 = Debug|x86 {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Debug|x86.Build.0 = Debug|x86
@ -129,8 +129,8 @@ Global
{193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Services|x86.ActiveCfg = Release|Any CPU {193ADD3B-792B-4173-8E4C-5A3F8F0237F0}.Services|x86.ActiveCfg = Release|Any CPU
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|Mixed Platforms.Build.0 = Debug|x86
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x64.ActiveCfg = Debug|Any CPU {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x64.ActiveCfg = Debug|Any CPU
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x86.ActiveCfg = Debug|x86 {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x86.ActiveCfg = Debug|x86
{C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x86.Build.0 = Debug|x86 {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5}.Debug|x86.Build.0 = Debug|x86
@ -203,8 +203,8 @@ Global
{35388E8E-0CDB-4A84-AD16-E4B6EFDA5D97}.Services|x86.Build.0 = Release|x86 {35388E8E-0CDB-4A84-AD16-E4B6EFDA5D97}.Services|x86.Build.0 = Release|x86
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|Mixed Platforms.Build.0 = Debug|x86
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x64.ActiveCfg = Debug|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x64.ActiveCfg = Debug|Any CPU
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x86.ActiveCfg = Debug|x86 {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x86.ActiveCfg = Debug|x86
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x86.Build.0 = Debug|x86 {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Debug|x86.Build.0 = Debug|x86
@ -223,8 +223,8 @@ Global
{F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Services|x86.ActiveCfg = Release|Any CPU {F2BE0FDF-6E47-4827-A420-DD4EF82407F8}.Services|x86.ActiveCfg = Release|Any CPU
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Any CPU.Build.0 = Debug|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|Mixed Platforms.Build.0 = Debug|x86
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x64.ActiveCfg = Debug|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x64.ActiveCfg = Debug|Any CPU
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x86.ActiveCfg = Debug|x86 {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x86.ActiveCfg = Debug|x86
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x86.Build.0 = Debug|x86 {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Debug|x86.Build.0 = Debug|x86
@ -243,8 +243,8 @@ Global
{BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Services|x86.ActiveCfg = Release|Any CPU {BEC74619-DDBB-4FBA-B517-D3E20AFC9997}.Services|x86.ActiveCfg = Release|Any CPU
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|Mixed Platforms.Build.0 = Debug|x86
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x64.ActiveCfg = Debug|Any CPU {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x64.ActiveCfg = Debug|Any CPU
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x86.ActiveCfg = Debug|x86 {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x86.ActiveCfg = Debug|x86
{CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x86.Build.0 = Debug|x86 {CADDFCE0-7509-4430-8364-2074E1EEFCA2}.Debug|x86.Build.0 = Debug|x86
@ -298,8 +298,8 @@ Global
{700D0B95-95CD-43F3-B6C9-FAA0FC1358D4}.Services|x86.Build.0 = Release|x86 {700D0B95-95CD-43F3-B6C9-FAA0FC1358D4}.Services|x86.Build.0 = Release|x86
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|Mixed Platforms.Build.0 = Debug|x86
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x64.ActiveCfg = Debug|Any CPU {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x64.ActiveCfg = Debug|Any CPU
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x86.ActiveCfg = Debug|x86 {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x86.ActiveCfg = Debug|x86
{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x86.Build.0 = Debug|x86 {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Debug|x86.Build.0 = Debug|x86

View File

@ -160,8 +160,7 @@
</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\x86\*.*" "$(TargetDir)"</PostBuildEvent>
</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.