[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/SandersAlex/flashdevelop/development/External/Tools/Program.cs [Back]  [Original]

using System;
using System.Reflection;

namespace FDBuild
{
    /// 
    /// FDBuild.exe is a command-line tool for compiling .fdp project files using
    /// MTASC and Swfmill.
    /// 
    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 });
        }
    }
}

Web Proxy Viewer  |  New URL  |  Original Page