Upgraded to .net core 2.0
This commit is contained in:
parent
a127e43dc0
commit
6bea4b9f02
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"sdk": { "version": "1.0.1" }
|
"sdk": { "version": "2.0.0" }
|
||||||
}
|
}
|
@ -1,31 +1,18 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>General purpose Discord bot written in C#.</Description>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Copyright>Kwoth</Copyright>
|
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
|
||||||
<Authors>Kwoth</Authors>
|
<OutputType>exe</OutputType>
|
||||||
<PublisherName>Kwoth</PublisherName>
|
<AssetTargetFallback>$(AssetTargetFallback);dnxcore50;portable-net45+win8+wpa81</AssetTargetFallback>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<AssemblyName>NadekoBot</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<PackageId>NadekoBot</PackageId>
|
|
||||||
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8+wpa81</PackageTargetFallback>
|
|
||||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
|
||||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
|
||||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
|
||||||
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
|
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
|
||||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.0.0</FileVersion>
|
|
||||||
<ApplicationIcon>nadeko_icon.ico</ApplicationIcon>
|
<ApplicationIcon>nadeko_icon.ico</ApplicationIcon>
|
||||||
<RuntimeIdentifiers>win7-x64<!--;ubuntu.14.04-x64;osx.10.10-x64 --></RuntimeIdentifiers>
|
<RuntimeIdentifiers>win7-x64<!--;ubuntu.14.04-x64;osx.10.10-x64 --></RuntimeIdentifiers>
|
||||||
<Configurations>Debug;Release;global_nadeko</Configurations>
|
<Configurations>Debug;Release;global_nadeko</Configurations>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Version)' == '' ">
|
<PropertyGroup Condition=" '$(Version)' == '' ">
|
||||||
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">1.4.1</VersionPrefix>
|
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">1.9.1</VersionPrefix>
|
||||||
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix).$(VersionSuffix)</Version>
|
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix).$(VersionSuffix)</Version>
|
||||||
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
|
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -60,28 +47,24 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AngleSharp" Version="0.9.9" />
|
<PackageReference Include="AngleSharp" Version="0.9.9" />
|
||||||
<PackageReference Include="Discord.Net" Version="2.0.0-alpha-build-00828" />
|
<PackageReference Include="Discord.Net" Version="2.0.0-alpha-build-00828" />
|
||||||
<PackageReference Include="libvideo" Version="1.0.1" />
|
<PackageReference Include="CoreCLR-NCalc" Version="2.1.3" />
|
||||||
<PackageReference Include="CoreCLR-NCalc" Version="2.1.2" />
|
<PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.29.1.138" />
|
||||||
<PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.19.0.138" />
|
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.29.1.976" />
|
||||||
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.20.0.701" />
|
<PackageReference Include="Google.Apis.Customsearch.v1" Version="1.29.1.896" />
|
||||||
<PackageReference Include="Google.Apis.Customsearch.v1" Version="1.20.0.466" />
|
|
||||||
<PackageReference Include="ImageSharp" Version="1.0.0-alpha9-00194" />
|
<PackageReference Include="ImageSharp" Version="1.0.0-alpha9-00194" />
|
||||||
<PackageReference Include="ImageSharp.Drawing" Version="1.0.0-alpha9-00189" />
|
<PackageReference Include="ImageSharp.Drawing" Version="1.0.0-alpha9-00189" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
<PackageReference Include="NLog" Version="5.0.0-beta10" />
|
||||||
<PackageReference Include="NLog" Version="5.0.0-beta03" />
|
|
||||||
<PackageReference Include="NYoutubeDL" Version="0.4.4" />
|
|
||||||
<PackageReference Include="StackExchange.Redis" Version="1.2.6" />
|
<PackageReference Include="StackExchange.Redis" Version="1.2.6" />
|
||||||
<PackageReference Include="System.ValueTuple" Version="4.4.0-preview1-25305-02" />
|
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
|
||||||
<PackageReference Include="System.Xml.XPath" Version="4.3.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'GlobalNadeko' ">
|
||||||
@ -89,21 +72,13 @@
|
|||||||
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>
|
<NoWarn>$(NoWarn);CS1573;CS1591</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
|
||||||
<LangVersion>latest</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<LangVersion>latest</LangVersion>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='global_nadeko|AnyCPU'">
|
|
||||||
<LangVersion>latest</LangVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
|
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
|
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
|
||||||
<metadata>
|
|
||||||
<id>NadekoBot</id>
|
|
||||||
<version>1.4.0-2$suffix$</version>
|
|
||||||
<title>NadekoBot</title>
|
|
||||||
<authors>Kwoth</authors>
|
|
||||||
<owners>Kwoth</owners>
|
|
||||||
<description>General purpose discord chat bot written in C#.</description>
|
|
||||||
<tags>nadeko;bot;nadekobot;discord bot</tags>
|
|
||||||
<projectUrl>https://github.com/Kwoth/NadekoBot</projectUrl>
|
|
||||||
<licenseUrl>https://choosealicense.com/licenses/unlicense/</licenseUrl>
|
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
|
||||||
</metadata>
|
|
||||||
</package>
|
|
@ -1,7 +0,0 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Cadministration_005Ccommands/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Cgambling_005Ccommands/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Cgames_005Ccommands/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Cpermissions_005Ccommands/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Csearches_005Ccommands/@EntryIndexedValue">True</s:Boolean>
|
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=modules_005Cutility_005Ccommands/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -1,19 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("NadekoBot")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyInformationalVersion("1.0")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("f8225ac4-3cbc-40b4-bcf3-1cacf276bf29")]
|
|
@ -3,22 +3,16 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NadekoBot.Services.Database.Models;
|
using NadekoBot.Services.Database.Models;
|
||||||
using NadekoBot.Extensions;
|
using NadekoBot.Extensions;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using System;
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Design;
|
||||||
|
|
||||||
namespace NadekoBot.Services.Database
|
namespace NadekoBot.Services.Database
|
||||||
{
|
{
|
||||||
|
public class NadekoContextFactory : IDesignTimeDbContextFactory<NadekoContext>
|
||||||
public class NadekoContextFactory : IDbContextFactory<NadekoContext>
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
public NadekoContext CreateDbContext(string[] args)
|
||||||
/// :\ Used for migrations
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="options"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public NadekoContext Create(DbContextFactoryOptions options)
|
|
||||||
{
|
{
|
||||||
var optionsBuilder = new DbContextOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder<NadekoContext>();
|
||||||
optionsBuilder.UseSqlite("Filename=./data/NadekoBot.db");
|
optionsBuilder.UseSqlite("Filename=./data/NadekoBot.db");
|
||||||
var ctx = new NadekoContext(optionsBuilder.Options);
|
var ctx = new NadekoContext(optionsBuilder.Options);
|
||||||
ctx.Database.SetCommandTimeout(60);
|
ctx.Database.SetCommandTimeout(60);
|
||||||
@ -58,12 +52,7 @@ namespace NadekoBot.Services.Database
|
|||||||
public DbSet<ModulePrefix> ModulePrefixes { get; set; }
|
public DbSet<ModulePrefix> ModulePrefixes { get; set; }
|
||||||
public DbSet<RewardedUser> RewardedUsers { get; set; }
|
public DbSet<RewardedUser> RewardedUsers { get; set; }
|
||||||
|
|
||||||
public NadekoContext() : base()
|
public NadekoContext(DbContextOptions<NadekoContext> options) : base(options)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public NadekoContext(DbContextOptions options) : base(options)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +220,7 @@ namespace NadekoBot.Services.Database
|
|||||||
musicPlaylistEntity
|
musicPlaylistEntity
|
||||||
.HasMany(p => p.Songs)
|
.HasMany(p => p.Songs)
|
||||||
.WithOne()
|
.WithOne()
|
||||||
.OnDelete(Microsoft.EntityFrameworkCore.Metadata.DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -6,19 +6,19 @@ namespace NadekoBot.Services
|
|||||||
{
|
{
|
||||||
public class DbService
|
public class DbService
|
||||||
{
|
{
|
||||||
private readonly DbContextOptions options;
|
private readonly DbContextOptions<NadekoContext> options;
|
||||||
private readonly DbContextOptions migrateOptions;
|
private readonly DbContextOptions<NadekoContext> migrateOptions;
|
||||||
|
|
||||||
private readonly string _connectionString;
|
private readonly string _connectionString;
|
||||||
|
|
||||||
public DbService(IBotCredentials creds)
|
public DbService(IBotCredentials creds)
|
||||||
{
|
{
|
||||||
_connectionString = creds.Db.ConnectionString;
|
_connectionString = creds.Db.ConnectionString;
|
||||||
var optionsBuilder = new DbContextOptionsBuilder();
|
var optionsBuilder = new DbContextOptionsBuilder<NadekoContext>();
|
||||||
optionsBuilder.UseSqlite(creds.Db.ConnectionString);
|
optionsBuilder.UseSqlite(creds.Db.ConnectionString);
|
||||||
options = optionsBuilder.Options;
|
options = optionsBuilder.Options;
|
||||||
|
|
||||||
optionsBuilder = new DbContextOptionsBuilder();
|
optionsBuilder = new DbContextOptionsBuilder<NadekoContext>();
|
||||||
optionsBuilder.UseSqlite(creds.Db.ConnectionString, x => x.SuppressForeignKeyEnforcement());
|
optionsBuilder.UseSqlite(creds.Db.ConnectionString, x => x.SuppressForeignKeyEnforcement());
|
||||||
migrateOptions = optionsBuilder.Options;
|
migrateOptions = optionsBuilder.Options;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace NadekoBot.Services
|
|||||||
var logConfig = new LoggingConfiguration();
|
var logConfig = new LoggingConfiguration();
|
||||||
var consoleTarget = new ColoredConsoleTarget()
|
var consoleTarget = new ColoredConsoleTarget()
|
||||||
{
|
{
|
||||||
Layout = @"${date:format=HH\:mm\:ss} ${logger} | ${message}"
|
Layout = @"${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}"
|
||||||
};
|
};
|
||||||
logConfig.AddTarget("Console", consoleTarget);
|
logConfig.AddTarget("Console", consoleTarget);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user