-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
31 lines (26 loc) · 1.2 KB
/
Program.cs
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
using System;
using System.Reflection;
namespace FDBuild
{
/// <summary>
/// FDBuild.exe is a command-line tool for compiling .fdp project files using
/// MTASC and Swfmill.
/// </summary>
public class Program
{
public static int Main(string[] args)
{
DependencyLoader.Init();
// We can't actually have any code in this class that directly references anything
// that depends on ProjectManager.dll, because the assembly resolver will try to
// load it before executing any code we can control. The idea is we only want
// one copy of ProjectManager.dll period, and it's in a different directory, so
// the DependencyLoader class should set up code that will find it.
// So we have to use reflection to discover our main class which does the actual work.
Type builderType = Type.GetType("FDBuild.CommandLineBuilder");
MethodInfo buildMethod = builderType.GetMethod("Run");
object builder = Activator.CreateInstance(builderType);
return (int)buildMethod.Invoke(builder, new object[] { args });
}
}
}