Work on adding stylecop with custom anaylsis ruleset.

This commit is contained in:
Jordan Brown
2018-11-27 17:32:58 -05:00
parent 7a415e2fd4
commit 51da02dd61
37 changed files with 1410 additions and 57 deletions
+1
View File
@@ -1,4 +1,5 @@
.dockerignore
!build/analyzers.ruleset
.git
.gitignore
.vs
File diff suppressed because it is too large Load Diff
+25 -23
View File
@@ -1,12 +1,12 @@
using System;
using Microsoft.AspNetCore.Http.Headers;
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http.Headers;
using System.Reflection;
using Microsoft.AspNetCore.Http.Headers;
using Microsoft.Net.Http.Headers;
using Microsoft.Extensions.Primitives;
namespace Tgstation.Server.Api
{
@@ -28,32 +28,32 @@ namespace Tgstation.Server.Api
/// <summary>
/// The <see cref="Username"/> header key
/// </summary>
const string usernameHeader = "Username";
const string UsernameHeader = "Username";
/// <summary>
/// The <see cref="InstanceId"/> header key
/// </summary>
const string instanceIdHeader = "Instance";
const string InstanceIdHeader = "Instance";
/// <summary>
/// The JWT authentication header scheme
/// </summary>
const string jwtAuthenticationScheme = "Bearer";
const string JwtAuthenticationScheme = "Bearer";
/// <summary>
/// The password authentication header scheme
/// </summary>
const string passwordAuthenticationScheme = "Password";
const string PasswordAuthenticationScheme = "Password";
/// <summary>
/// The current <see cref="AssemblyName"/>
/// The current <see cref="System.Reflection.AssemblyName"/>
/// </summary>
static readonly AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
static readonly AssemblyName AssemblyName = Assembly.GetExecutingAssembly().GetName();
/// <summary>
/// Get the version of the <see cref="Api"/> the caller is using
/// </summary>
public static Version Version => assemblyName.Version;
public static Version Version => AssemblyName.Version;
/// <summary>
/// The <see cref="Models.Instance.Id"/> being accessed
@@ -139,12 +139,12 @@ namespace Tgstation.Server.Api
if (!requestHeaders.Headers.TryGetValue(HeaderNames.UserAgent, out var userAgentValues) || !ProductInfoHeaderValue.TryParse(userAgentValues.FirstOrDefault(), out var clientUserAgent))
throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Missing {0} headers!", HeaderNames.UserAgent));
//assure the client user agent has a name and version
// assure the client user agent has a name and version
if (String.IsNullOrWhiteSpace(clientUserAgent.Product.Name) || !Version.TryParse(clientUserAgent.Product.Version, out var clientVersion))
throw new InvalidOperationException("Malformed client user agent!");
//make sure the api header matches ours
if (!requestHeaders.Headers.TryGetValue(ApiVersionHeader, out var apiUserAgentHeaderValues) || !ProductInfoHeaderValue.TryParse(apiUserAgentHeaderValues.FirstOrDefault(), out var apiUserAgent) || apiUserAgent.Product.Name != assemblyName.Name)
// make sure the api header matches ours
if (!requestHeaders.Headers.TryGetValue(ApiVersionHeader, out var apiUserAgentHeaderValues) || !ProductInfoHeaderValue.TryParse(apiUserAgentHeaderValues.FirstOrDefault(), out var apiUserAgent) || apiUserAgent.Product.Name != AssemblyName.Name)
throw new InvalidOperationException("Missing API version!");
if (!Version.TryParse(apiUserAgent.Product.Version, out var apiVersion))
@@ -166,7 +166,7 @@ namespace Tgstation.Server.Api
if (String.IsNullOrEmpty(parameter))
throw new InvalidOperationException("Missing authentication parameter!");
if (requestHeaders.Headers.TryGetValue(instanceIdHeader, out var instanceIdValues))
if (requestHeaders.Headers.TryGetValue(InstanceIdHeader, out var instanceIdValues))
{
var instanceIdString = instanceIdValues.FirstOrDefault();
if (instanceIdString != default && Int64.TryParse(instanceIdString, out var instanceId))
@@ -175,17 +175,18 @@ namespace Tgstation.Server.Api
switch (scheme)
{
case jwtAuthenticationScheme:
case JwtAuthenticationScheme:
Token = parameter;
break;
case passwordAuthenticationScheme:
case PasswordAuthenticationScheme:
Password = parameter;
var fail = !requestHeaders.Headers.TryGetValue(usernameHeader, out var values);
var fail = !requestHeaders.Headers.TryGetValue(UsernameHeader, out var values);
if (!fail)
{
Username = values.FirstOrDefault();
fail = String.IsNullOrWhiteSpace(Username);
}
if (fail)
throw new InvalidOperationException("Missing Username header!");
break;
@@ -231,17 +232,18 @@ namespace Tgstation.Server.Api
headers.Clear();
headers.Accept.Add(new MediaTypeWithQualityHeaderValue(ApplicationJson));
if (IsTokenAuthentication)
headers.Authorization = new AuthenticationHeaderValue(jwtAuthenticationScheme, Token);
headers.Authorization = new AuthenticationHeaderValue(JwtAuthenticationScheme, Token);
else
{
headers.Authorization = new AuthenticationHeaderValue(passwordAuthenticationScheme, Password);
headers.Add(usernameHeader, Username);
headers.Authorization = new AuthenticationHeaderValue(PasswordAuthenticationScheme, Password);
headers.Add(UsernameHeader, Username);
}
headers.UserAgent.Add(new ProductInfoHeaderValue(UserAgent));
headers.Add(ApiVersionHeader, new ProductHeaderValue(assemblyName.Name, ApiVersion.ToString()).ToString());
headers.Add(ApiVersionHeader, new ProductHeaderValue(AssemblyName.Name, ApiVersion.ToString()).ToString());
instanceId = instanceId ?? InstanceId;
if (instanceId.HasValue)
headers.Add(instanceIdHeader, instanceId.ToString());
headers.Add(InstanceIdHeader, instanceId.ToString());
}
}
}
@@ -2,7 +2,9 @@
namespace Tgstation.Server.Api.Models
{
/// <inheritdoc />
/// <summary>
/// Represents administrative server information
/// </summary>
public sealed class Administration
{
/// <summary>
@@ -9,6 +9,7 @@
/// Internet relay chat
/// </summary>
Irc,
/// <summary>
/// Superior chat service
/// </summary>
@@ -28,6 +28,8 @@
/// <summary>
/// The content of the <see cref="ConfigurationFile"/>. Will be <see langword="null"/> if <see cref="AccessDenied"/> is <see langword="true"/> or during listing and write operations
/// </summary>
#pragma warning disable CA1819 // Properties should not return arrays
public byte[] Content { get; set; }
#pragma warning restore CA1819 // Properties should not return arrays
}
}
@@ -9,10 +9,12 @@
/// Configuration editing is not allowed
/// </summary>
Disallowed,
/// <summary>
/// Configuration editing is allowed by all users on all files
/// </summary>
HostWrite,
/// <summary>
/// Co
/// </summary>
@@ -9,10 +9,12 @@
/// Server is unrestricted in terms of file access and shell commands
/// </summary>
Trusted,
/// <summary>
/// Server will not be able to run shell commands or access files outside it's working directory
/// </summary>
Safe,
/// <summary>
/// Server will not be able to run shell commands or access anything but temporary files. Currently unsupported!
/// </summary>
@@ -11,10 +11,12 @@
/// Server is not running
/// </summary>
Offline,
/// <summary>
/// Server is being rebooted
/// </summary>
HardRebooting,
/// <summary>
/// Server is running
/// </summary>
@@ -10,13 +10,15 @@ namespace Tgstation.Server.Api.Models.Internal
/// <summary>
/// The revision sha
/// </summary>
[Required, StringLength(40)]
[Required]
[StringLength(40)]
public string CommitSha { get; set; }
/// <summary>
/// The sha of the most recent remote commit
/// </summary>
[Required, StringLength(40)]
[Required]
[StringLength(40)]
public string OriginCommitSha { get; set; }
}
}
@@ -87,6 +87,8 @@ namespace Tgstation.Server.Api.Models
case IrcPasswordType.Server:
PasswordType = passwordType;
break;
default:
break;
}
if (splits.Length < 6)
@@ -116,6 +118,7 @@ namespace Tgstation.Server.Api.Models
sb.Append(';');
sb.Append(Password);
}
return sb.ToString();
}
}
@@ -9,10 +9,12 @@
/// Use server authentication
/// </summary>
Server,
/// <summary>
/// Use PLAIN sasl authentication
/// </summary>
Sasl,
/// <summary>
/// Use NickServ authentication
/// </summary>
@@ -12,22 +12,27 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User can edit themself and other <see cref="Models.User"/>s and also create others
/// </summary>
WriteUsers = 1,
/// <summary>
/// User can gracefully restart the host
/// </summary>
RestartHost = 2,
/// <summary>
/// User can change <see cref="Models.Administration.NewVersion"/>
/// </summary>
ChangeVersion = 4,
/// <summary>
/// User can change their password
/// </summary>
EditOwnPassword = 8,
/// <summary>
/// User can read info and rights of other users
/// </summary>
@@ -12,18 +12,22 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may check the active installed BYOND version
/// </summary>
ReadActive = 1,
/// <summary>
/// User may list all installed BYOND versions
/// </summary>
ListInstalled = 2,
/// <summary>
/// User may change the active BYOND version
/// </summary>
ChangeVersion = 4,
/// <summary>
/// User may cancel version installations
/// </summary>
@@ -12,38 +12,47 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User can change <see cref="Models.Internal.ChatBot.Enabled"/>
/// </summary>
WriteEnabled = 1,
/// <summary>
/// User can change <see cref="Models.Internal.ChatBot.Provider"/>
/// </summary>
WriteProvider = 2,
/// <summary>
/// User can change <see cref="Models.ChatBot.Channels"/>
/// </summary>
WriteChannels = 4,
/// <summary>
/// User can change <see cref="Models.Internal.ChatBot.ConnectionString"/>
/// </summary>
WriteConnectionString = 8,
/// <summary>
/// User can read <see cref="Models.Internal.ChatBot.ConnectionString"/> requires <see cref="Read"/>
/// </summary>
ReadConnectionString = 16,
/// <summary>
/// User can read all chat settings except <see cref="Models.Internal.ChatBot.ConnectionString"/>
/// </summary>
Read = 32,
/// <summary>
/// User can create new <see cref="Models.ChatBot"/>
/// </summary>
Create = 64,
/// <summary>
/// User can delete <see cref="Models.ChatBot"/>
/// </summary>
Delete = 128,
/// <summary>
/// User can change <see cref="Models.Internal.ChatBot.Name"/>
/// </summary>
@@ -12,18 +12,22 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// </summary>
Read = 1,
/// <summary>
/// User may write files
/// </summary>
Write = 2,
/// <summary>
/// User may list files
/// </summary>
List = 4,
/// <summary>
/// User may delete empty folders
/// </summary>
@@ -12,50 +12,62 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User can read <see cref="Models.DreamDaemon.ActiveCompileJob"/> and <see cref="Models.DreamDaemon.StagedCompileJob"/>
/// </summary>
ReadRevision = 1,
/// <summary>
/// User can change both primary and secondary ports
/// </summary>
SetPorts = 2,
/// <summary>
/// User can change <see cref="Models.Internal.DreamDaemonSettings.AutoStart"/>
/// </summary>
SetAutoStart = 4,
/// <summary>
/// User set <see cref="Models.Internal.DreamDaemonLaunchParameters.SecurityLevel"/>
/// </summary>
SetSecurity = 8,
/// <summary>
/// User can read all ports, <see cref="Models.Internal.DreamDaemonSettings.SoftRestart"/>, <see cref="Models.Internal.DreamDaemonSettings.SoftShutdown"/>, <see cref="Models.DreamDaemon.Running"/>, <see cref="Models.Internal.DreamDaemonLaunchParameters.AllowWebClient"/>, and <see cref="Models.Internal.DreamDaemonSettings.AutoStart"/>
/// </summary>
ReadMetadata = 16,
/// <summary>
/// User can change <see cref="Models.Internal.DreamDaemonLaunchParameters.AllowWebClient"/>
/// </summary>
SetWebClient = 32,
/// <summary>
/// User can enable <see cref="Models.Internal.DreamDaemonSettings.SoftRestart"/>
/// </summary>
SoftRestart = 64,
/// <summary>
/// User can enable <see cref="Models.Internal.DreamDaemonSettings.SoftShutdown"/>
/// </summary>
SoftShutdown = 128,
/// <summary>
/// User can immediately restart <see cref="Models.DreamDaemon"/>
/// </summary>
Restart = 256,
/// <summary>
/// User can immediately shutdown <see cref="Models.DreamDaemon"/>
/// </summary>
Shutdown = 512,
/// <summary>
/// User can start <see cref="Models.DreamDaemon"/> and disable <see cref="Models.Internal.DreamDaemonSettings.SoftRestart"/> and <see cref="Models.Internal.DreamDaemonSettings.SoftShutdown"/>
/// </summary>
Start = 1024,
/// <summary>
/// User can change <see cref="Models.Internal.DreamDaemonLaunchParameters.StartupTimeout"/>
/// </summary>
@@ -12,30 +12,37 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read <see cref="Models.DreamMaker"/> status
/// </summary>
Read = 1,
/// <summary>
/// User may trigger compiles
/// </summary>
Compile = 2,
/// <summary>
/// User may cancel compiles
/// </summary>
CancelCompile = 4,
/// <summary>
/// User may modify <see cref="Models.DreamMaker.ProjectName"/>
/// </summary>
SetDme = 8,
/// <summary>
/// User may modify <see cref="Models.DreamMaker.ApiValidationPort"/>
/// </summary>
SetApiValidationPort = 16,
/// <summary>
/// User may list and read all <see cref="Models.CompileJob"/>s
/// </summary>
CompileJobs = 32,
/// <summary>
/// User may modify <see cref="Models.DreamMaker.ApiValidationSecurityLevel"/>
/// </summary>
@@ -12,38 +12,47 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User can view <see cref="Models.Instance"/>s which they have any rights for
/// </summary>
Read = 1,
/// <summary>
/// User can create <see cref="Models.Instance"/>s
/// </summary>
Create = 2,
/// <summary>
/// User can rename <see cref="Models.Instance"/>s they can view
/// </summary>
Rename = 4,
/// <summary>
/// User can relocate <see cref="Models.Instance"/>s they can view
/// </summary>
Relocate = 8,
/// <summary>
/// User can online <see cref="Models.Instance"/>s they can view
/// </summary>
SetOnline = 16,
/// <summary>
/// User can delete <see cref="Models.Instance"/>s they can view
/// </summary>
Delete = 32,
/// <summary>
/// User can view all <see cref="Models.Instance"/>s
/// </summary>
List = 64,
/// <summary>
/// User can change <see cref="Models.Instance.ConfigurationType"/>
/// </summary>
SetConfiguration = 128,
/// <summary>
/// User can change <see cref="Models.Instance.AutoUpdateInterval"/>
/// </summary>
@@ -12,14 +12,17 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// Allow read access to <see cref="Models.InstanceUser"/> for the <see cref="Models.Instance"/>
/// </summary>
ReadUsers = 1,
/// <summary>
/// Allow write and delete access to <see cref="Models.InstanceUser"/> for the <see cref="Models.Instance"/>
/// </summary>
WriteUsers = 2,
/// <summary>
/// Allow adding additional <see cref="Models.InstanceUser"/> to the <see cref="Models.Instance"/>
/// </summary>
@@ -12,54 +12,67 @@ namespace Tgstation.Server.Api.Rights
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may cancel synchronize operations
/// </summary>
CancelPendingChanges = 1,
/// <summary>
/// User may create the <see cref="Models.Repository"/> if it does not exist
/// </summary>
SetOrigin = 2,
/// <summary>
/// User may directly set the sha the <see cref="Models.Repository"/>'s HEAD points to
/// </summary>
SetSha = 4,
/// <summary>
/// User may fetch and merge GitHub pull requests
/// </summary>
MergePullRequest = 8,
/// <summary>
/// User may use the update feature
/// </summary>
UpdateBranch = 16,
/// <summary>
/// User may change <see cref="Models.Internal.RepositorySettings.CommitterName"/> and <see cref="Models.Internal.RepositorySettings.CommitterEmail"/>
/// </summary>
ChangeCommitter = 32,
/// <summary>
/// User may change <see cref="Models.Internal.RepositorySettings.PushTestMergeCommits"/>
/// </summary>
ChangeTestMergeCommits = 64,
/// <summary>
/// User may read and change <see cref="Models.Internal.RepositorySettings.AccessUser"/> and <see cref="Models.Internal.RepositorySettings.AccessToken"/>
/// </summary>
ChangeCredentials = 128,
/// <summary>
/// User may set <see cref="Models.Repository.Reference"/> to another git reference (not a SHA)
/// </summary>
SetReference = 256,
/// <summary>
/// User may read all fields in the <see cref="Models.Repository"/> with the exception of <see cref="Models.Internal.RepositorySettings.AccessToken"/>
/// </summary>
Read = 512,
/// <summary>
/// User may change <see cref="Models.Internal.RepositorySettings.AutoUpdatesKeepTestMerges"/> and <see cref="Models.Internal.RepositorySettings.AutoUpdatesSynchronize"/>
/// </summary>
ChangeAutoUpdateSettings = 1024,
/// <summary>
/// User may delete the <see cref="Models.Repository"/>
/// </summary>
Delete = 2048,
/// <summary>
/// User may cancel clone operations
/// </summary>
@@ -12,11 +12,10 @@ namespace Tgstation.Server.Api.Rights
/// <summary>
/// Map of <see cref="RightsType"/>s to their respective flag <see cref="Enum"/>s
/// </summary>
static readonly IReadOnlyDictionary<RightsType, Type> typeMap = new Dictionary<RightsType, Type>
static readonly IReadOnlyDictionary<RightsType, Type> TypeMap = new Dictionary<RightsType, Type>
{
{ RightsType.Administration, typeof(AdministrationRights) },
{ RightsType.InstanceManager, typeof(InstanceManagerRights) },
{ RightsType.Repository, typeof(RepositoryRights) },
{ RightsType.Byond, typeof(ByondRights) },
{ RightsType.DreamMaker, typeof(DreamMakerRights) },
@@ -31,7 +30,7 @@ namespace Tgstation.Server.Api.Rights
/// </summary>
/// <param name="rightsType">The <see cref="RightsType"/> to lookup</param>
/// <returns>The <see cref="Enum"/> <see cref="Type"/> of the given <paramref name="rightsType"/></returns>
public static Type RightToType(RightsType rightsType) => typeMap[rightsType];
public static Type RightToType(RightsType rightsType) => TypeMap[rightsType];
/// <summary>
/// Gets the role claim name used for a given <paramref name="right"/>
@@ -47,7 +46,8 @@ namespace Tgstation.Server.Api.Rights
foreach (Enum J in Enum.GetValues(right.GetType()))
if (Convert.ToInt32(J, CultureInfo.InvariantCulture) != 0 && right.HasFlag(J))
yield return String.Concat(typeof(TRight).Name, '.', J.ToString());
};
}
var names = GetRoleNames();
return String.Join(",", names);
}
@@ -60,7 +60,7 @@ namespace Tgstation.Server.Api.Rights
/// <returns>A <see cref="string"/> representing the claim role name</returns>
public static string RoleName(RightsType rightsType, Enum right)
{
var enumType = typeMap[rightsType];
var enumType = TypeMap[rightsType];
return String.Concat(enumType.Name, '.', Enum.GetName(enumType, right));
}
@@ -9,34 +9,42 @@
/// <see cref="AdministrationRights"/>
/// </summary>
Administration,
/// <summary>
/// <see cref="InstanceManagerRights"/>
/// </summary>
InstanceManager,
/// <summary>
/// <see cref="RepositoryRights"/>
/// </summary>
Repository,
/// <summary>
/// <see cref="ByondRights"/>
/// </summary>
Byond,
/// <summary>
/// <see cref="DreamMakerRights"/>
/// </summary>
DreamMaker,
/// <summary>
/// <see cref="DreamDaemonRights"/>
/// </summary>
DreamDaemon,
/// <summary>
/// <see cref="ChatBotRights"/>
/// </summary>
ChatBots,
/// <summary>
/// <see cref="ConfigurationRights"/>
/// </summary>
Configuration,
/// <summary>
/// <see cref="InstanceUserRights"/>
/// </summary>
@@ -18,19 +18,19 @@
<PackageTags>json web api tgstation-server tgstation ss13 byond</PackageTags>
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
<Version>4.0.0.0</Version>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>bin\Release\netstandard2.0\Tgstation.Server.Api.xml</DocumentationFile>
<NoWarn>1701;1702;1705;CA2227;CA1819;CA1028</NoWarn>
<NoWarn>1701;1702;CA1028</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;1705;CA2227;CA1819;CA1028</NoWarn>
<NoWarn>1701;1702;SA1652;CA1028</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -39,7 +39,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
</ItemGroup>
</Project>
@@ -18,18 +18,18 @@
<PackageTags>json web api tgstation-server tgstation ss13 byond client</PackageTags>
<PackageReleaseNotes>Added the ability to change the Token of IServerClient</PackageReleaseNotes>
<Copyright>2018</Copyright>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>bin\Release\netstandard2.0\Tgstation.Server.Client.xml</DocumentationFile>
<WarningLevel>0</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;SA1652</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -38,6 +38,10 @@
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
@@ -5,17 +5,18 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<DebugType>Full</DebugType>
<Version>4.0.1.4</Version>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>bin\Release\netcoreapp2.1\Tgstation.Server.Host.Console.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;SA1652</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -24,6 +25,10 @@
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
@@ -26,33 +26,31 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<LangVersion>latest</LangVersion>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet />
<NoWarn>SA1652</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Release\Tgstation.Server.Host.Service.xml</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup>
<StartupObject>Tgstation.Server.Host.Service.Program</StartupObject>
@@ -104,6 +102,10 @@
<PackageReference Include="Microsoft.Extensions.Logging.EventLog">
<Version>2.1.1</Version>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -5,17 +5,18 @@
<DebugType>Full</DebugType>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
<Version>4.0.1.4</Version>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>bin\Release\netstandard2.0\Tgstation.Server.Host.Watchdog.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;SA1652</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -24,6 +25,10 @@
<IncludeAssets>compile; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
@@ -4,19 +4,18 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
<DebugType>Full</DebugType>
<Version>4.0.1.4</Version>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile>bin\Release\netcoreapp2.1\Tgstation.Server.Host.xml</DocumentationFile>
<NoWarn>1701;1702;1705;CA2227</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;1705;CA2227</NoWarn>
<NoWarn>1701;1702;SA1652</NoWarn>
</PropertyGroup>
<ItemGroup>
@@ -47,6 +46,10 @@
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.3.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="4.5.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.3.0" />
@@ -7,6 +7,14 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
@@ -7,6 +7,14 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.0" />
@@ -7,6 +7,14 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.0" />
@@ -28,6 +28,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.1</LangVersion>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -37,6 +38,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>7.1</LangVersion>
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -7,6 +7,14 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.10.0" />
@@ -11,10 +11,12 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningsAsErrors />
<DocumentationFile></DocumentationFile>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
@@ -8,10 +8,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>7.1</LangVersion>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>7.1</LangVersion>
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
+1
View File
@@ -20,6 +20,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Host.Conso
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6FF654E6-3E2C-46D4-872D-D528F77D6973}"
ProjectSection(SolutionItems) = preProject
build\analyzers.ruleset = build\analyzers.ruleset
build\BuildDox.ps1 = build\BuildDox.ps1
build\Dockerfile = build\Dockerfile
build\install_byond.sh = build\install_byond.sh