Skip to content

Commit

Permalink
Updating internal Pure.DI to 2.1.44
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Dec 20, 2024
1 parent 9630e2d commit 751a48a
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CSharpInteractive.Tests/CSharpInteractive.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Pure.DI" Version="2.1.43">
<PackageReference Include="Pure.DI" Version="2.1.44">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/CSharpInteractive.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.12.0-3.final" />
<PackageReference Include="Pure.DI" Version="2.1.43">
<PackageReference Include="Pure.DI" Version="2.1.44">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/CSharpInteractive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.12.0-3.final" />
<PackageReference Include="Pure.DI" Version="2.1.43">
<PackageReference Include="Pure.DI" Version="2.1.44">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
31 changes: 16 additions & 15 deletions CSharpInteractive/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ private static void Setup()
.Bind().To(_ => DateTime.Now)
.Bind().To(_ => typeof(Composition).Assembly)
.Bind().To(_ => new CSharpParseOptions().LanguageVersion)
.Bind("RuntimePath").To(_ => Path.GetDirectoryName(typeof(object).Assembly.Location) ?? string.Empty)
.Bind(RuntimePath).To(_ => Path.GetDirectoryName(typeof(object).Assembly.Location) ?? string.Empty)
.Bind().To((CancellationTokenSource cancellationTokenSource) => cancellationTokenSource.Token)
.Bind("TargetFrameworkMoniker").To((Assembly assembly) => assembly.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkName ?? string.Empty)
.Bind(TargetFrameworkMoniker).To((Assembly assembly) => assembly.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkName ?? string.Empty)
.Bind().To(_ => Process.GetCurrentProcess())
.Bind("ModuleFile").To((Process process) => process.MainModule?.FileName ?? string.Empty)
.Bind(ModuleFile).To((Process process) => process.MainModule?.FileName ?? string.Empty)
.Bind().To<ScriptCommandFactory>()
.Bind().To<ReliableBuildContext>()
.Bind().To<ProcessMonitor>()
.Bind().To<ProcessManager>()
.Bind("base").To<BuildContext>()
.Bind(Base).To<BuildContext>()
.Bind().To(_ => MemoryPool<TT>.Shared)
.Bind().To<SourceResolver>()
.Bind().To<MetadataResolver>()
Expand Down Expand Up @@ -119,12 +119,12 @@ private static void Setup()
.Bind().To<FileExplorer>()
.Bind().To<Utf8Encoding>()
.Bind().To<BuildOutputProcessor>()
.Bind("default").To<DefaultBuildMessagesProcessor>()
.Bind("custom").To<CustomMessagesProcessor>()
.Bind(Base).To<DefaultBuildMessagesProcessor>()
.Bind(Custom).To<CustomMessagesProcessor>()
.Bind().To<TeamCityContext>()
.Bind().To<SummaryPresenter>()
.Bind().To<ExitCodeParser>()
.Bind("base").To<ProcessRunner>()
.Bind(Base).To<ProcessRunner>()
.Bind().To<ProcessResultHandler>()
.Bind().To<TextReplacer>()
.Bind().To<RuntimeExplorer>()
Expand All @@ -133,14 +133,14 @@ private static void Setup()
.Bind().To<Root>()
.Bind().To(_ => new CancellationTokenSource())
.Bind().To<CISpecific<TT>>()
.Bind("Default").To<ConsoleInOut>()
.Bind("TeamCity").To<TeamCityInOut>()
.Bind("Ansi").To<AnsiInOut>()
.Bind(Base).To<ConsoleInOut>()
.Bind(TeamCity).To<TeamCityInOut>()
.Bind(Ansi).To<AnsiInOut>()
.Bind().To<Console>()
.Bind().To((ICISpecific<IStdOut> stdOut) => stdOut.Instance)
.Bind().To((ICISpecific<IStdErr> stdErr) => stdErr.Instance)
.Bind("Default", "Ansi").To<Log<TT>>()
.Bind("TeamCity").To<TeamCityLog<TT>>()
.Bind(Base, Ansi).To<Log<TT>>()
.Bind(TeamCity).To<TeamCityLog<TT>>()
.Bind().To((ICISpecific<ILog<TT>> log) => log.Instance)
.Bind().To<CISettings>()
.Bind().To<ExitTracker>()
Expand Down Expand Up @@ -202,8 +202,8 @@ private static void Setup()
.Bind(Unique).To<SettingCommandRunner<VerbosityLevel>>()
.Bind(Unique).To<AddNuGetReferenceCommandFactory>()
.Bind(Unique).To<AddNuGetReferenceCommandRunner>()
.Bind("Default", "Ansi").To<Properties>()
.Bind("TeamCity").To<TeamCityProperties>()
.Bind(Base, Ansi).To<Properties>()
.Bind(TeamCity).To<TeamCityProperties>()
.Bind().To((ICISpecific<IProperties> properties) => properties.Instance)

