Beispiel #1
0
        public SwfCompilerOptions(CommandLine cl) : this()
        {
            SetFrameSize(cl);
            SetFrameRate(cl);
            SetFlashVersion(cl);
            SetBgColor(cl);

            Compressed    = cl.GetBoolOption(true, PFCOptions.Compressed.Names);
            RootSprite    = cl.GetOption(null, PFCOptions.RootSprite.Names);
            Debug         = cl.GetBoolOption(true, PFCOptions.Debug.Names);
            DebugPassword = cl.GetOption(DefaultDebugPassword, PFCOptions.DebugPassword.Names);

            SetLocales(cl);

            SetRootNamespace(cl);

            HtmlTemplate = cl.GetOption(PFCOptions.HtmlTemplate);

            IgnoreExceptionBreaks = cl.IsMinus(PFCOptions.ExceptionBreak);
            if (!IgnoreExceptionBreaks)
            {
                ExceptionBreak = cl.HasOption(PFCOptions.ExceptionBreak);
            }

            if (cl.HasOption(PFCOptions.NoHtmlWrapper))
            {
                NoHtmlWrapper = true;
            }

            RslList = RslList.Parse(cl);

            Title = cl.GetOption(PFCOptions.HtmlTitle);

            StyleMixins = cl.GetPath("", PFCOptions.StyleMixins.Names);
        }
Beispiel #2
0
        static void CompileAssembly()
        {
            var options = new CompilerOptions();

            //redirect cl options to compiler
            if (!RedirectOptions(options))
            {
                LogError(Errors.InvalidCommandLine);
                Environment.Exit(-1);
            }

            //remove system references
            options.References.RemoveAll(IsSysRef);

            //add reference to pagefx corlib
            AddCorlibRef(options);
            AddCommonoRefs(options);

            if (cl.HasOption(PFCOptions.MX))
            {
                string mx = GlobalSettings.GetMxLibraryPath();
                if (!File.Exists(mx))
                {
                    //TODO: raise error
                }
                options.AddRef(mx);
            }

            var rsls = RslList.Parse(cl);

            foreach (var rsl in rsls)
            {
                options.AddRef(rsl.Library);
            }

            options.NoLogo   = true;
            options.NoStdlib = true;
            options.NoConfig = true;
            options.Output   = asmpath;

            string cout = CompilerConsole.Run(options, true);

            var errors = CompilerConsole.ParseOutput(cout);

            if (NoMain(errors))
            {
                asmpath        = Path.ChangeExtension(asmpath, ".dll");
                options.Output = asmpath;
                options.Target = CompilerTarget.Library;

                cout   = CompilerConsole.Run(options, true);
                errors = CompilerConsole.ParseOutput(cout);
            }

            if (errors.HasErrors)
            {
                Console.WriteLine(cout);
                Environment.Exit(-1);
            }
        }
Beispiel #3
0
        public SwfCompilerOptions(PfxConfig config)
        {
            FrameSize       = SwfMovie.DefaultFrameSize;
            FrameRate       = SwfMovie.DefaultFrameRate;
            Compressed      = true;
            FlashVersion    = config.Runtime.DefaultFlashVersion;
            BackgroundColor = config.Swf.DefaultBgColor;
            DebugPassword   = DefaultDebugPassword;
            OutputFormat    = OutputFormat.SWF;

            RslList = new RslList();

            FlashVersion    = config.Runtime.FlashVersion;
            FrameSize       = new SizeF(config.Swf.Width, config.Swf.Height);
            BackgroundColor = config.Swf.BgColor;
            Compressed      = config.Swf.Compressed;
            Locales         = new [] { Const.Locales.en_US };
        }