Skip to content

Commit 40f32b6

Browse files
committed
upgrade Azure.Core to 1.2.2
1 parent d9d94d7 commit 40f32b6

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed

src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class CustomAssemblyResolver
1010
private static IDictionary<string, Version> NetFxPreloadAssemblies =
1111
new Dictionary<string, Version>(StringComparer.InvariantCultureIgnoreCase)
1212
{
13-
{"Azure.Core", new Version("1.2.1.0")},
13+
{"Azure.Core", new Version("1.2.2.0")},
1414
{"Microsoft.Bcl.AsyncInterfaces", new Version("1.0.0.0")},
1515
{"Microsoft.IdentityModel.Clients.ActiveDirectory", new Version("3.19.2.6005")},
1616
{"Microsoft.IdentityModel.Clients.ActiveDirectory.Platform", new Version("3.19.2.6005")},
Binary file not shown.
Binary file not shown.

tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.IO;
2020
using System.Linq;
2121
using System.Management.Automation;
22+
using System.Reflection;
2223
using System.Text.RegularExpressions;
2324
using Tools.Common.Issues;
2425
using Tools.Common.Loaders;
@@ -43,7 +44,7 @@ public HelpAnalyzer()
4344
public AnalysisLogger Logger { get; set; }
4445
public string Name { get; private set; }
4546

46-
// TODO: Remove IfDef code
47+
// TODO: Remove IfDef code
4748
#if !NETSTANDARD
4849
private AppDomain _appDomain;
4950
#endif
@@ -95,6 +96,7 @@ public void Analyze(IEnumerable<string> scopes, IEnumerable<string> modulesToAna
9596
var helpLogger = Logger.CreateLogger<HelpIssue>("HelpIssues.csv");
9697
foreach (var baseDirectory in scopes.Where(s => Directory.Exists(Path.GetFullPath(s))))
9798
{
99+
PreloadSharedAssemblies(baseDirectory);
98100
foreach (var directory in Directory.EnumerateDirectories(Path.GetFullPath(baseDirectory)))
99101
{
100102
if (modulesToAnalyze != null &&
@@ -114,6 +116,30 @@ public void Analyze(IEnumerable<string> scopes, IEnumerable<string> modulesToAna
114116
}
115117
}
116118

119+
private static void PreloadSharedAssemblies(string directory)
120+
{
121+
var sharedAssemblyFolder = Path.Combine(directory, "Az.Accounts", "NetCoreAssemblies");
122+
if (Directory.Exists(sharedAssemblyFolder))
123+
{
124+
foreach (var file in Directory.GetFiles(sharedAssemblyFolder))
125+
{
126+
try
127+
{
128+
Console.WriteLine($"PreloadSharedAssemblies: Starting to load assembly {file}.");
129+
Assembly.LoadFrom(file);
130+
}
131+
catch (Exception e)
132+
{
133+
Console.WriteLine($"PreloadSharedAssemblies: Failed to load assembly {Path.GetFileNameWithoutExtension(file)} with {e}");
134+
}
135+
}
136+
}
137+
else
138+
{
139+
Console.WriteLine($"PreloadSharedAssemblies: Could not find directory {sharedAssemblyFolder}.");
140+
}
141+
}
142+
117143
private void AnalyzeMamlHelp(
118144
IEnumerable<string> scopes,
119145
string directory,
@@ -158,7 +184,7 @@ private void AnalyzeMamlHelp(
158184
h.Assembly = cmdletFileName;
159185
}, "Cmdlet");
160186

161-
// TODO: Remove IfDef
187+
// TODO: Remove IfDef
162188
#if NETSTANDARD
163189
var proxy = new CmdletLoader();
164190
#else
@@ -169,7 +195,7 @@ private void AnalyzeMamlHelp(
169195
var helpRecords = CmdletHelpParser.GetHelpTopics(helpFile, helpLogger);
170196
ValidateHelpRecords(cmdlets, helpRecords, helpLogger);
171197
helpLogger.Decorator.Remove("Cmdlet");
172-
// TODO: Remove IfDef code
198+
// TODO: Remove IfDef code
173199
#if !NETSTANDARD
174200
AppDomain.Unload(_appDomain);
175201
#endif
@@ -229,13 +255,13 @@ private void AnalyzeMarkdownHelp(
229255
powershell.AddScript(script);
230256
var cmdletResult = powershell.Invoke();
231257
var nestedModules = new List<string>();
232-
foreach(var module in cmdletResult)
258+
foreach (var module in cmdletResult)
233259
{
234-
if(module != null && module.ToString().StartsWith("."))
260+
if (module != null && module.ToString().StartsWith("."))
235261
{
236262
nestedModules.Add(module.ToString().Substring(2));
237-
}
238-
else if(module != null)
263+
}
264+
else if (module != null)
239265
{
240266
nestedModules.Add(module.ToString());
241267
}
@@ -270,7 +296,7 @@ private void AnalyzeMarkdownHelp(
270296
h.Assembly = assemblyFileName;
271297
}, "Cmdlet");
272298
processedHelpFiles.Add(assemblyFileName);
273-
// TODO: Remove IfDef
299+
// TODO: Remove IfDef
274300
#if NETSTANDARD
275301
var proxy = new CmdletLoader();
276302
#else
@@ -280,7 +306,7 @@ private void AnalyzeMarkdownHelp(
280306
var cmdlets = module.Cmdlets;
281307
allCmdlets.AddRange(cmdlets);
282308
helpLogger.Decorator.Remove("Cmdlet");
283-
// TODO: Remove IfDef code
309+
// TODO: Remove IfDef code
284310
#if !NETSTANDARD
285311
AppDomain.Unload(_appDomain);
286312
#endif
@@ -290,7 +316,7 @@ private void AnalyzeMarkdownHelp(
290316
script = $"Import-LocalizedData -BaseDirectory {parentDirectory} -FileName {psd1FileName} -BindingVariable ModuleMetadata; $ModuleMetadata.FunctionsToExport;";
291317
cmdletResult = PowerShell.Create().AddScript(script).Invoke();
292318
var functionCmdlets = cmdletResult.Select(c => c.ToString()).ToList();
293-
foreach(var cmdlet in functionCmdlets)
319+
foreach (var cmdlet in functionCmdlets)
294320
{
295321
var metadata = new CmdletMetadata();
296322
metadata.VerbName = cmdlet.Split("-")[0];
@@ -302,7 +328,7 @@ private void AnalyzeMarkdownHelp(
302328
ValidateHelpMarkdown(helpFolder, helpFiles, helpLogger);
303329

304330
Directory.SetCurrentDirectory(savedDirectory);
305-
331+
306332
}
307333

308334
private void ValidateHelpRecords(IList<CmdletMetadata> cmdlets, IList<string> helpRecords,
@@ -321,7 +347,7 @@ private void ValidateHelpRecords(IList<CmdletMetadata> cmdlets, IList<string> he
321347
ProblemId = MissingHelp,
322348
Remediation = string.Format("Add Help record for cmdlet {0} to help file.", cmdlet.Name)
323349
};
324-
if(cmdlet.ClassName != null)
350+
if (cmdlet.ClassName != null)
325351
{
326352
issue.Description = $"Help missing for cmdlet {cmdlet.Name} implemented by class {cmdlet.ClassName}";
327353
}
@@ -335,16 +361,16 @@ private void ValidateHelpRecords(IList<CmdletMetadata> cmdlets, IList<string> he
335361

336362
foreach (var helpRecord in helpRecords)
337363
{
338-
if(!cmdletDict.ContainsKey(helpRecord))
364+
if (!cmdletDict.ContainsKey(helpRecord))
339365
{
340366
Console.Error.WriteLine($"Help record {helpRecord} has no cmdlet.");
341-
}
367+
}
342368
}
343369
}
344370

345371
private void ValidateHelpMarkdown(string helpFolder, IList<string> helpRecords, ReportLogger<HelpIssue> helpLogger)
346372
{
347-
foreach(var helpMarkdown in helpRecords)
373+
foreach (var helpMarkdown in helpRecords)
348374
{
349375
var file = Path.Combine(helpFolder, helpMarkdown + ".md");
350376
var content = File.ReadAllText(file);

0 commit comments

Comments
 (0)