Skip to content

Commit 3284509

Browse files
Fix warning NU1903 in consumer projects' dependencies
1 parent e762749 commit 3284509

File tree

14 files changed

+88
-150
lines changed

14 files changed

+88
-150
lines changed

CSharpInteractive.HostApi/CSharpInteractive.HostApi.csproj

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<RootNamespace>HostApi</RootNamespace>
99
<ImmutypeAPI>True</ImmutypeAPI>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11+
<Title>Build automation library abstractions for .NET</Title>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
@@ -16,30 +17,13 @@
1617
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1718
</PackageReference>
1819
<PackageReference Include="TeamCity.ServiceMessages" Version="4.1.1"/>
20+
<PackageReference Include="NuGet.Versioning" Version="6.14.0"/>
1921
<InternalsVisibleTo Include="DynamicProxyGenAssembly2"/>
2022
<InternalsVisibleTo Include="dotnet-csi"/>
2123
<InternalsVisibleTo Include="CSharpInteractive"/>
2224
<InternalsVisibleTo Include="CSharpInteractive.Tests"/>
2325
</ItemGroup>
2426

25-
<Choose>
26-
<When Condition="'$(TargetFramework)'=='net8.0'">
27-
<ItemGroup>
28-
<PackageReference Include="NuGet.Versioning" Version="6.11.1"/>
29-
</ItemGroup>
30-
</When>
31-
<When Condition="'$(TargetFramework)'=='net9.0'">
32-
<ItemGroup>
33-
<PackageReference Include="NuGet.Versioning" Version="6.12.1"/>
34-
</ItemGroup>
35-
</When>
36-
<Otherwise>
37-
<ItemGroup>
38-
<PackageReference Include="NuGet.Versioning" Version="6.12.1"/>
39-
</ItemGroup>
40-
</Otherwise>
41-
</Choose>
42-
4327
<ItemGroup>
4428
<None Update="CommandLines.tt">
4529
<LastGenOutput>CommandLines.cs</LastGenOutput>

CSharpInteractive.HostApi/CommandLines.cs

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5441,71 +5441,3 @@ public partial record DockerRun: ICommandLine
54415441
public static DockerRun operator -(DockerRun command, IEnumerable<(string name, string value)> vars) => command.RemoveVars(vars);
54425442
}
54435443

5444-
[ExcludeFromCodeCoverage]
5445-
public partial record UnityPlayer: ICommandLine
5446-
{
5447-
/// <summary>
5448-
/// Appends an argument.
5449-
/// </summary>
5450-
/// <param name="command">The command to which an argument will be added.</param>
5451-
/// <param name="arg">Argument to add.</param>
5452-
/// <returns>Returns a new command with the corresponding changes.</returns>
5453-
public static UnityPlayer operator +(UnityPlayer command, string arg) => command.AddArgs(arg);
5454-
5455-
/// <summary>
5456-
/// Removes an argument by its name.
5457-
/// </summary>
5458-
/// <param name="command">The command to which an argument will be removed.</param>
5459-
/// <param name="arg">Argument to remove.</param>
5460-
/// <returns>Returns a new command with the corresponding changes.</returns>
5461-
public static UnityPlayer operator -(UnityPlayer command, string arg) => command.RemoveArgs(arg);
5462-
5463-
/// <summary>
5464-
/// Appends arguments.
5465-
/// </summary>
5466-
/// <param name="command">The command to which arguments will be added.</param>
5467-
/// <param name="args">Arguments to add.</param>
5468-
/// <returns>Returns a new command with the corresponding changes.</returns>
5469-
public static UnityPlayer operator +(UnityPlayer command, IEnumerable<string> args) => command.AddArgs(args);
5470-
5471-
/// <summary>
5472-
/// Removes arguments by their name.
5473-
/// </summary>
5474-
/// <param name="command">The command to which arguments will be removed.</param>
5475-
/// <param name="args">Arguments to remove.</param>
5476-
/// <returns>Returns a new command with the corresponding changes.</returns>
5477-
public static UnityPlayer operator -(UnityPlayer command, IEnumerable<string> args) => command.RemoveArgs(args);
5478-
5479-
/// <summary>
5480-
/// Appends an environment variable.
5481-
/// </summary>
5482-
/// <param name="command">The command to which an environment variable will be added.</param>
5483-
/// <param name="var">Environment variable to add.</param>
5484-
/// <returns>Returns a new command with the corresponding changes.</returns>
5485-
public static UnityPlayer operator +(UnityPlayer command, (string name, string value) var) => command.AddVars(var);
5486-
5487-
/// <summary>
5488-
/// Removes environment variable by its name and value.
5489-
/// </summary>
5490-
/// <param name="command">The command to which an environment variable will be removed.</param>
5491-
/// <param name="var">Environment variable to remove.</param>
5492-
/// <returns>Returns a new command with the corresponding changes.</returns>
5493-
public static UnityPlayer operator -(UnityPlayer command, (string name, string value) var) => command.RemoveVars(var);
5494-
5495-
/// <summary>
5496-
/// Appends environment variables.
5497-
/// </summary>
5498-
/// <param name="command">The command to which environment variables will be added.</param>
5499-
/// <param name="vars">Environment variables to add.</param>
5500-
/// <returns>Returns a new command with the corresponding changes.</returns>
5501-
public static UnityPlayer operator +(UnityPlayer command, IEnumerable<(string name, string value)> vars) => command.AddVars(vars);
5502-
5503-
/// <summary>
5504-
/// Removes environment variables by their name and value.
5505-
/// </summary>
5506-
/// <param name="command">The command to which environment variables will be removed.</param>
5507-
/// <param name="vars">environment variables to remove.</param>
5508-
/// <returns>Returns a new command with the corresponding changes.</returns>
5509-
public static UnityPlayer operator -(UnityPlayer command, IEnumerable<(string name, string value)> vars) => command.RemoveVars(vars);
5510-
}
5511-

