Browse Source

Cleanup csproj files (#1865)

Marko Lahma 1 year ago
parent
commit
5ff5589e79

+ 3 - 0
Directory.Build.props

@@ -24,6 +24,9 @@
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <UseArtifactsOutput>true</UseArtifactsOutput>
 
+    <LangVersion>latest</LangVersion>
+    <ImplicitUsings>enable</ImplicitUsings>
+
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 0
Jint.Benchmark/Jint.Benchmark.csproj

@@ -17,6 +17,7 @@
     <LangVersion>latest</LangVersion>
     <IsPackable>false</IsPackable>
     <ImplicitUsings>enable</ImplicitUsings>
+    <NoWarn>$(NoWarn);CS8002</NoWarn>
   </PropertyGroup>
   <ItemGroup>
     <None Include=".\Scripts\*.*" CopyToOutputDirectory="PreserveNewest" />

+ 1 - 2
Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj

@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net8.0</TargetFrameworks>
-    <TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
+    <TargetFrameworks>net462;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <ImplicitUsings>enable</ImplicitUsings>
     <LangVersion>latest</LangVersion>

+ 1 - 6
Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj

@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net8.0</TargetFrameworks>
-    <TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
+    <TargetFrameworks>net462;net8.0</TargetFrameworks>
     <AssemblyOriginatorKeyFile>..\Jint\Jint.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
     <IsPackable>false</IsPackable>
@@ -17,10 +16,6 @@
     <ProjectReference Include="..\Jint\Jint.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-    <Reference Include="Microsoft.CSharp" Condition=" '$(TargetFramework)' == 'net462' " />
-  </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="Acornima.Extras" />
     <PackageReference Include="Flurl.Http.Signed" />

+ 0 - 1
Jint.Tests.Test262/Jint.Tests.Test262.csproj

@@ -2,7 +2,6 @@
 
   <PropertyGroup>
     <TargetFramework>net8.0</TargetFramework>
-    <!--<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>-->
     <AssemblyOriginatorKeyFile>..\Jint\Jint.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
     <IsPackable>false</IsPackable>

+ 0 - 4
Jint.Tests/Jint.Tests.csproj

@@ -19,10 +19,6 @@
     <ProjectReference Include="..\Jint\Jint.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-    <Reference Include="Microsoft.CSharp" Condition=" '$(TargetFramework)' == 'net462' " />
-  </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="Acornima.Extras" />
     <PackageReference Include="FluentAssertions" />

+ 1 - 3
Jint.Tests/Parser/JavascriptParserTests.cs

@@ -1,6 +1,4 @@
-using Jint.Runtime;
-
-namespace Jint.Tests.Parsing;
+namespace Jint.Tests.Parsing;
 
 public class JavascriptParserTests
 {

+ 2 - 0
Jint.Tests/Runtime/InteropTests.MemberAccess.cs

@@ -183,7 +183,9 @@ namespace Jint.Tests.Runtime
 
         private class BaseClassWithStatics
         {
+#pragma warning disable CS0414 // Field is assigned but its value is never used
             public static int a = 42;
+#pragma warning restore CS0414 // Field is assigned but its value is never used
         }
 
         private class InheritingFromClassWithStatics : BaseClassWithStatics

+ 0 - 1
Jint.Tests/Runtime/InteropTests.cs

@@ -3,7 +3,6 @@ using System.Globalization;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using Jint.Native;
-using Jint.Native.Symbol;
 using Jint.Runtime;
 using Jint.Runtime.Interop;
 using Jint.Tests.Runtime.Converters;

+ 2 - 0
Jint/AstExtensions.cs

@@ -13,7 +13,9 @@ namespace Jint
 {
     public static class AstExtensions
     {
+#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
         internal static readonly SourceLocation DefaultLocation;
+#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
 
         public static JsValue GetKey<T>(this T property, Engine engine) where T : IProperty => GetKey(property.Key, engine, property.Computed);
 

+ 0 - 2
Jint/Jint.csproj

@@ -7,8 +7,6 @@
     <SignAssembly>true</SignAssembly>
     <IsPackable>true</IsPackable>
 
-    <LangVersion>latest</LangVersion>
-    <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 

+ 2 - 0
Jint/Native/Generator/GeneratorInstance.cs

@@ -13,7 +13,9 @@ internal sealed class GeneratorInstance : ObjectInstance
 {
     internal GeneratorState _generatorState;
     private ExecutionContext _generatorContext;
+#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
     private readonly JsValue? _generatorBrand;
+#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
     private JintStatementList _generatorBody = null!;
 
     public JsValue? _nextValue;

+ 0 - 1
Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs

@@ -1,4 +1,3 @@
-using System.Numerics;
 using System.Text.RegularExpressions;
 using Jint.Native;
 

+ 0 - 1
Jint/Runtime/Interpreter/Expressions/JintUpdateExpression.cs

@@ -1,6 +1,5 @@
 using Jint.Native;
 using Jint.Runtime.Environments;
-using Environment = Jint.Runtime.Environments.Environment;
 
 namespace Jint.Runtime.Interpreter.Expressions
 {