Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Aug 2, 2024
1 parent 39453b6 commit 901ac66
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 51 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.10.0"/>
<PackageReference Include="Moq" Version="4.20.70"/>
<PackageReference Include="Pure.DI" Version="2.1.27">
<PackageReference Include="Pure.DI" Version="2.1.29">
<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 @@ -32,7 +32,7 @@
<PackageReference Include="NuGet.Build.Tasks" Version="6.4.0"/>
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="all"/>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="all"/>
<PackageReference Include="Pure.DI" Version="2.1.27">
<PackageReference Include="Pure.DI" Version="2.1.29">
<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 @@ -26,7 +26,7 @@
<PackageReference Include="NuGet.Build.Tasks" Version="6.4.0"/>
<PackageReference Include="Microsoft.Build.Framework" Version="16.8.0" IncludeAssets="all"/>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.8.0" IncludeAssets="all"/>
<PackageReference Include="Pure.DI" Version="2.1.27">
<PackageReference Include="Pure.DI" Version="2.1.29">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
58 changes: 10 additions & 48 deletions CSharpInteractive/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace CSharpInteractive;
using System.Buffers;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.Versioning;
using Core;
using HostApi;
using JetBrains.TeamCity.ServiceMessages.Read;
Expand Down Expand Up @@ -67,23 +66,11 @@ private void Setup()
.Bind("TeamCity").To<TeamCityInOut>()
.Bind("Ansi").To<AnsiInOut>()
.Bind().To<Console>()
.Bind().To(ctx =>
{
ctx.Inject<ICISpecific<IStdOut>>(out var stdOut);
return stdOut.Instance;
})
.Bind().To(ctx =>
{
ctx.Inject<ICISpecific<IStdErr>>(out var stdErr);
return stdErr.Instance;
})
.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().To(ctx =>
{
ctx.Inject<ICISpecific<ILog<TT>>>(out var log);
return log.Instance;
})
.Bind().To((ICISpecific<ILog<TT>> log) => log.Instance)
.Bind().To<CISettings>()
.Bind().To<ExitTracker>()
.Bind().Bind<ITraceSource>(Tag.Type).To<Environment>()
Expand Down Expand Up @@ -159,23 +146,10 @@ private void Setup()
.Bind().To(_ => typeof(Composition).Assembly)
.Bind().To(_ => new CSharpParseOptions().LanguageVersion)
.Bind("RuntimePath").To(_ => Path.GetDirectoryName(typeof(object).Assembly.Location) ?? string.Empty)
.Bind().To(ctx =>
{
ctx.Inject<CancellationTokenSource>(out var cancellationTokenSource);
return cancellationTokenSource.Token;
})
.Bind("TargetFrameworkMoniker").To(ctx =>
{
ctx.Inject<Assembly>(out var assembly);
return assembly.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName ?? string.Empty;
})
.Bind().To((CancellationTokenSource cancellationTokenSource) => cancellationTokenSource.Token)
.Bind("TargetFrameworkMoniker").To((Assembly assembly) => assembly.GetCustomAttribute<System.Runtime.Versioning.TargetFrameworkAttribute>()?.FrameworkName ?? string.Empty)
.Bind().To(_ => Process.GetCurrentProcess())
.Bind("ModuleFile").To(ctx =>
{
ctx.Inject<Process>(out var process);
return process.MainModule?.FileName ?? string.Empty;
})

.Bind("ModuleFile").To((Process process) => process.MainModule?.FileName ?? string.Empty)
.Bind().To<ScriptCommandFactory>()
.Bind().To<ReliableBuildContext>()
.Bind().To<ProcessMonitor>()
Expand Down Expand Up @@ -235,11 +209,7 @@ private void Setup()

// Public
.Bind().To<HostService>()
.Bind().To(ctx =>
{
ctx.Inject<ICISpecific<IProperties>>(out var properties);
return properties.Instance;
})
.Bind().To((ICISpecific<IProperties> properties) => properties.Instance)
.Bind().To<NuGetService>()
.Bind().To<CommandLineRunner>()
.Bind().To<BuildRunner>()
Expand All @@ -250,17 +220,9 @@ private void Setup()
.Bind().To<FlowIdGenerator>()
.Bind().As(Lifetime.Transient).To(_ => DateTime.Now)
.Bind().To<TimestampUpdater>()
.Bind().To(
ctx =>
{
ctx.Inject<ITeamCityServiceMessages>(out var teamCityServiceMessages);
return teamCityServiceMessages.CreateWriter(
str =>
{
ctx.Inject<IConsole>(out var console);
console.WriteToOut((default, str + "\n"));
});
})
.Bind().To((ITeamCityServiceMessages teamCityServiceMessages, IConsole console) =>
teamCityServiceMessages.CreateWriter(str =>
console.WriteToOut((default, str + "\n"))))
.Bind().To<ServiceMessageParser>();
}
}

0 comments on commit 901ac66

Please sign in to comment.