Skip to content

Commit 9630e2d

Browse files
Updating internal Pure.DI to 2.1.43
1 parent ddffe0e commit 9630e2d

File tree

4 files changed

+49
-47
lines changed

4 files changed

+49
-47
lines changed

CSharpInteractive.Tests/CSharpInteractive.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
1212
<PackageReference Include="Moq" Version="4.20.72" />
13-
<PackageReference Include="Pure.DI" Version="2.1.42">
13+
<PackageReference Include="Pure.DI" Version="2.1.43">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>

CSharpInteractive/CSharpInteractive.Tool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<ItemGroup>
3131
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.12.0-3.final" />
32-
<PackageReference Include="Pure.DI" Version="2.1.42">
32+
<PackageReference Include="Pure.DI" Version="2.1.43">
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3535
</PackageReference>

CSharpInteractive/CSharpInteractive.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<ItemGroup>
2424
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.12.0-3.final" />
25-
<PackageReference Include="Pure.DI" Version="2.1.42">
25+
<PackageReference Include="Pure.DI" Version="2.1.43">
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
</PackageReference>

CSharpInteractive/Composition.cs

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace CSharpInteractive;
1717
using Microsoft.CodeAnalysis.CSharp;
1818
using Microsoft.CodeAnalysis.Scripting;
1919
using Pure.DI;
20+
using static Pure.DI.Lifetime;
21+
using static Pure.DI.Tag;
2022
using CommandLineParser = Core.CommandLineParser;
2123
using Debugger = Core.Debugger;
2224

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

