-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (37 loc) · 1.23 KB
/
Program.cs
File metadata and controls
48 lines (37 loc) · 1.23 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
using System.IO;
using System.Linq;
using Solidoc.Serializers;
using Solidoc.Utility;
namespace Solidoc
{
public class Program
{
internal static void Main(string[] args)
{
ResourceWriter.Run();
if (args.Length > 2)
{
ConsoleUtility.WriteException(string.Format(I18N.InvalidCommand, string.Join(" ", args)));
return;
}
string pathToRoot = args[0];
if (Directory.Exists(Path.Combine(pathToRoot, "build")))
{
Directory.Delete(Path.Combine(pathToRoot, "build"), true);
}
TruffleCompiler.Compile(pathToRoot);
string pathToBuildDirectory = Path.Combine(pathToRoot, "build", "contracts");
string outputPath = args[1];
var directory = new DirectoryInfo(outputPath);
if (!directory.Exists)
{
directory.Create();
}
var parser = new ContractParser(pathToBuildDirectory);
var contracts = parser.Parse();
var generator = new Serializer(contracts.ToList(), outputPath);
generator.Serialize();
//Console.ReadLine();
}
}
}