Skip to content

Commit

Permalink
Update NET 6.0 (#695)
Browse files Browse the repository at this point in the history
* Update

* Fix version

* Fix template

* Update CompilationContext.cs

* Downgrade Microsoft.CodeAnalysis.CSharp to 3.9.0

Co-authored-by: Erik Zhang <[email protected]>
  • Loading branch information
shargon and erikzhang committed Nov 14, 2021
1 parent 697c4a2 commit 274f21f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
DOTNET_VERSION: 5.0.100
DOTNET_VERSION: 6.0.x

jobs:

Expand All @@ -21,8 +21,7 @@ jobs:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check format
run: |
dotnet tool install --version 5.0.142902 --tool-path ./ dotnet-format --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
./dotnet-format . --check -v diagnostic
dotnet format --verify-no-changes --verbosity diagnostic
- name: Add package coverlet.msbuild
run: find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
- name: Test Neo.Compiler.CSharp.UnitTests
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

<PropertyGroup>
<Copyright>2015-2021 The Neo Project</Copyright>
<VersionPrefix>3.0.3</VersionPrefix>
<TargetFramework>net5.0</TargetFramework>
<VersionPrefix>3.1.0</VersionPrefix>
<TargetFramework>net6.0</TargetFramework>
<Authors>The Neo Project</Authors>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions src/Neo.Compiler.CSharp/CompilationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Reflection;
using System.Text;
using System.Xml.Linq;
using Diagnostic = Microsoft.CodeAnalysis.Diagnostic;

namespace Neo.Compiler
{
Expand Down
2 changes: 1 addition & 1 deletion src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" />
<PackageReference Include="Neo" Version="3.0.3" />
<PackageReference Include="Neo" Version="3.1.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions src/Neo.SmartContract.Framework/OpCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,14 @@ public enum OpCode : byte

#region Compound-type

/// <summary>
/// A value n is taken from top of main stack. The next n*2 items on main stack are removed, put inside n-sized map and this map is put on top of the main stack.
/// </summary>
PACKMAP = 0xBE,
/// <summary>
/// A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized struct and this struct is put on top of the main stack.
/// </summary>
PACKSTRUCT = 0xBF,
/// <summary>
/// A value n is taken from top of main stack. The next n items on main stack are removed, put inside n-sized array and this array is put on top of the main stack.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Neo.SmartContract.Framework" Version="3.0.3" />
<PackageReference Include="Neo.SmartContract.Framework" Version="3.1.0" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Neo.Compiler.CSharp.UnitTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.1.0">
Expand Down
4 changes: 2 additions & 2 deletions tests/Neo.Compiler.CSharp.UnitTests/Utils/TestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ static TestEngine()
references.Add(cr.ToMetadataReference());
}

public TestEngine(TriggerType trigger = TriggerType.Application, IVerifiable verificable = null, DataCache snapshot = null, Block persistingBlock = null)
: base(trigger, verificable, snapshot, persistingBlock, ProtocolSettings.Default, TestGas)
public TestEngine(TriggerType trigger = TriggerType.Application, IVerifiable verificable = null, DataCache snapshot = null, Block persistingBlock = null, SmartContract.Diagnostic diagnostic = null)
: base(trigger, verificable, snapshot, persistingBlock, ProtocolSettings.Default, TestGas, diagnostic)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Neo.SmartContract.Framework.UnitTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
</ItemGroup>

Expand Down

0 comments on commit 274f21f

Please sign in to comment.