Skip to content

Commit

Permalink
Split projects (btcpayserver#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier authored May 24, 2019
1 parent d86cc91 commit 15dc0d6
Show file tree
Hide file tree
Showing 46 changed files with 94 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Invoices;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down Expand Up @@ -76,7 +74,7 @@ public override string ToString()
return CryptoCode;
}

internal KeyPath GetRootKeyPath()
public KeyPath GetRootKeyPath()
{
return new KeyPath(NBitcoinNetwork.Consensus.SupportSegwit ? "49'" : "44'")
.Derive(CoinType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBitpayClient;
using NBXplorer;

namespace BTCPayServer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using NBitcoin;
using NBXplorer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Services.Rates;
using Microsoft.Extensions.Caching.Memory;
using NBitcoin;
using NBitpayClient;
using NBXplorer;

namespace BTCPayServer
Expand Down
13 changes: 13 additions & 0 deletions BTCPayServer.Common/BTCPayServer.Common.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.9" />
<PackageReference Include="NBitcoin" Version="4.1.2.32" />
<PackageReference Include="NBXplorer.Client" Version="2.0.0.16" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace BTCPayServer
{
class CustomThreadPool : IDisposable
public class CustomThreadPool : IDisposable
{
CancellationTokenSource _Cancel = new CancellationTokenSource();
TaskCompletionSource<bool> _Exited;
Expand Down
17 changes: 17 additions & 0 deletions BTCPayServer.Common/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace BTCPayServer
{
public static class UtilitiesExtensions
{
public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> items)
{
foreach (var item in items)
{
hashSet.Add(item);
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace BTCPayServer
{
class ZipUtils
public class ZipUtils
{
public static byte[] Zip(string unzipped)
{
Expand Down
23 changes: 23 additions & 0 deletions BTCPayServer.Rating/BTCPayServer.Rating.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

<ItemGroup>
<Folder Include="Providers\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.9" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.5.3" />
<PackageReference Include="NBitpayClient" Version="1.0.0.34" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Common\BTCPayServer.Common.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using BTCPayServer.Data;
using BTCPayServer.Logging;
using BTCPayServer.Rating;
using System.Threading;
using Microsoft.Extensions.Logging.Abstractions;
using BTCPayServer.Logging;

namespace BTCPayServer.Services.Rates
{
Expand Down Expand Up @@ -39,6 +39,7 @@ internal ExchangeRates GetResult()
}

IRateProvider _Inner;

public BackgroundFetcherRateProvider(IRateProvider inner)
{
if (inner == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using NBitcoin;
using BTCPayServer.Rating;
using System.Threading;

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using BTCPayServer.Rating;
using ExchangeSharp;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace BTCPayServer.Services.Rates
Expand Down
1 change: 1 addition & 0 deletions BTCPayServer.Tests/BTCPayServer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Rating\BTCPayServer.Rating.csproj" />
<ProjectReference Include="..\BTCPayServer\BTCPayServer.csproj" />
</ItemGroup>

Expand Down
8 changes: 5 additions & 3 deletions BTCPayServer/BTCPayServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<PackageReference Include="BuildBundlerMinifier" Version="2.9.406" />
<PackageReference Include="BundlerMinifier.Core" Version="2.9.406" />
<PackageReference Include="BundlerMinifier.TagHelpers" Version="2.9.406" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.5.3" />
<PackageReference Include="HtmlSanitizer" Version="4.0.207" />
<PackageReference Include="LedgerWallet" Version="2.0.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
Expand All @@ -47,10 +46,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NBitcoin" Version="4.1.2.32" />
<PackageReference Include="NBitpayClient" Version="1.0.0.34" />
<PackageReference Include="DBriize" Version="1.0.0.4" />
<PackageReference Include="NBXplorer.Client" Version="2.0.0.16" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NicolasDorier.CommandLine" Version="1.0.0.2" />
<PackageReference Include="NicolasDorier.CommandLine.Configuration" Version="1.0.0.3" />
Expand Down Expand Up @@ -140,6 +137,11 @@
<Folder Include="wwwroot\vendor\u2f" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BTCPayServer.Rating\BTCPayServer.Rating.csproj" />
<ProjectReference Include="..\BTCPayServer.Common\BTCPayServer.Common.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="Views\Apps\_ViewImports.cshtml">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
Expand Down
7 changes: 0 additions & 7 deletions BTCPayServer/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,6 @@ public static void SetIsBitpayAPI(this HttpContext ctx, bool value)
NBitcoin.Extensions.TryAdd(ctx.Items, "IsBitpayAPI", value);
}

public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> items)
{
foreach (var item in items)
{
hashSet.Add(item);
}
}
public static bool GetIsBitpayAPI(this HttpContext ctx)
{
return ctx.Items.TryGetValue("IsBitpayAPI", out object obj) &&
Expand Down
28 changes: 28 additions & 0 deletions btcpayserver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{29290EC7-0
Dockerfile.linuxarm32v7 = Dockerfile.linuxarm32v7
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BTCPayServer.Rating", "BTCPayServer.Rating\BTCPayServer.Rating.csproj", "{6DC77459-D52F-45EE-B3F3-315043D33A1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BTCPayServer.Common", "BTCPayServer.Common\BTCPayServer.Common.csproj", "{4BE42370-6114-4176-BFB3-37C6B6DA094D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -49,6 +53,30 @@ Global
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x64.Build.0 = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.ActiveCfg = Release|Any CPU
{B373F439-6E75-4A94-985D-10A0C7C500D0}.Release|x86.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x64.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x64.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x86.ActiveCfg = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Debug|x86.Build.0 = Debug|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|Any CPU.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x64.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x64.Build.0 = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.ActiveCfg = Release|Any CPU
{6DC77459-D52F-45EE-B3F3-315043D33A1B}.Release|x86.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x64.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x64.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x86.ActiveCfg = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Debug|x86.Build.0 = Debug|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|Any CPU.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x64.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x64.Build.0 = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.ActiveCfg = Release|Any CPU
{4BE42370-6114-4176-BFB3-37C6B6DA094D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 15dc0d6

Please sign in to comment.