3335
#if TOOL
34-
.DefaultLifetime(Lifetime.Transient)
36+
.DefaultLifetime(Transient)
3537
.Bind().To(_ => RunningMode.Tool)
3638
.Bind().To(ctx =>
3739
{
@@ -53,19 +55,19 @@ private static void Setup()
5355
.Bind().To(_ => ScriptOptions.Default.CheckOverflow ? CheckOverflow.On : CheckOverflow.Off)
5456
.Bind().To(_ => ScriptOptions.Default.AllowUnsafe ? AllowUnsafe.On : AllowUnsafe.Off)
5557

56-
.DefaultLifetime(Lifetime.Singleton)
57-
.Bind(Tag.Type).To<ExitManager>()
58-
.Bind(Tag.Type).To<Debugger>()
58+
.DefaultLifetime(Singleton)
59+
.Bind(Unique).To<ExitManager>()
60+
.Bind(Unique).To<Debugger>()
5961
.Bind(InteractionMode.Interactive).To<InteractiveRunner>()
6062
.Bind(InteractionMode.NonInteractive).To<ScriptRunner>()
6163
.Bind().To<CommandSource>()
6264
.Bind().To<Setting<TTE>>()
63-
.Bind(Tag.Type).Bind<IReferenceRegistry>().To<ReferencesScriptOptionsFactory>()
65+
.Bind(Unique).Bind<IReferenceRegistry>().To<ReferencesScriptOptionsFactory>()
6466
#endif
6567
#if APPLICATION
66-
.Bind().As(Lifetime.Transient).To(_ => RunningMode.Application)
68+
.Bind().As(Transient).To(_ => RunningMode.Application)
6769
#endif
68-
.DefaultLifetime(Lifetime.Transient)
70+
.DefaultLifetime(Transient)
6971
.Bind().To(_ => DateTime.Now)
7072
.Bind().To(_ => typeof(Composition).Assembly)
7173
.Bind().To(_ => new CSharpParseOptions().LanguageVersion)
@@ -83,22 +85,22 @@ private static void Setup()
8385
.Bind().To<SourceResolver>()
8486
.Bind().To<MetadataResolver>()
8587
.Bind().To<AssembliesProvider>()
86-
.Bind(Tag.Type).To<ConfigurableScriptOptionsFactory>()
88+
.Bind(Unique).To<ConfigurableScriptOptionsFactory>()
8789
.Bind().To<ScriptSubmissionAnalyzer>()
88-
.Bind(Tag.Unique).To<HelpCommandFactory>()
89-
.Bind(Tag.Unique).To<HelpCommandRunner>()
90+
.Bind(Unique).To<HelpCommandFactory>()
91+
.Bind(Unique).To<HelpCommandRunner>()
9092
.Bind().To<FilePathResolver>()
9193
.Bind().To<StartInfoFactory>()
9294

93-
.DefaultLifetime(Lifetime.PerBlock)
95+
.DefaultLifetime(PerBlock)
9496
.Bind().To<StartInfoDescription>()
9597
.Bind().To<HostEnvironment>()
9698
.Bind().To<ColorTheme>()
9799
.Bind().To<TeamCityLineFormatter>()
98100
.Bind().To<FileSystem>()
99-
.Bind<IDotNetEnvironment>().Bind<ITraceSource>(Tag.Type).To<DotNetEnvironment>()
100-
.Bind<IDockerEnvironment>().Bind<ITraceSource>(Tag.Type).To<DockerEnvironment>()
101-
.Bind<INuGetEnvironment>().Bind<ITraceSource>(Tag.Type).To<NuGetEnvironment>()
101+
.Bind<IDotNetEnvironment>().Bind<ITraceSource>(Unique).To<DotNetEnvironment>()
102+
.Bind<IDockerEnvironment>().Bind<ITraceSource>(Unique).To<DockerEnvironment>()
103+
.Bind<INuGetEnvironment>().Bind<ITraceSource>(Unique).To<NuGetEnvironment>()
102104
.Bind(typeof(VerbosityLevel)).To<VerbosityLevelSettingDescription>()
103105
.Bind().To<MSBuildArgumentsTool>()
104106
.Bind().To<CommandLineParser>()
@@ -127,7 +129,7 @@ private static void Setup()
127129
.Bind().To<TextReplacer>()
128130
.Bind().To<RuntimeExplorer>()
129131

130-
.DefaultLifetime(Lifetime.Singleton)
132+
.DefaultLifetime(Singleton)
131133
.Bind().To<Root>()
132134
.Bind().To(_ => new CancellationTokenSource())
133135
.Bind().To<CISpecific<TT>>()
@@ -142,8 +144,8 @@ private static void Setup()
142144
.Bind().To((ICISpecific<ILog<TT>> log) => log.Instance)
143145
.Bind().To<CISettings>()
144146
.Bind().To<ExitTracker>()
145-
.Bind().Bind<ITraceSource>(Tag.Type).To<Environment>()
146-
.Bind<IEnvironmentVariables>().Bind<ITraceSource>(Tag.Type).To<EnvironmentVariables>()
147+
.Bind().Bind<ITraceSource>(Unique).To<Environment>()
148+
.Bind<IEnvironmentVariables>().Bind<ITraceSource>(Unique).To<EnvironmentVariables>()
147149
.Bind().To<Settings>()
148150
.Bind().To<Info>()
149151
.Bind().To<ConsoleSource>()
@@ -173,33 +175,33 @@ private static void Setup()
173175
.Bind().To<ProcessInFlowRunner>()
174176
.Bind().To<NuGetReferenceResolver>()
175177
.Bind().To<ScriptContentReplacer>()
176-
.Bind(Tag.Type).To<AssembliesScriptOptionsProvider>()
177-
.Bind(Tag.Type).To<SourceFileScriptOptionsFactory>()
178-
.Bind(Tag.Type).To<MetadataResolverOptionsFactory>()
179-
.Bind(Tag.Type).To<ImportsOptionsFactory>()
180-
.Bind(Tag.Unique).To<SettingCommandFactory<LanguageVersion>>()
181-
.Bind(Tag.Unique).To<SettingCommandRunner<LanguageVersion>>()
182-
.Bind(typeof(LanguageVersion)).As(Lifetime.PerBlock).To<LanguageVersionSettingDescription>()
183-
.Bind(Tag.Unique).To<SettingCommandFactory<OptimizationLevel>>()
184-
.Bind(Tag.Unique).To<SettingCommandRunner<OptimizationLevel>>()
185-
.Bind(typeof(OptimizationLevel)).As(Lifetime.PerBlock).To<OptimizationLevelSettingDescription>()
186-
.Bind(Tag.Unique).To<SettingCommandFactory<WarningLevel>>()
187-
.Bind(Tag.Unique).To<SettingCommandRunner<WarningLevel>>()
188-
.Bind(typeof(WarningLevel)).As(Lifetime.PerBlock).To<WarningLevelSettingDescription>()
189-
.Bind(Tag.Unique).To<SettingCommandFactory<CheckOverflow>>()
190-
.Bind(Tag.Unique).To<SettingCommandRunner<CheckOverflow>>()
191-
.Bind(typeof(CheckOverflow)).As(Lifetime.PerBlock).To<CheckOverflowSettingDescription>()
192-
.Bind(Tag.Unique).To<SettingCommandFactory<AllowUnsafe>>()
193-
.Bind(Tag.Unique).To<SettingCommandRunner<AllowUnsafe>>()
194-
.Bind(typeof(AllowUnsafe)).As(Lifetime.PerBlock).To<AllowUnsafeSettingDescription>()
195-
.Bind(Tag.Unique).To<SettingCommandFactory<NuGetRestoreSetting>>()
196-
.Bind(Tag.Unique).To<SettingCommandRunner<NuGetRestoreSetting>>()
197-
.Bind(typeof(NuGetRestoreSetting)).As(Lifetime.PerBlock).To<NuGetRestoreSettingDescription>()
198-
.Bind(Tag.Unique).To<CSharpScriptCommandRunner>()
199-
.Bind(Tag.Unique).To<SettingCommandFactory<VerbosityLevel>>()
200-
.Bind(Tag.Unique).To<SettingCommandRunner<VerbosityLevel>>()
201-
.Bind(Tag.Unique).To<AddNuGetReferenceCommandFactory>()
202-
.Bind(Tag.Unique).To<AddNuGetReferenceCommandRunner>()
178+
.Bind(Unique).To<AssembliesScriptOptionsProvider>()
179+
.Bind(Unique).To<SourceFileScriptOptionsFactory>()
180+
.Bind(Unique).To<MetadataResolverOptionsFactory>()
181+
.Bind(Unique).To<ImportsOptionsFactory>()
182+
.Bind(Unique).To<SettingCommandFactory<LanguageVersion>>()
183+
.Bind(Unique).To<SettingCommandRunner<LanguageVersion>>()
184+
.Bind(Unique).As(PerBlock).To<LanguageVersionSettingDescription>()
185+
.Bind(Unique).To<SettingCommandFactory<OptimizationLevel>>()
186+
.Bind(Unique).To<SettingCommandRunner<OptimizationLevel>>()
187+
.Bind(Unique).As(PerBlock).To<OptimizationLevelSettingDescription>()
188+
.Bind(Unique).To<SettingCommandFactory<WarningLevel>>()
189+
.Bind(Unique).To<SettingCommandRunner<WarningLevel>>()
190+
.Bind(Unique).As(PerBlock).To<WarningLevelSettingDescription>()
191+
.Bind(Unique).To<SettingCommandFactory<CheckOverflow>>()
192+
.Bind(Unique).To<SettingCommandRunner<CheckOverflow>>()
193+
.Bind(Unique).As(PerBlock).To<CheckOverflowSettingDescription>()
194+
.Bind(Unique).To<SettingCommandFactory<AllowUnsafe>>()
195+
.Bind(Unique).To<SettingCommandRunner<AllowUnsafe>>()
196+
.Bind(Unique).As(PerBlock).To<AllowUnsafeSettingDescription>()
197+
.Bind(Unique).To<SettingCommandFactory<NuGetRestoreSetting>>()
198+
.Bind(Unique).To<SettingCommandRunner<NuGetRestoreSetting>>()
199+
.Bind(Unique).As(PerBlock).To<NuGetRestoreSettingDescription>()
200+
.Bind(Unique).To<CSharpScriptCommandRunner>()
201+
.Bind(Unique).To<SettingCommandFactory<VerbosityLevel>>()
202+
.Bind(Unique).To<SettingCommandRunner<VerbosityLevel>>()
203+
.Bind(Unique).To<AddNuGetReferenceCommandFactory>()
204+
.Bind(Unique).To<AddNuGetReferenceCommandRunner>()
203205
.Bind("Default", "Ansi").To<Properties>()
204206
.Bind("TeamCity").To<TeamCityProperties>()
205207
.Bind().To((ICISpecific<IProperties> properties) => properties.Instance)

0 commit comments

Comments
 (0)