CSharpInteractive.HostApi/CommandLines.tt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ namespace HostApi;
8787

8888
// Docker
8989
"DockerCustom",
90-
"DockerRun",
91-
92-
// Unity
93-
"UnityPlayer"
90+
"DockerRun"
9491
};
9592
#>
9693
<#

CSharpInteractive.HostApi/Text.cs

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,24 @@
1111
[Target]
1212
public readonly record struct Text(string Value = "", Color Color = Color.Default)
1313
{
14-
// ReSharper disable once UnusedMember.Global
14+
/// <summary>
15+
/// Represents an empty text.
16+
/// </summary>
1517
public static readonly Text Empty = new(string.Empty);
18+
19+
/// <summary>
20+
/// Represents a new line.
21+
/// </summary>
1622
public static readonly Text NewLine = new(Environment.NewLine);
23+
24+
/// <summary>
25+
/// Represents a space.
26+
/// </summary>
1727
public static readonly Text Space = new(" ");
28+
29+
/// <summary>
30+
/// Represents a tab.
31+
/// </summary>
1832
public static readonly Text Tab = new(" ");
1933

2034
/// <summary>
@@ -26,10 +40,21 @@ public Text(string value)
2640
: this(value, Color.Default)
2741
{ }
2842

43+
/// <summary>
44+
/// Implicitly converts a single <see cref="Text"/> instance to an array containing that instance.
45+
/// </summary>
46+
/// <param name="text">The text to convert.</param>
47+
/// <returns>An array containing the single text instance.</returns>
2948
public static implicit operator Text[](Text text) => [text];
3049

50+
/// <summary>
51+
/// Implicitly converts a string to a <see cref="Text"/> instance with default color.
52+
/// </summary>
53+
/// <param name="text">The string to convert.</param>
54+
/// <returns>A Text instance with the specified string value and default color.</returns>
3155
public static implicit operator Text (string text) => new(text);
3256

57+
/// <inheritdoc/>
3358
public override string ToString()
3459
{
3560
var sb = new StringBuilder();
@@ -45,6 +70,12 @@ public override string ToString()
4570
return sb.ToString();
4671
}
4772

73+
/// <summary>
74+
/// Combines two <see cref="Text"/> instances into an array.
75+
/// </summary>
76+
/// <param name="text1">The first text instance.</param>
77+
/// <param name="text2">The second text instance.</param>
78+
/// <returns>An array containing both text instances.</returns>
4879
public static Text[] operator +(Text text1, Text text2)
4980
{
5081
var newText = new Text[2];
@@ -53,6 +84,12 @@ public override string ToString()
5384
return newText;
5485
}
5586

87+
/// <summary>
88+
/// Appends a <see cref="Text"/> instance to an array of text instances.
89+
/// </summary>
90+
/// <param name="text">The array of text instances.</param>
91+
/// <param name="text2">The text instance to append.</param>
92+
/// <returns>A new array containing all original text instances with the new text appended at the end.</returns>
5693
public static Text[] operator +(Text[] text, Text text2)
5794
{
5895
var newText = new Text[text.Length + 1];
@@ -61,6 +98,12 @@ public override string ToString()
6198
return newText;
6299
}
63100

101+
/// <summary>
102+
/// Prepends a <see cref="Text"/> instance to an array of text instances.
103+
/// </summary>
104+
/// <param name="text1">The text instance to prepend.</param>
105+
/// <param name="text">The array of text instances.</param>
106+
/// <returns>A new array containing the prepended text followed by all original text instances.</returns>
64107
public static Text[] operator +(Text text1, Text[] text)
65108
{
66109
var newText = new Text[text.Length + 1];
@@ -69,7 +112,9 @@ public override string ToString()
69112
return newText;
70113
}
71114

115+
/// <inheritdoc/>
72116
public bool Equals(Text other) => Value == other.Value && Color == other.Color;
73117

118+
/// <inheritdoc/>
74119
public override int GetHashCode() => Value.GetHashCode() ^ 33 + (int)Color;
75120
}

