Beispiel #1
0
        static int MainCore()
        {
            if (cl.HasOption("?", "help"))
            {
                Usage();
                return(0);
            }

            if (cl.HasOption(PFCOptions.Wrap))
            {
                WrapperGenerator.Wrap(cl);
                return(0);
            }

#if PERF
            int start = Environment.TickCount;
#endif
            if (cl.HasOption("dot"))
            {
                DebugHooks.MethodName = cl.GetOption("", "dot");
            }

            RunCore();

#if PERF
            CLI.Infrastructure.DumpPerfStat();
            Infrastructure.DumpPerfStat();
            Console.WriteLine((Environment.TickCount - start) + "ms");
#endif
            return(0);
        }
Beispiel #2
0
        static void Run(CommandLine cl)
        {
            if (cl.HasOption("w", "wrap"))
            {
                WrapperGenerator.Wrap(cl);
                return;
            }

            if (cl.HasOption("m", "merge"))
            {
                var output = cl.GetOption(null, "o", "out", "output");
                AbcMerger.Merge(cl.GetInputFiles(), output);
                return;
            }

            if (cl.HasOption("l", "list"))
            {
                List(cl);
                return;
            }

            if (cl.HasOption("removeExports"))
            {
                RemoveExports(cl);
                return;
            }

            Dump(cl);
        }
Beispiel #3
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            Utils.SaveState(this);

            string curdir = Environment.CurrentDirectory;

            string path = tbInputPath.Text;
            string cls  = "";

            string dir = tbDir.Text;

            if (!string.IsNullOrEmpty(dir))
            {
                cls += " /dir:" + dir;
                cls += " ";
            }

            if (!string.IsNullOrEmpty(tbOptions.Text))
            {
                cls += tbOptions.Text;
                cls += " ";
            }

            string outpath = tbOut.Text;

            if (string.IsNullOrEmpty(outpath))
            {
                outpath = Path.GetFileNameWithoutExtension(path) + ".dll";
            }

            try
            {
                dir = Path.GetDirectoryName(path);
                Environment.CurrentDirectory = dir;
                WrapperGenerator.Wrap(Path.GetFileName(path), outpath, cls);
            }
            finally
            {
                Environment.CurrentDirectory = curdir;
            }
        }