Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to dotnet 8 #199

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./src
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Build
run: dotnet publish ./src/Joba.IBM.RPA.Cli/Joba.IBM.RPA.Cli.csproj -c Release -f net7.0 -r win-x64 -p:PublishSingleFile=true -o ./publish --self-contained
run: dotnet publish ./src/Joba.IBM.RPA.Cli/Joba.IBM.RPA.Cli.csproj -c Release -f net8.0 -r win-x64 -p:PublishSingleFile=true -o ./publish --self-contained
- name: e2e tests
run: dotnet test ./src/Tests/Joba.IBM.RPA.Cli.Tests --filter "Category=e2e" --verbosity normal
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# list of changed files within `super-linter`
fetch-depth: 0
- name: Mega Linter
uses: oxsecurity/megalinter/flavors/dotnet@v7.10.0
uses: oxsecurity/megalinter/flavors/dotnet@v8.0.0
env:
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_EXCLUDE: LICENSE.md
Expand Down
4 changes: 2 additions & 2 deletions src/Joba.IBM.RPA.Cli/Joba.IBM.RPA.Cli.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Company>Joba</Company>
Expand Down
9 changes: 3 additions & 6 deletions src/Joba.IBM.RPA/Compiler/WalAnalyzer.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using System.Text.RegularExpressions;
using System.Xml.Linq;

namespace Joba.IBM.RPA
{
internal sealed partial class WalAnalyzer
{
private readonly WalParser parser = new WalParser();
private readonly WalParser parser = new();

internal WalAnalyzer(WalFile wal)
{
Lines = parser.Parse(wal.Content);
}
internal WalAnalyzer(WalFile wal) : this(wal.Content) { }
internal WalAnalyzer(WalContent content) => Lines = parser.Parse(content);

internal WalLines Lines { get; }

Expand Down Expand Up @@ -70,18 +67,18 @@
public DefineVariableLine(int number, string content, string? command)
: base(number, content, command)
{
var match = Regex.Match(content, @"--name\s+(?<name>\w+)", RegexOptions.IgnoreCase);

Check warning on line 70 in src/Joba.IBM.RPA/Compiler/WalAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
if (!match.Success)
throw new Exception($"Line {number} ({Verb}) does not have the '--name' parameter in the correct format.");
Name = match.Groups["name"]?.Value;

match = Regex.Match(content, @"--type\s+(?<type>\w+)", RegexOptions.IgnoreCase);
if (!match.Success)

Check warning on line 76 in src/Joba.IBM.RPA/Compiler/WalAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.
throw new Exception($"Line {number} ({Verb}) does not have the '--type' parameter in the correct format.");
Type = match.Groups["type"]?.Value;
}

internal string Name { get; }

Check warning on line 81 in src/Joba.IBM.RPA/Compiler/WalAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.
internal string Type { get; }
}

Expand Down
8 changes: 4 additions & 4 deletions src/Joba.IBM.RPA/Joba.IBM.RPA.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -15,12 +15,12 @@
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Cli.Tests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Joba.IBM.RPA.Cli.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Snippets\InjectDependencies.definitions.snippet" />
Expand Down
8 changes: 4 additions & 4 deletions src/Joba.IBM.RPA/Wal/WalFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

internal PublishScript PrepareToPublish(string message, TimeSpan timeout, bool resetIds = false, bool setAsProduction = false) =>
new(resetIds ? null : Id, resetIds ? null : VersionId, Name.WithoutExtension, message, Content.ToString(), ProductVersion?.ToString(), setAsProduction, Convert.ToInt32(timeout.TotalSeconds), Convert.ToInt32(timeout.TotalSeconds), Convert.ToInt32(timeout.TotalSeconds));

Check warning on line 106 in src/Joba.IBM.RPA/Wal/WalFile.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'ProductVersion' in 'PublishScript.PublishScript(Guid? Id, Guid? VersionId, string Name, string? Description, string Content, string ProductVersion, bool SetAsProduction, int GreenExecutionTimeSeconds, int YellowExecutionTimeSeconds, int RedExecutionTimeSeconds)'.

internal void Save()
{
Expand Down Expand Up @@ -164,7 +164,7 @@
private string GetDebuggerDisplay() => $"{Name} v{Version ?? new WalVersion(0)} => v{NextVersion}";

[ProtoContract]
protected class WalFileProto

Check warning on line 167 in src/Joba.IBM.RPA/Wal/WalFile.cs

View workflow job for this annotation

GitHub Actions / build

'WalFile.WalFileProto': new protected member declared in sealed type
{
[ProtoMember(1)]
public Guid? Id { get; set; }
Expand All @@ -183,7 +183,7 @@
}
}

public struct WalContent
public readonly struct WalContent
{
private readonly string content;

Expand All @@ -194,7 +194,7 @@
}

public static WalContent Build(IEnumerable<string> lines) =>
new WalContent(string.Join(System.Environment.NewLine, lines));
new (string.Join(System.Environment.NewLine, lines));

public override bool Equals([NotNullWhen(true)] object? obj)
{
Expand All @@ -209,7 +209,7 @@
public static bool operator !=(WalContent left, WalContent right) => !(left == right);
}

public struct WalVersion : IFormattable
public readonly struct WalVersion : IFormattable
{
private readonly int version;

Expand Down Expand Up @@ -238,7 +238,7 @@
public static bool operator <=(WalVersion left, WalVersion right) => left.version <= right.version;
}

public struct WalFileName
public readonly struct WalFileName
{
private readonly string name;

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
4 changes: 2 additions & 2 deletions src/Tests/Joba.IBM.RPA.Tests/Joba.IBM.RPA.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Loading