Skip to content

Commit

Permalink
Merge e865f0e into ac48c18
Browse files Browse the repository at this point in the history
  • Loading branch information
dlidstrom authored Jan 16, 2022
2 parents ac48c18 + e865f0e commit 5ecf1be
Show file tree
Hide file tree
Showing 527 changed files with 19,041 additions and 18,189 deletions.
9 changes: 8 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# All files
[*]
indent_style = space

# Configuration files
[*.config]
indent_size = 2
insert_final_newline = true
charset = utf-8-bom

[*.{cs,fsx}]
guidelines = 100 2.5px solid 40ff0000

# Code files
[*.cs]
indent_size = 4
Expand All @@ -18,7 +23,7 @@ dotnet_diagnostic.CS8618.severity = warning
dotnet_analyzer_diagnostic.severity = warning

# IDE0065: Misplaced using directive
csharp_using_directive_placement = inside_namespace:error
csharp_using_directive_placement = outside_namespace:error

# IDE0045: Convert to conditional expression
dotnet_diagnostic.IDE0045.severity = silent
Expand All @@ -31,3 +36,5 @@ dotnet_diagnostic.IDE0051.severity = silent

# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = silent

csharp_style_namespace_declarations = file_scoped:warning
27 changes: 22 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-windows:
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/cache@v2
id: cache
with:
path: ~/.nuget/packages
path: packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
Expand All @@ -43,10 +43,15 @@ jobs:
#if: steps.cache.outputs.cache-hit != 'true'
run: |
nuget restore Snittlistan.sln
Get-ChildItem -Recurse C:\Users\runneradmin\.nuget
- name: Build
run: msbuild build.build -t:All -p:Version=$env:BUILD_VERSION -p:WIX_PATH=$env:wix -p:NUnitConsoleRunnerPath=C:\Users\runneradmin\.nuget\packages\nunit.consolerunner\3.12.0\
run: msbuild build.build -t:All -p:Version=$env:BUILD_VERSION -p:WIX_PATH=$env:wix -p:NUnitConsoleRunnerPath=packages\nunit.consolerunner\3.12.0\

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: 'Test Result'
path: Build\_build\TestResult.html

- name: Push tag
id: tag
Expand All @@ -55,6 +60,18 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.BUILD_VERSION }}

- name: Comment pull request
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const filename = "Build/_build/TestResult.html";
const contents = fs.readFileSync(filename, "utf8");
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: contents });
- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -64,7 +81,7 @@ jobs:
tag_name: ${{ steps.tag.outputs.new_tag }}
release_name: Release v${{ steps.tag.outputs.new_tag }}
draft: false
prerelease: false
prerelease: ${{ github.event_name == 'pull_request' }}

- name: Upload artifact
id: upload-artifact
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ obj/
_ReSharper*/
[Tt]est[Rr]esult*
packages
Snittlistan.Web/Web.Release.config
Snittlistan.Web/Snittlistan.Publish.xml
Snittlistan.Web/App_Data/Database
Tools/
Expand Down
7 changes: 7 additions & 0 deletions Globals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma warning disable IDE0005 // Using directive is unnecessary.

global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
10 changes: 10 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="./packages" />
<add key="globalPackagesFolder" value="./packages" />
</config>
<settings>
<repositoryPath>./packages</repositoryPath>
</settings>
</configuration>
41 changes: 17 additions & 24 deletions Snittlistan.Queue.ConsoleHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
#nullable enable
using System.Configuration;
using Snittlistan.Queue.Config;

