Skip to content

Commit f69e4d1

Browse files
authored
Feat: upgrade to net9 (#348)
* Feat: upgrade net9 * Feat: net9 for github workflow build * Feat: net9 for appveyor * Fix: file scoped namespace * Fix: implicit new * Chore: latestmajor langversion
1 parent 6937bb9 commit f69e4d1

File tree

81 files changed

+3229
-3441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3229
-3441
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup .NET
1717
uses: actions/setup-dotnet@v1
1818
with:
19-
dotnet-version: 8.0.x
19+
dotnet-version: 9.0.x
2020
- name: Install dependencies
2121
run: dotnet tool install --global coveralls.net
2222
- name: Restore dependencies

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ Below some examples :
377377
```JS
378378
Provide at least one ipnetwork
379379
Usage: ipnetwork [-inmcbflu] [-d cidr|-D] [-h|-s cidr|-S|-w|-W|-x|-C network|-o network] networks ...
380-
Version: 3.0.0.0
380+
Version: 3.1.0
381381

382382
Print options
383383
-i : network

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.0.{build}'
1+
version: '3.1.{build}'
22
image: Visual Studio 2022
33

44
assembly_info:
@@ -41,8 +41,8 @@ build_script:
4141
- cmd: dotnet build -c release ./src/ConsoleApplication
4242

4343
test_script:
44-
- cmd: dotnet test ./src/TestProject/TestProject.csproj --settings ./src/TestProject/coverlet.runsettings -f "net8.0"
45-
- vstest.console /logger:Appveyor c:\Projects\ipnetwork\src\TestProject\bin\Debug\net8.0\TestProject.dll
44+
- cmd: dotnet test ./src/TestProject/TestProject.csproj --settings ./src/TestProject/coverlet.runsettings -f "net9.0"
45+
- vstest.console /logger:Appveyor c:\Projects\ipnetwork\src\TestProject\bin\Debug\net9.0\TestProject.dll
4646
- ps: copy ./src/TestProject/TestResults/**/coverage.opencover.xml ./src/TestProject/TestResults
4747
- csmacnz.Coveralls.exe --opencover -i C:\projects\ipnetwork\src\TestProject\TestResults\coverage.opencover.xml --useRelativePaths
4848

src/ConsoleApplication/ActionEnum.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace System.Net.ConsoleApplication
5+
namespace System.Net;
6+
7+
public enum ActionEnum
68
{
7-
public enum ActionEnum
8-
{
9-
Usage,
10-
PrintNetworks,
11-
Subnet,
12-
Supernet,
13-
WideSupernet,
14-
ListIPAddress,
15-
ContainNetwork,
16-
OverlapNetwork,
17-
SubtractNetwork,
18-
}
19-
}
9+
Usage,
10+
PrintNetworks,
11+
Subnet,
12+
Supernet,
13+
WideSupernet,
14+
ListIPAddress,
15+
ContainNetwork,
16+
OverlapNetwork,
17+
SubtractNetwork,
18+
}

src/ConsoleApplication/ArgParsed.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace System.Net.ConsoleApplication
5+
namespace System.Net;
6+
7+
public class ArgParsed
68
{
7-
public class ArgParsed
8-
{
9-
public int Arg { get; set; }
9+
public int Arg { get; set; }
1010

11-
private event ArgParsedDelegate OnArgParsed;
11+
private event ArgParsedDelegate OnArgParsed;
1212

13-
public delegate void ArgParsedDelegate(ProgramContext ac, string arg);
13+
public delegate void ArgParsedDelegate(ProgramContext ac, string arg);
1414

15-
public void Run(ProgramContext ac, string arg)
16-
{
15+
public void Run(ProgramContext ac, string arg)
16+
{
1717
this.OnArgParsed?.Invoke(ac, arg);
1818
}
1919

20-
public ArgParsed(int arg, ArgParsedDelegate onArgParsed)
21-
{
20+
public ArgParsed(int arg, ArgParsedDelegate onArgParsed)
21+
{
2222
this.Arg = arg;
2323
this.OnArgParsed += onArgParsed;
2424
}
25-
}
26-
}
25+
}

src/ConsoleApplication/CidrParseTypeEnum.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace System.Net.ConsoleApplication
5+
namespace System.Net;
6+
7+
public enum CidrParseEnum
68
{
7-
public enum CidrParseEnum
8-
{
9-
Default,
10-
Value,
11-
}
12-
}
9+
Default,
10+
Value,
11+
}

src/ConsoleApplication/ConsoleApplication.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net462;net47;net48;net6.0;net8.0</TargetFrameworks>
6-
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net8.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net9.0</TargetFrameworks>
77
<ImplicitUsings>disable</ImplicitUsings>
88
<SignAssembly>True</SignAssembly>
99
<AssemblyOriginatorKeyFile>..\System.Net.IPNetwork.snk</AssemblyOriginatorKeyFile>
10+
<Version>3.1.0</Version>
11+
<RootNamespace>System.Net</RootNamespace>
12+
<LangVersion>latestmajor</LangVersion>
1013

1114
</PropertyGroup>
1215

0 commit comments

Comments
 (0)