Skip to content

Commit

Permalink
Moved to .Net Core 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bond-009 committed Aug 21, 2017
1 parent 1c0e7e2 commit fdda842
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 45 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,5 @@ $RECYCLE.BIN/
# Mac crap
.DS_Store

# VS Code stuff
.vscode

# Extra
docker-build
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dist: trusty
sudo: false
solution: iTool.DiscordBot.sln
mono: none
dotnet: 1.0.1
dotnet: 2.0.0
script:
- ./build.sh --quiet verify
notifications:
Expand Down
52 changes: 52 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcore2.0/iTool.DiscordBot.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<insert-target-framework-here>/iTool.DiscordBot.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet build",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

11 changes: 2 additions & 9 deletions docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ On Windows you need to execute this command: `dotnet restore && dotnet build -c

## Self-contained

You can build self-contained versions for Debian 8 x64 and Windows 10 x64
You can build a self-contained version for Windows 10 x64

Debian 8 x64: `dotnet restore && dotnet build -c Release -r debian.8-x64`

Windows 10: `dotnet restore && dotnet build -c Release -r win10-x64`
`dotnet restore && dotnet build -c Release -r win10-x64`

If you want a self-contained app for another OS you can change the `RuntimeIdentifiers` in iToolDiscordBot.csproj

and run `dotnet restore && dotnet build -c Release -r <RuntimeIdentifier>`

## Docker

To create a Docker image you need to build the bot first with this command: `dotnet restore && dotnet publish -c Release -r debian.8-x64 -o ../../docker-build`
Than you create the image with: `docker build .`
5 changes: 0 additions & 5 deletions docs/Running.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Running

When you run iTool.DiscordBot for the first time, it creates a settings folder with inside of it a settings.yaml file. Edit the settings.yaml file with your token and your preferred settings and start the bot again.

## Docker

When you run the container for the fist time it it creates a settings folder with inside of it a settings.yaml file. To edit the file copy it out of the container with: `docker cp <container>:publish/settings/settings.yaml settings.yaml`
Edit the settings file with your token and your preferred settings. Copy the settings file back into the container with: `docker cp settings.yaml <container>:publish/settings/settings.yaml` and start the container.
13 changes: 8 additions & 5 deletions src/iTool.DiscordBot/iTool.DiscordBot.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<NoWin32Manifest>true</NoWin32Manifest>
<RuntimeIdentifiers>debian.8-x64;win10-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Battlelog.Net" Version="0.1.3" />
<PackageReference Include="Battlelog.Net.Bf3" Version="0.1.3" />
Expand All @@ -13,12 +15,13 @@
<PackageReference Include="Discord.Net.Commands" Version="1.0.1" />
<PackageReference Include="Discord.Net.WebSocket" Version="1.0.1" />
<PackageReference Include="HOTSLogs.Net" Version="0.1.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.3.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
<PackageReference Include="OpenWeather.Net" Version="0.7.5" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="SteamWebAPI2" Version="4.0.1" />
<PackageReference Include="YamlDotNet" Version="4.2.1" />
<!--<PackageReference Include="YoutubeExplode" Version="3.2.0" />-->
<!--<PackageReference Include="YoutubeExplode" Version="3.2.2" />-->
</ItemGroup>

</Project>

0 comments on commit fdda842

Please sign in to comment.