namespace Snittlistan.Queue.ConsoleHost
{
using System;
using System.Configuration;
using Npgsql.Logging;
using Snittlistan.Queue.Config;
using Snittlistan.Queue.Infrastructure;
#nullable enable

public class Program
namespace Snittlistan.Queue.ConsoleHost;
public class Program
{
public static void Main()
{
public static void Main()
{
Console.WriteLine("Press [ENTER] to start.");
_ = Console.ReadLine();
NpgsqlLogManager.Provider = new NLogLoggingProvider();
NpgsqlLogManager.IsParameterLoggingEnabled = true;
Application application = new(
(MessagingConfigSection)ConfigurationManager.GetSection("messaging"),
ConfigurationManager.AppSettings["UrlScheme"],
Convert.ToInt32(ConfigurationManager.AppSettings["Port"]));
application.Start();
Console.WriteLine("Press [ENTER] to stop.");
_ = Console.ReadLine();
application.Stop();
}
Console.WriteLine("Press [ENTER] to start.");
_ = Console.ReadLine();
Application application = new(
(MessagingConfigSection)ConfigurationManager.GetSection("messaging"),
ConfigurationManager.AppSettings["UrlScheme"],
Convert.ToInt32(ConfigurationManager.AppSettings["Port"]));
application.Start();
Console.WriteLine("Press [ENTER] to stop.");
_ = Console.ReadLine();
application.Stop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Globals.cs">
<Link>Globals.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
96 changes: 0 additions & 96 deletions Snittlistan.Queue.ConsoleHost/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@
"resolved": "4.7.12",
"contentHash": "cFe+YQVxghBt4hoB8IH+XVW/vyS6rWJPfWmm0rmgS/iaI3lzzFsGRzjw3VhByovLugw7Zp3kY7nVUWADCu6n2g=="
},
"EntityFramework": {
"type": "Transitive",
"resolved": "6.4.0",
"contentHash": "7jDmcQ3jaN5G7ZJC7Ecq161zQBs/5LqRzBdZ/I4XfmSvOwteGgNjOi30kthFador4Qjo3qUU6iOB1H04GIXrpg=="
},
"EntityFramework6.Npgsql": {
"type": "Transitive",
"resolved": "6.4.3",
"contentHash": "iZnc+FlaBaK97zGHR0KS0bnwKQ2gWPpaOoSYNHfjLZ4lr4UEPRFQnh/bpW9Q50ZbNNbDRCs+W12QyVn+sKsSwA==",
"dependencies": {
"EntityFramework": "6.4.0",
"Npgsql": "4.1.3"
}
},
"Microsoft.AspNet.WebApi.Client": {
"type": "Transitive",
"resolved": "5.2.7",
Expand All @@ -36,14 +22,6 @@
"Newtonsoft.Json": "6.0.4"
}
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "1.0.0",
"contentHash": "K63Y4hORbBcKLWH5wnKgzyn7TOfYzevIEwIedQHBIkmkEBA9SCqgvom+XTuE+fAFGvINGkhFItaZ2dvMGdT5iw==",
"dependencies": {
"System.Threading.Tasks.Extensions": "4.5.2"
}
},
"MicrosoftWebMvc": {
"type": "Transitive",
"resolved": "2.0.0",
Expand All @@ -70,83 +48,9 @@
"resolved": "13.0.1",
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
},
"Npgsql": {
"type": "Transitive",
"resolved": "4.1.3",
"contentHash": "sWTXCb6WPPO7WEw4+1XoRqE49EdWmuyMA15LVbzV6jZgRxYWK8TbdniWMjguzmAgOZVYTmrCf+jsqPYoSqACvA==",
"dependencies": {
"System.Memory": "4.5.3",
"System.Runtime.CompilerServices.Unsafe": "4.6.0",
"System.Text.Json": "4.6.0",
"System.Threading.Tasks.Extensions": "4.5.3",
"System.ValueTuple": "4.5.0"
}
},
"System.Buffers": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "pL2ChpaRRWI/p4LXyy4RgeWlYF2sgfj/pnVMvBqwNFr5cXg7CXNnWZWxrOONLg8VGdFB8oB+EG2Qw4MLgTOe+A=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
"dependencies": {
"System.Buffers": "4.4.0",
"System.Numerics.Vectors": "4.4.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Numerics.Vectors": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ=="
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "4.6.0",
"contentHash": "HxozeSlipUK7dAroTYwIcGwKDeOVpQnJlpVaOkBz7CM4TsE5b/tKlQBZecTjh6FzcSbxndYaxxpsBMz+wMJeyw=="
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "4.6.0",
"contentHash": "BXgFO8Yi7ao7hVA/nklD0Hre1Bbce048ZqryGZVFifGNPuh+2jqF1i/jLJLMfFGZIzUOw+nCIeH24SQhghDSPw==",
"dependencies": {
"System.Memory": "4.5.3"
}
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "4.6.0",
"contentHash": "4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "1.0.0",
"System.Buffers": "4.5.0",
"System.Memory": "4.5.3",
"System.Numerics.Vectors": "4.5.0",
"System.Runtime.CompilerServices.Unsafe": "4.6.0",
"System.Text.Encodings.Web": "4.6.0",
"System.Threading.Tasks.Extensions": "4.5.2",
"System.ValueTuple": "4.5.0"
}
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.ValueTuple": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"snittlistan.queue": {
"type": "Project",
"dependencies": {
"EntityFramework6.Npgsql": "6.4.3",
"Lindhart.Analyser.MissingAwaitWarning": "2.0.0",
"Microsoft.AspNet.WebApi.Client": "5.2.7",
"MvcContrib": "2.0.95",
Expand Down
16 changes: 0 additions & 16 deletions Snittlistan.Queue.WindowsServiceHost/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
<configuration>
<configSections>
<section name="messaging" type="Snittlistan.Queue.Config.MessagingConfigSection, Snittlistan.Queue" />
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework" />
</configSections>
<appSettings>
<add key="UrlScheme" value="http" />
<add key="Port" value="61026"/>
</appSettings>
<connectionStrings>
<add name="DatabaseContext" connectionString="Server=localhost;Database=snittlistan;Username=postgres;Password=postgres" providerName="Npgsql" />
</connectionStrings>
<messaging>
<queueListeners>
<!-- name attribute must be unique -->
Expand All @@ -22,18 +18,6 @@
<add name="TaskQueue" isEnabled="true" readQueue=".\Private$\taskqueue" workerThreads="1" autoCreateQueues="true" />
</queueListeners>
</messaging>
<entityFramework>
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
</providers>
<!-- setting the default connection factory is optional -->
<defaultConnectionFactory type="Npgsql.NpgsqlConnectionFactory, EntityFramework6.Npgsql" />
</entityFramework>
<system.data>
<DbProviderFactories>
<add name="Npgsql Provider" invariant="Npgsql" description=".NET Framework Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Version=4.1.3.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
</DbProviderFactories>
</system.data>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
Expand Down
5 changes: 5 additions & 0 deletions Snittlistan.Queue.WindowsServiceHost/Globals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
Loading

0 comments on commit 5ecf1be

Please sign in to comment.