Project file maintenance, C# 7.2 (#108)

1. Updates all the NuGet packages (except CommandLineParser because they ruined their API)
2. Makes all projects use C# 7.2 explicitly. (not latest)
3. Use some C# 7.2 features like readonly structs and default literals.
This commit is contained in:
Pieter-Jan Briers
2018-09-13 20:09:53 +02:00
committed by GitHub
parent 1dabe49234
commit 7a91fb7512
9 changed files with 27 additions and 58 deletions

View File

@@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ContentAssemblyTarget>..\engine\bin\Client\Resources\Assemblies\</ContentAssemblyTarget> <ContentAssemblyTarget>..\engine\bin\Client\Resources\Assemblies\</ContentAssemblyTarget>
<LangVersion>7.2</LangVersion>
<!-- <!--
This copies all dependencies, This copies all dependencies,
but on the plus side it's automatically located in the right place. but on the plus side it's automatically located in the right place.
@@ -51,6 +52,10 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="YamlDotNet" Version="5.0.1" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -60,12 +65,6 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="YamlDotNet, Version=4.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\YamlDotNet.4.3.1\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple">
<HintPath>$(SolutionDir)packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="EntryPoint.cs" /> <Compile Include="EntryPoint.cs" />
@@ -113,7 +112,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<Compile Include="GameObjects\Components\Power\SmesVisualizer2D.cs" /> <Compile Include="GameObjects\Components\Power\SmesVisualizer2D.cs" />
<Compile Include="GameObjects\Components\Power\ApcVisualizer2D.cs" /> <Compile Include="GameObjects\Components\Power\ApcVisualizer2D.cs" />
<Compile Include="Construction\ConstructionMenu.cs" /> <Compile Include="Construction\ConstructionMenu.cs" />
@@ -123,4 +121,4 @@
<Compile Include="Construction\ConstructionPlacementHijack.cs" /> <Compile Include="Construction\ConstructionPlacementHijack.cs" />
<Compile Include="GameObjects\Components\IconSmoothing\IconSmoothComponent.cs" /> <Compile Include="GameObjects\Components\IconSmoothing\IconSmoothComponent.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.4.0" targetFramework="net451" />
<package id="YamlDotNet" version="4.3.1" targetFramework="net451" />
</packages>

View File

@@ -14,6 +14,7 @@
<ContentAssemblyTarget>..\engine\bin\Server\Resources\Assemblies\</ContentAssemblyTarget> <ContentAssemblyTarget>..\engine\bin\Server\Resources\Assemblies\</ContentAssemblyTarget>
<OutputPath>..\bin\Content.Server\</OutputPath> <OutputPath>..\bin\Content.Server\</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<LangVersion>7.2</LangVersion>
<CodeAnalysisRuleSet Condition="'$(ActualOS)' == 'Windows'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet Condition="'$(ActualOS)' == 'Windows'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
@@ -47,6 +48,10 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="YamlDotNet" Version="5.0.1" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -56,12 +61,6 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="YamlDotNet, Version=4.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\YamlDotNet.4.3.1\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple">
<HintPath>$(SolutionDir)packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AI\AimShootLifeProcessor.cs" /> <Compile Include="AI\AimShootLifeProcessor.cs" />
@@ -155,7 +154,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<Compile Include="GameObjects\Components\Power\SmesComponent.cs" /> <Compile Include="GameObjects\Components\Power\SmesComponent.cs" />
<Compile Include="GameObjects\Components\Power\ApcComponent.cs" /> <Compile Include="GameObjects\Components\Power\ApcComponent.cs" />
<Compile Include="Materials\Material.cs" /> <Compile Include="Materials\Material.cs" />
@@ -165,4 +163,4 @@
<Compile Include="GameObjects\Components\Construction\ConstructionComponent.cs" /> <Compile Include="GameObjects\Components\Construction\ConstructionComponent.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
</Project> </Project>

View File

@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.EntitySystems
private static bool TryGetAttachedComponent<T>(IPlayerSession session, out T component) private static bool TryGetAttachedComponent<T>(IPlayerSession session, out T component)
where T : Component where T : Component
{ {
component = default(T); component = default;
var ent = session.AttachedEntity; var ent = session.AttachedEntity;

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.4.0" targetFramework="net451" />
<package id="YamlDotNet" version="4.3.1" targetFramework="net451" />
</packages>

View File

@@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<OutputPath>bin\x86\Debug\</OutputPath> <OutputPath>bin\x86\Debug\</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<LangVersion>7.2</LangVersion>
<CodeAnalysisRuleSet Condition="'$(ActualOS)' == 'Windows'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet Condition="'$(ActualOS)' == 'Windows'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
@@ -46,6 +47,10 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="YamlDotNet" Version="5.0.1" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -55,12 +60,6 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="YamlDotNet, Version=4.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)packages\YamlDotNet.4.3.1\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple">
<HintPath>$(SolutionDir)packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="EntryPoint.cs" /> <Compile Include="EntryPoint.cs" />
@@ -103,7 +102,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<Compile Include="Input\ContentKeyFunctions.cs" /> <Compile Include="Input\ContentKeyFunctions.cs" />
<Compile Include="Utility\ContentHelpers.cs" /> <Compile Include="Utility\ContentHelpers.cs" />
<Compile Include="GameObjects\Components\Power\SharedSmesComponent.cs" /> <Compile Include="GameObjects\Components\Power\SharedSmesComponent.cs" />
@@ -112,4 +110,4 @@
<Compile Include="Construction\ConstructionPrototype.cs" /> <Compile Include="Construction\ConstructionPrototype.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.4.0" targetFramework="net451" />
<package id="YamlDotNet" version="4.3.1" targetFramework="net451" />
</packages>

View File

@@ -16,6 +16,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TestProjectType>UnitTest</TestProjectType> <TestProjectType>UnitTest</TestProjectType>
<OutputPath>..\bin\Content.Tests\</OutputPath> <OutputPath>..\bin\Content.Tests\</OutputPath>
<LangVersion>7.2</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -61,22 +62,18 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <PackageReference Include="NUnit" Version="3.10.1" />
<HintPath>$(SolutionDir)packages\NUnit.3.10.1\lib\net45\nunit.framework.dll</HintPath> <PackageReference Include="NUnit.ConsoleRunner" Version="3.9.0" />
</Reference> <PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<Reference Include="System.ValueTuple"> <PackageReference Include="System.ValueTuple" Version="4.5.0" />
<HintPath>$(SolutionDir)packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath> </ItemGroup>
</Reference> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Shared\Utility\ContentHelpers_Test.cs" /> <Compile Include="Shared\Utility\ContentHelpers_Test.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Content.Client\Content.Client.csproj"> <ProjectReference Include="..\Content.Client\Content.Client.csproj">
<Project>{a2e5f175-78af-4ddd-8f97-e2d2552372ed}</Project> <Project>{a2e5f175-78af-4ddd-8f97-e2d2552372ed}</Project>
@@ -127,4 +124,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.10.1" targetFramework="net45" />
<package id="NUnit.ConsoleRunner" version="3.8.0" targetFramework="net451" />
<package id="NUnit3TestAdapter" version="3.10.0" targetFramework="net451" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net451" />
</packages>