fixed sqlite3.dll copying issues.

pull/4/head
kay.one 11 years ago
parent b04fb32f77
commit 192ace5004

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

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

@ -70,10 +70,6 @@
<Reference Include="AutoMoq">
<HintPath>..\packages\AutoMoq.1.6.1\lib\AutoMoq.dll</HintPath>
</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">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference>
@ -316,9 +312,6 @@
<Content Include="Files\JsonError.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</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">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@ -422,14 +415,11 @@
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
xcopy /s /y "$(SolutionDir)\SqlCe\*.*" "$(TargetDir)"</PreBuildEvent>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>if not exist "$(TargetDir)x86" md "$(TargetDir)x86"
xcopy /s /y "$(SolutionDir)\SqlCe\*.*" "$(TargetDir)"</PostBuildEvent>
<PostBuildEvent>xcopy /s /y "$(SolutionDir)\Libraries\Sqlite\x86\*.*" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

@ -1,7 +1,7 @@
using System;
using System.Data;
using NzbDrone.Common;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
namespace NzbDrone.Core.Datastore
{
@ -12,21 +12,23 @@ namespace NzbDrone.Core.Datastore
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)
{
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();
}

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

@ -85,8 +85,8 @@ Global
{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.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.Build.0 = 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|x86
{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|x86.ActiveCfg = Debug|x86
@ -109,8 +109,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86
@ -129,8 +129,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86
@ -203,8 +203,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86
@ -223,8 +223,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86
@ -243,8 +243,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86
@ -298,8 +298,8 @@ Global
{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.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.Build.0 = 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|x86
{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.Build.0 = Debug|x86

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

Loading…
Cancel
Save