CSharpInteractive.HostApi/UnityPlayer.cs

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

CSharpInteractive.Templates/CSharpInteractive.Templates.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<EnableDefaultItems>False</EnableDefaultItems>
1212
<NoPackageAnalysis>true</NoPackageAnalysis>
1313
<PackageId>CSharpInteractive.Templates</PackageId>
14-
<Title>C# script Templates</Title>
14+
<Title>Build automation project templates for .NET</Title>
1515
<Description>$(Company) $(Title) $(Version) $(TargetFramework)</Description>
1616
<PackageType>Template</PackageType>
1717
<PackageReadmeFile>content/ConsoleApplication-CSharp/README.md</PackageReadmeFile>

CSharpInteractive.Tests/README_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ new DotNetNew()
489489
.WithTemplateName("sln")
490490
.WithName("MySolution")
491491
.WithForce(true)
492+
.AddArgs("--format", "sln")
492493
.Run().EnsureSuccess();
493494

494495
new DotNetSlnAdd()

CSharpInteractive.Tests/UsageScenarios/Comments/DotNetSlnAddScenario.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ new DotNetNew()
44
.WithTemplateName("sln")
55
.WithName("MySolution")
66
.WithForce(true)
7+
.AddArgs("--format", "sln")
78
.Run().EnsureSuccess();
89

910
new DotNetSlnAdd()

CSharpInteractive.Tests/UsageScenarios/DotNetSlnAddScenario.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ public void Run()
3838
.AddArgs("--format", "sln")
3939
.Run().EnsureSuccess();
4040

41-
new CommandLine("dir").Run();
42-
4341
new DotNetSlnAdd()
4442
.WithSolution("MySolution.sln")
4543
.AddProjects(

CSharpInteractive/CSharpInteractive.Tool.csproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ToolCommandName>dotnet-csi</ToolCommandName>
2020
<IncludeAssets>All</IncludeAssets>
2121
<PackageId>dotnet-csi</PackageId>
22-
<Title>C# {0} script runner</Title>
22+
<Title>C# script runner and REPL tool for build automation</Title>
2323
<PackageIcon>_common\icon.png</PackageIcon>
2424
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2525
<Description>$(Title) $(Version) $(TargetFramework)</Description>
@@ -30,7 +30,7 @@
3030

3131
<ItemGroup>
3232
<!--<CompilerVisibleProperty Include="PureDIProfilePath" />-->
33-
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="5.0.0-2.final" />
33+
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="5.0.0" />
3434
<PackageReference Include="Pure.DI" Version="2.2.14">
3535
<PrivateAssets>all</PrivateAssets>
3636
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -51,16 +51,18 @@
5151
<ItemGroup>
5252
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
5353
<PackageReference Include="NuGet.Build.Tasks" Version="6.11.1"/>
54-
<PackageReference Include="Microsoft.Build.Framework" Version="17.11.4" IncludeAssets="all"/>
55-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.11.4" IncludeAssets="all"/>
54+
<PackageReference Include="Microsoft.Build.Framework" Version="17.11.48" IncludeAssets="all"/>
55+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.11.48" IncludeAssets="all"/>
56+
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.11.48" IncludeAssets="all"/>
5657
</ItemGroup>
5758
</When>
5859
<When Condition="'$(TargetFramework)'=='net9.0'">
5960
<ItemGroup>
6061
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.11" />
61-
<PackageReference Include="NuGet.Build.Tasks" Version="6.12.1"/>
62-
<PackageReference Include="Microsoft.Build.Framework" Version="17.12.6" IncludeAssets="all"/>
63-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.12.6" IncludeAssets="all"/>
62+
<PackageReference Include="NuGet.Build.Tasks" Version="6.12.4"/>
63+
<PackageReference Include="Microsoft.Build.Framework" Version="17.12.50" IncludeAssets="all"/>
64+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.12.50" IncludeAssets="all"/>
65+
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.12.50" IncludeAssets="all"/>
6466
</ItemGroup>
6567
</When>
6668
<Otherwise>
@@ -69,6 +71,7 @@
6971
<PackageReference Include="NuGet.Build.Tasks" Version="6.14.0"/>
7072
<PackageReference Include="Microsoft.Build.Framework" Version="18.0.2" IncludeAssets="all"/>
7173
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="18.0.2" IncludeAssets="all"/>
74+
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.0.2" IncludeAssets="all"/>
7275
</ItemGroup>
7376
</Otherwise>
7477
</Choose>

0 commit comments

Comments
 (0)