This repository was archived by the owner on Oct 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathProgram.cs
More file actions
65 lines (48 loc) · 1.73 KB
/
Program.cs
File metadata and controls
65 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using UnityEngineAnalyzer.CLI.Reporting;
namespace UnityEngineAnalyzer.CLI
{
public class Program
{
public static void Main(string[] args)
{
try
{
if (args.Length <= 0)
{
return;
}
var startTime = DateTime.Now;
var fileName = args[0];
var fileInfo = new FileInfo(fileName);
//NOTE: This could be configurable via the CLI at some point
var report = new AnalyzerReport();
report.AddExporter(new ConsoleAnalyzerExporter());
report.AddExporter(new JsonAnalyzerExporter());
report.InitializeReport(fileInfo);
var tasks = new List<Task>();
if (fileInfo.Exists)
{
var solutionAnalyzer = new SolutionAnalyzer();
var analyzeTask = solutionAnalyzer.LoadAnadAnalyzeProject(fileInfo, report);
tasks.Add(analyzeTask);
}
Task.WaitAll(tasks.ToArray());
var endTime = DateTime.Now;
var duration = endTime - startTime;
report.FinalizeReport(duration);
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
catch (Exception generalException)
{
Console.WriteLine("There was an exception running the analysis");
Console.WriteLine(generalException.ToString());
}
}
}
}