File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77global using BitMono . Obfuscation . Files ;
88global using BitMono . Obfuscation . Starter ;
99global using BitMono . Shared ;
10- global using BitMono . Shared . Configuration ;
1110global using BitMono . Shared . DependencyInjection ;
1211global using BitMono . Shared . Logging ;
1312global using BitMono . Shared . Models ;
Original file line number Diff line number Diff line change @@ -29,19 +29,19 @@ public OptionsObfuscationNeedsFactory(string[] args)
2929 {
3030 if ( options . ObfuscationFile != null && File . Exists ( options . ObfuscationFile ) )
3131 {
32- obfuscationSettings = SettingsLoader . Load < ObfuscationSettings > ( options . ObfuscationFile ) ;
32+ obfuscationSettings = Json . LoadFile < ObfuscationSettings > ( options . ObfuscationFile ) ;
3333 }
3434 else if ( File . Exists ( KnownConfigNames . Obfuscation ) )
3535 {
36- obfuscationSettings = SettingsLoader . Load < ObfuscationSettings > ( KnownConfigNames . Obfuscation ) ;
36+ obfuscationSettings = Json . LoadFile < ObfuscationSettings > ( KnownConfigNames . Obfuscation ) ;
3737 }
3838 else
3939 {
4040 // Fallback to application base directory
4141 var baseObfuscationFile = Path . Combine ( AppContext . BaseDirectory , KnownConfigNames . Obfuscation ) ;
4242 if ( File . Exists ( baseObfuscationFile ) )
4343 {
44- obfuscationSettings = SettingsLoader . Load < ObfuscationSettings > ( baseObfuscationFile ) ;
44+ obfuscationSettings = Json . LoadFile < ObfuscationSettings > ( baseObfuscationFile ) ;
4545 }
4646 }
4747
Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ public ObfuscationNeeds Create(CancellationToken cancellationToken)
3636 {
3737 if ( File . Exists ( obfuscationFile ?? KnownConfigNames . Obfuscation ) )
3838 {
39- obfuscationSettings = SettingsLoader . Load < ObfuscationSettings > ( obfuscationFile ?? KnownConfigNames . Obfuscation ) ;
39+ obfuscationSettings = Json . LoadFile < ObfuscationSettings > ( obfuscationFile ?? KnownConfigNames . Obfuscation ) ;
4040 }
4141
4242 if ( File . Exists ( KnownConfigNames . Protections ) )
4343 {
44- var loadedSettings = SettingsLoader . Load < ProtectionSettings > ( KnownConfigNames . Protections ) ;
44+ var loadedSettings = Json . LoadFile < ProtectionSettings > ( KnownConfigNames . Protections ) ;
4545 protectionSettings = loadedSettings ? . Protections ;
4646 }
4747
Original file line number Diff line number Diff line change 2727global using Echo . DataFlow . Analysis ;
2828global using Echo . Platforms . AsmResolver ;
2929global using JetBrains . Annotations ;
30- global using Newtonsoft . Json ;
3130global using BitMono . Shared . Extensions ;
3231global using System ;
3332global using System . Collections . Generic ;
Original file line number Diff line number Diff line change 88global using BitMono . Obfuscation . Files ;
99global using BitMono . Obfuscation . Starter ;
1010global using BitMono . Shared ;
11- global using BitMono . Shared . Configuration ;
1211global using BitMono . Shared . DependencyInjection ;
1312global using BitMono . Shared . Logging ;
1413global using BitMono . Shared . Models ;
Original file line number Diff line number Diff line change 99global using BitMono . Core . Services ;
1010global using BitMono . Host . Ioc ;
1111global using BitMono . Shared ;
12- global using BitMono . Shared . Configuration ;
1312global using BitMono . Shared . DependencyInjection ;
1413global using BitMono . Shared . Logging ;
1514global using BitMono . Shared . Models ;
Original file line number Diff line number Diff line change 55using BitMono . Core . Renaming ;
66using BitMono . Core . Services ;
77using BitMono . Host . Ioc ;
8- using BitMono . Shared . Configuration ;
98using BitMono . Shared . DependencyInjection ;
109using BitMono . Shared . Logging ;
1110using BitMono . Shared . Models ;
@@ -63,16 +62,16 @@ public void Load(Container container)
6362 var logger = new Logger ( loggerConfiguration ) ;
6463 container . Register < ILogger > ( logger ) . AsSingleton ( ) ;
6564
66- var criticalsSettings = SettingsLoader . Load < CriticalsSettings > (
65+ var criticalsSettings = Json . LoadFile < CriticalsSettings > (
6766 _criticalsFile ?? KnownConfigNames . Criticals ) ;
6867 container . Register ( criticalsSettings ) . AsSingleton ( ) ;
6968
7069 var obfuscationSettings = _obfuscationSettings ??
71- SettingsLoader . Load < ObfuscationSettings > ( _obfuscationFile ?? KnownConfigNames . Obfuscation ) ;
70+ Json . LoadFile < ObfuscationSettings > ( _obfuscationFile ?? KnownConfigNames . Obfuscation ) ;
7271 container . Register ( obfuscationSettings ) . AsSingleton ( ) ;
7372
7473 var protectionSettings = _protectionSettings ??
75- SettingsLoader . Load < ProtectionSettings > ( _protectionsFile ?? KnownConfigNames . Protections ) ;
74+ Json . LoadFile < ProtectionSettings > ( _protectionsFile ?? KnownConfigNames . Protections ) ;
7675 container . Register ( protectionSettings ) . AsSingleton ( ) ;
7776
7877 container . Register < IEngineContextAccessor , EngineContextAccessor > ( ) . AsSingleton ( ) ;
Original file line number Diff line number Diff line change 99 <!-- Common Packages for all frameworks -->
1010 <ItemGroup >
1111 <PackageReference Include =" NullGuard.Fody" Version =" 3.1.1" PrivateAssets =" All" />
12- <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
1312 <PackageReference Include =" morelinq" Version =" 4.4.0" />
1413 </ItemGroup >
1514
15+ <!-- JSON: System.Text.Json is in-box on net6.0+, so we add nothing there. The legacy TFMs keep
16+ Newtonsoft.Json (a single self-contained DLL, no transitive deps) via the Json helper's #if. -->
17+ <ItemGroup Condition =" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' " >
18+ <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
19+ </ItemGroup >
20+
1621 <!-- Packages specific to older frameworks that need polyfills -->
1722 <ItemGroup Condition =" '$(TargetFramework)' == 'net462' " >
1823 <PackageReference Include =" System.Collections.Immutable" Version =" 1.7.1" />
Load diff This file was deleted.
Original file line number Diff line number Diff line change 33global using System . IO ;
44global using System . Linq ;
55global using System . Threading ;
6- global using Newtonsoft . Json ;
6+ #if NET6_0_OR_GREATER
7+ global using JsonIgnoreAttribute = System . Text . Json . Serialization . JsonIgnoreAttribute ;
8+ #else
9+ global using JsonIgnoreAttribute = Newtonsoft . Json . JsonIgnoreAttribute ;
10+ #endif
711global using NullGuard ;
812global using BitMono . Shared . Extensions ;
You can’t perform that action at this time.
0 commit comments