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

update CommandLineUtils #319

Merged
merged 1 commit into from
Nov 19, 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 Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Tmds.DBus.Tool dependencies -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
<PackageVersion Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />

<!-- Test dependencies -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Tmds.DBus.Tool/CodeGenCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using Microsoft.CodeAnalysis;
using Tmds.DBus.Protocol;

Expand Down Expand Up @@ -234,7 +234,7 @@ class CodeGenArguments
public string OutputFileName { get; set; }
public IEnumerable<string> SkipInterfaces { get; set; }
public Dictionary<string, string> Interfaces { get; set; }
public List<string> Files { get; set; }
public IReadOnlyList<string> Files { get; set; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The List doesn't work with the McMaster.Extensions.CommandLineUtils's package?
How did you find out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler reports:
Cannot implicitly convert type 'System.Collections.Generic.IReadOnlyList<string?>' to 'System.Collections.Generic.List<string>'. An explicit conversion exists (are you missing a cast?)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this line

Files = _files.Values,

Got it.

public bool NoInternalsVisibleTo { get; set; }
public Accessibility TypesAccessModifier {get; set;}
public bool ProtocolApi { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Tmds.DBus.Tool/Command.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using Tmds.DBus.Protocol;

namespace Tmds.DBus.Tool
Expand Down
4 changes: 2 additions & 2 deletions src/Tmds.DBus.Tool/ListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using Tmds.DBus.Protocol;

namespace Tmds.DBus.Tool
Expand Down Expand Up @@ -146,7 +146,7 @@ public bool Visit(string path, XElement nodeXml)
}
}

private async Task ListInterfacesAsync(string address, string service, string path, bool recurse, List<string> files)
private async Task ListInterfacesAsync(string address, string service, string path, bool recurse, IReadOnlyList<string> files)
{
var visitor = new InterfacesVisitor();
if (service != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Tmds.DBus.Tool/MonitorCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;
using Tmds.DBus.Protocol;

namespace Tmds.DBus.Tool;
Expand Down
2 changes: 1 addition & 1 deletion src/Tmds.DBus.Tool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.CommandLineUtils;
using McMaster.Extensions.CommandLineUtils;

namespace Tmds.DBus.Tool
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tmds.DBus.Tool/Tmds.DBus.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" />
<ProjectReference Include="../Tmds.DBus.Protocol/Tmds.DBus.Protocol.csproj" />
</ItemGroup>
</Project>
Loading