// Public services
Expand All @@ -215,7 +215,8 @@ private static void Setup()
.Bind().To<ServiceMessageFormatter>()
.Bind().To<FlowIdGenerator>()
.Bind().To<TimestampUpdater>()
.Bind().To((ITeamCityServiceMessages teamCityServiceMessages, IConsole console) => teamCityServiceMessages.CreateWriter(str => console.WriteToOut((default, str + "\n"))))
.Bind().To((ITeamCityServiceMessages teamCityServiceMessages, IConsole console)
=> teamCityServiceMessages.CreateWriter(str => console.WriteToOut((null, str + "\n"))))
.Bind().To<ServiceMessageParser>();
}
}
4 changes: 2 additions & 2 deletions CSharpInteractive/Core/BuildMessageLogWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace CSharpInteractive.Core;

internal class BuildMessageLogWriter(
ILog<BuildMessageLogWriter> log,
[Tag("Default")] IStdOut stdOut,
[Tag("Default")] IStdErr stdErr)
[Tag(Tag.Base)] IStdOut stdOut,
[Tag(Tag.Base)] IStdErr stdErr)
: IBuildMessageLogWriter
{
public void Write(ProcessInfo processInfo, BuildMessage message)
Expand Down
4 changes: 2 additions & 2 deletions CSharpInteractive/Core/BuildRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ internal class BuildRunner(
Func<IBuildContext> buildContextFactory,
IBuildOutputProcessor buildOutputProcessor,
Func<IProcessMonitor> monitorFactory,
[Tag("default")] IBuildMessagesProcessor defaultBuildMessagesProcessor,
[Tag("custom")] IBuildMessagesProcessor customBuildMessagesProcessor,
[Tag(Tag.Base)] IBuildMessagesProcessor defaultBuildMessagesProcessor,
[Tag(Tag.Custom)] IBuildMessagesProcessor customBuildMessagesProcessor,
IProcessResultHandler processResultHandler,
IStartInfoDescription startInfoDescription,
ICommandLineStatisticsRegistry statisticsRegistry)
Expand Down
6 changes: 3 additions & 3 deletions CSharpInteractive/Core/CISpecific.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace CSharpInteractive.Core;

internal class CISpecific<T>(
ICISettings settings,
[Tag("Default")] Func<T> defaultFactory,
[Tag("TeamCity")] Func<T> teamcityFactory,
[Tag("Ansi")] Func<T> ansiFactory)
[Tag(Tag.Base)] Func<T> defaultFactory,
[Tag(Tag.TeamCity)] Func<T> teamcityFactory,
[Tag(Tag.Ansi)] Func<T> ansiFactory)
: ICISpecific<T>
{
public T Instance => settings.CIType switch
Expand Down
4 changes: 2 additions & 2 deletions CSharpInteractive/Core/DotnetEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace CSharpInteractive.Core;
using Pure.DI;

internal class DotNetEnvironment(
[Tag("TargetFrameworkMoniker")] string targetFrameworkMoniker,
[Tag("ModuleFile")] string moduleFile,
[Tag(Tag.TargetFrameworkMoniker)] string targetFrameworkMoniker,
[Tag(Tag.ModuleFile)] string moduleFile,
IEnvironment environment,
IFileExplorer fileExplorer)
: IDotNetEnvironment, ITraceSource
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/Core/ProcessInFlowRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CSharpInteractive.Core;
using Pure.DI;

internal class ProcessInFlowRunner(
[Tag("base")] IProcessRunner baseProcessRunner,
[Tag(Tag.Base)] IProcessRunner baseProcessRunner,
ICISettings ciSettings,
ITeamCityWriter teamCityWriter,
IFlowContext flowContext)
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/Core/ReliableBuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class ReliableBuildContext(
ICISettings ciSettings,
IFileSystem fileSystem,
IMessagesReader messagesReader,
[Tag("base")] IBuildContext baseBuildContext)
[Tag(Tag.Base)] IBuildContext baseBuildContext)
: IBuildContext
{
private readonly Dictionary<string, Output> _sources = new();
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/Core/RuntimeExplorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace CSharpInteractive.Core;
using Pure.DI;

internal class RuntimeExplorer(
[Tag("RuntimePath")] string runtimePath,
[Tag(Tag.RuntimePath)] string runtimePath,
IFileSystem fileSystem) : IRuntimeExplorer
{
public bool TryFindRuntimeAssembly(string assemblyPath, [MaybeNullWhen(false)] out string runtimeAssemblyPath)
Expand Down
2 changes: 1 addition & 1 deletion CSharpInteractive/Core/TeamCityProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace CSharpInteractive.Core;
using Pure.DI;

internal class TeamCityProperties(
[Tag("Default")] IProperties properties,
[Tag(Tag.Base)] IProperties properties,
// ReSharper disable once SuggestBaseTypeForParameterInConstructor
ITeamCityWriter teamCityWriter) : IProperties
{
Expand Down

0 comments on commit 751a48a

Please sign in to comment.