Skip to content

Commit

Permalink
Updating internal Pure.DI to 2.1.43
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Dec 19, 2024
1 parent ddffe0e commit 9630e2d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 47 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.42">
<PackageReference Include="Pure.DI" Version="2.1.43">
<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.42">
<PackageReference Include="Pure.DI" Version="2.1.43">
<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.42">
<PackageReference Include="Pure.DI" Version="2.1.43">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
90 changes: 46 additions & 44 deletions CSharpInteractive/Composition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace CSharpInteractive;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Scripting;
using Pure.DI;
using static Pure.DI.Lifetime;
using static Pure.DI.Tag;
using CommandLineParser = Core.CommandLineParser;
using Debugger = Core.Debugger;

Expand All @@ -31,7 +33,7 @@ private static void Setup()
.Root<Root>("Root")

#if TOOL
.DefaultLifetime(Lifetime.Transient)
.DefaultLifetime(Transient)
.Bind().To(_ => RunningMode.Tool)
.Bind().To(ctx =>
{
Expand All @@ -53,19 +55,19 @@ private static void Setup()
.Bind().To(_ => ScriptOptions.Default.CheckOverflow ? CheckOverflow.On : CheckOverflow.Off)
.Bind().To(_ => ScriptOptions.Default.AllowUnsafe ? AllowUnsafe.On : AllowUnsafe.Off)

.DefaultLifetime(Lifetime.Singleton)
.Bind(Tag.Type).To<ExitManager>()
.Bind(Tag.Type).To<Debugger>()
.DefaultLifetime(Singleton)
.Bind(Unique).To<ExitManager>()
.Bind(Unique).To<Debugger>()
.Bind(InteractionMode.Interactive).To<InteractiveRunner>()
.Bind(InteractionMode.NonInteractive).To<ScriptRunner>()
.Bind().To<CommandSource>()
.Bind().To<Setting<TTE>>()
.Bind(Tag.Type).Bind<IReferenceRegistry>().To<ReferencesScriptOptionsFactory>()
.Bind(Unique).Bind<IReferenceRegistry>().To<ReferencesScriptOptionsFactory>()
#endif
#if APPLICATION
.Bind().As(Lifetime.Transient).To(_ => RunningMode.Application)
.Bind().As(Transient).To(_ => RunningMode.Application)
#endif
.DefaultLifetime(Lifetime.Transient)
.DefaultLifetime(Transient)
.Bind().To(_ => DateTime.Now)
.Bind().To(_ => typeof(Composition).Assembly)
.Bind().To(_ => new CSharpParseOptions().LanguageVersion)
Expand All @@ -83,22 +85,22 @@ private static void Setup()
.Bind().To<SourceResolver>()
.Bind().To<MetadataResolver>()
.Bind().To<AssembliesProvider>()
.Bind(Tag.Type).To<ConfigurableScriptOptionsFactory>()
.Bind(Unique).To<ConfigurableScriptOptionsFactory>()
.Bind().To<ScriptSubmissionAnalyzer>()
.Bind(Tag.Unique).To<HelpCommandFactory>()
.Bind(Tag.Unique).To<HelpCommandRunner>()
.Bind(Unique).To<HelpCommandFactory>()
.Bind(Unique).To<HelpCommandRunner>()
.Bind().To<FilePathResolver>()
.Bind().To<StartInfoFactory>()

.DefaultLifetime(Lifetime.PerBlock)
.DefaultLifetime(PerBlock)
.Bind().To<StartInfoDescription>()
.Bind().To<HostEnvironment>()
.Bind().To<ColorTheme>()
.Bind().To<TeamCityLineFormatter>()
.Bind().To<FileSystem>()
.Bind<IDotNetEnvironment>().Bind<ITraceSource>(Tag.Type).To<DotNetEnvironment>()
.Bind<IDockerEnvironment>().Bind<ITraceSource>(Tag.Type).To<DockerEnvironment>()
.Bind<INuGetEnvironment>().Bind<ITraceSource>(Tag.Type).To<NuGetEnvironment>()
.Bind<IDotNetEnvironment>().Bind<ITraceSource>(Unique).To<DotNetEnvironment>()
.Bind<IDockerEnvironment>().Bind<ITraceSource>(Unique).To<DockerEnvironment>()
.Bind<INuGetEnvironment>().Bind<ITraceSource>(Unique).To<NuGetEnvironment>()
.Bind(typeof(VerbosityLevel)).To<VerbosityLevelSettingDescription>()
.Bind().To<MSBuildArgumentsTool>()
.Bind().To<CommandLineParser>()
Expand Down Expand Up @@ -127,7 +129,7 @@ private static void Setup()
.Bind().To<TextReplacer>()
.Bind().To<RuntimeExplorer>()

.DefaultLifetime(Lifetime.Singleton)
.DefaultLifetime(Singleton)
.Bind().To<Root>()
.Bind().To(_ => new CancellationTokenSource())
.Bind().To<CISpecific<TT>>()
Expand All @@ -142,8 +144,8 @@ private static void Setup()
.Bind().To((ICISpecific<ILog<TT>> log) => log.Instance)
.Bind().To<CISettings>()
.Bind().To<ExitTracker>()
.Bind().Bind<ITraceSource>(Tag.Type).To<Environment>()
.Bind<IEnvironmentVariables>().Bind<ITraceSource>(Tag.Type).To<EnvironmentVariables>()
.Bind().Bind<ITraceSource>(Unique).To<Environment>()
.Bind<IEnvironmentVariables>().Bind<ITraceSource>(Unique).To<EnvironmentVariables>()
.Bind().To<Settings>()
.Bind().To<Info>()
.Bind().To<ConsoleSource>()
Expand Down Expand Up @@ -173,33 +175,33 @@ private static void Setup()
.Bind().To<ProcessInFlowRunner>()
.Bind().To<NuGetReferenceResolver>()
.Bind().To<ScriptContentReplacer>()
.Bind(Tag.Type).To<AssembliesScriptOptionsProvider>()
.Bind(Tag.Type).To<SourceFileScriptOptionsFactory>()
.Bind(Tag.Type).To<MetadataResolverOptionsFactory>()
.Bind(Tag.Type).To<ImportsOptionsFactory>()
.Bind(Tag.Unique).To<SettingCommandFactory<LanguageVersion>>()
.Bind(Tag.Unique).To<SettingCommandRunner<LanguageVersion>>()
.Bind(typeof(LanguageVersion)).As(Lifetime.PerBlock).To<LanguageVersionSettingDescription>()
.Bind(Tag.Unique).To<SettingCommandFactory<OptimizationLevel>>()
.Bind(Tag.Unique).To<SettingCommandRunner<OptimizationLevel>>()
.Bind(typeof(OptimizationLevel)).As(Lifetime.PerBlock).To<OptimizationLevelSettingDescription>()
.Bind(Tag.Unique).To<SettingCommandFactory<WarningLevel>>()
.Bind(Tag.Unique).To<SettingCommandRunner<WarningLevel>>()
.Bind(typeof(WarningLevel)).As(Lifetime.PerBlock).To<WarningLevelSettingDescription>()
.Bind(Tag.Unique).To<SettingCommandFactory<CheckOverflow>>()
.Bind(Tag.Unique).To<SettingCommandRunner<CheckOverflow>>()
.Bind(typeof(CheckOverflow)).As(Lifetime.PerBlock).To<CheckOverflowSettingDescription>()
.Bind(Tag.Unique).To<SettingCommandFactory<AllowUnsafe>>()
.Bind(Tag.Unique).To<SettingCommandRunner<AllowUnsafe>>()
.Bind(typeof(AllowUnsafe)).As(Lifetime.PerBlock).To<AllowUnsafeSettingDescription>()
.Bind(Tag.Unique).To<SettingCommandFactory<NuGetRestoreSetting>>()
.Bind(Tag.Unique).To<SettingCommandRunner<NuGetRestoreSetting>>()
.Bind(typeof(NuGetRestoreSetting)).As(Lifetime.PerBlock).To<NuGetRestoreSettingDescription>()
.Bind(Tag.Unique).To<CSharpScriptCommandRunner>()
.Bind(Tag.Unique).To<SettingCommandFactory<VerbosityLevel>>()
.Bind(Tag.Unique).To<SettingCommandRunner<VerbosityLevel>>()
.Bind(Tag.Unique).To<AddNuGetReferenceCommandFactory>()
.Bind(Tag.Unique).To<AddNuGetReferenceCommandRunner>()
.Bind(Unique).To<AssembliesScriptOptionsProvider>()
.Bind(Unique).To<SourceFileScriptOptionsFactory>()
.Bind(Unique).To<MetadataResolverOptionsFactory>()
.Bind(Unique).To<ImportsOptionsFactory>()
.Bind(Unique).To<SettingCommandFactory<LanguageVersion>>()
.Bind(Unique).To<SettingCommandRunner<LanguageVersion>>()
.Bind(Unique).As(PerBlock).To<LanguageVersionSettingDescription>()
.Bind(Unique).To<SettingCommandFactory<OptimizationLevel>>()
.Bind(Unique).To<SettingCommandRunner<OptimizationLevel>>()
.Bind(Unique).As(PerBlock).To<OptimizationLevelSettingDescription>()
.Bind(Unique).To<SettingCommandFactory<WarningLevel>>()
.Bind(Unique).To<SettingCommandRunner<WarningLevel>>()
.Bind(Unique).As(PerBlock).To<WarningLevelSettingDescription>()
.Bind(Unique).To<SettingCommandFactory<CheckOverflow>>()
.Bind(Unique).To<SettingCommandRunner<CheckOverflow>>()
.Bind(Unique).As(PerBlock).To<CheckOverflowSettingDescription>()
.Bind(Unique).To<SettingCommandFactory<AllowUnsafe>>()
.Bind(Unique).To<SettingCommandRunner<AllowUnsafe>>()
.Bind(Unique).As(PerBlock).To<AllowUnsafeSettingDescription>()
.Bind(Unique).To<SettingCommandFactory<NuGetRestoreSetting>>()
.Bind(Unique).To<SettingCommandRunner<NuGetRestoreSetting>>()
.Bind(Unique).As(PerBlock).To<NuGetRestoreSettingDescription>()
.Bind(Unique).To<CSharpScriptCommandRunner>()
.Bind(Unique).To<SettingCommandFactory<VerbosityLevel>>()
.Bind(Unique).To<SettingCommandRunner<VerbosityLevel>>()
.Bind(Unique).To<AddNuGetReferenceCommandFactory>()
.Bind(Unique).To<AddNuGetReferenceCommandRunner>()
.Bind("Default", "Ansi").To<Properties>()
.Bind("TeamCity").To<TeamCityProperties>()
.Bind().To((ICISpecific<IProperties> properties) => properties.Instance)
Expand Down

0 comments on commit 9630e2d

Please sign in to comment.