public void ReadBuildOptions()
        {
            MxmlcOptions options = project.CompilerOptions;

            ReadStartElement("build");
            while (Name == "option")
            {
                MoveToFirstAttribute();
                switch (Name)
                {
                case "accessible": options.Accessible = BoolValue; break;

                case "allowSourcePathOverlap": options.AllowSourcePathOverlap = BoolValue; break;

                case "benchmark": options.Benchmark = BoolValue; break;

                case "es": options.ES = BoolValue; break;

                case "locale": options.Locale = Value; break;

                case "loadConfig": options.LoadConfig = Value; break;

                case "optimize": options.Optimize = BoolValue; break;

                case "showActionScriptWarnings": options.ShowActionScriptWarnings = BoolValue; break;

                case "showBindingWarnings": options.ShowBindingWarnings = BoolValue; break;

                case "showInvalidCSS": options.ShowInvalidCSS = BoolValue; break;

                case "showDeprecationWarnings": options.ShowDeprecationWarnings = BoolValue; break;

                case "showUnusedTypeSelectorWarnings": options.ShowUnusedTypeSelectorWarnings = BoolValue; break;

                case "strict": options.Strict = BoolValue; break;

                case "useNetwork": options.UseNetwork = BoolValue; break;

                case "useResourceBundleMetadata": options.UseResourceBundleMetadata = BoolValue; break;

                case "warnings": options.Warnings = BoolValue; break;

                case "verboseStackTraces": options.VerboseStackTraces = BoolValue; break;

                case "linkReport": options.LinkReport = Value; break;

                case "loadExterns": options.LoadExterns = Value; break;

                case "staticLinkRSL": options.StaticLinkRSL = BoolValue; break;

                case "additional": options.Additional = Value.Split('\n'); break;

                case "compilerConstants": options.CompilerConstants = Value.Split('\n'); break;

                case "customSDK": options.CustomSDK = Value; break;
                }
                Read();
            }
            ReadEndElement();
        }
Ejemplo n.º 2
0
        void WriteNamespaces(MxmlcOptions options)
        {
            if (options.Namespaces == null || options.Namespaces.Length == 0)
            {
                return;
            }
            var namespaces = new StringBuilder();

            foreach (var ns in options.Namespaces)
            {
                if (string.IsNullOrEmpty(ns.Uri) || string.IsNullOrEmpty(ns.Manifest))
                {
                    continue;
                }

                string relPath = project.GetRelativePath(ns.Manifest);

                namespaces.Append(ns.Uri).Append('\n').Append(relPath).Append('\n');
            }

            if (namespaces.Length == 0)
            {
                return;
            }

            namespaces.Remove(namespaces.Length - 1, 1);

            WriteOption("namespaces", namespaces.ToString());
        }
Ejemplo n.º 3
0
        public void WriteBuildOptions()
        {
            WriteComment(" Build options ");
            WriteStartElement("build");

            MxmlcOptions options = project.CompilerOptions;

            WriteOption("accessible", options.Accessible);
            WriteOption("allowSourcePathOverlap", options.AllowSourcePathOverlap);
            WriteOption("benchmark", options.Benchmark);
            WriteOption("es", options.ES);
            WriteOption("locale", options.Locale);
            WriteOption("loadConfig", options.LoadConfig);
            WriteOption("optimize", options.Optimize);
            WriteOption("showActionScriptWarnings", options.ShowActionScriptWarnings);
            WriteOption("showBindingWarnings", options.ShowBindingWarnings);
            WriteOption("showInvalidCSS", options.ShowInvalidCSS);
            WriteOption("showDeprecationWarnings", options.ShowDeprecationWarnings);
            WriteOption("showUnusedTypeSelectorWarnings", options.ShowUnusedTypeSelectorWarnings);
            WriteOption("strict", options.Strict);
            WriteOption("useNetwork", options.UseNetwork);
            WriteOption("useResourceBundleMetadata", options.UseResourceBundleMetadata);
            WriteOption("warnings", options.Warnings);
            WriteOption("verboseStackTraces", options.VerboseStackTraces);
            WriteOption("linkReport", options.LinkReport);
            WriteOption("loadExterns", options.LoadExterns);
            WriteOption("staticLinkRSL", options.StaticLinkRSL);

            WriteOption("additional", string.Join("\n", options.Additional));
            WriteOption("compilerConstants", string.Join("\n", options.CompilerConstants));
            WriteOption("customSDK", options.CustomSDK);

            WriteEndElement();
        }
Ejemplo n.º 4
0
 private void AddBaseOptions(MxmlcOptions options)
 {
     if (!asc2)
     {
         if (!options.Benchmark) WriteElementString("benchmark", "false");
         else WriteElementString("benchmark", "true");
         WriteElementString("static-link-runtime-shared-libraries", options.StaticLinkRSL ? "true" : "false");
     }
     if (!options.UseNetwork) WriteElementString("use-network", "false");
     if (!options.Warnings) WriteElementString("warnings", "false");
 }
Ejemplo n.º 5
0
        public void WriteLibraries()
        {
            MxmlcOptions options = project.CompilerOptions;

            WriteComment(" SWC Include Libraries ");
            WriteList("includeLibraries", options.IncludeLibraries);
            WriteComment(" SWC Libraries ");
            WriteList("libraryPaths", options.LibraryPaths);
            WriteComment(" External Libraries ");
            WriteList("externalLibraryPaths", options.ExternalLibraryPaths);
            WriteComment(" Runtime Shared Libraries ");
            WriteList("rslPaths", options.RSLPaths);
            WriteComment(" Intrinsic Libraries ");
            WriteList("intrinsics", options.IntrinsicPaths);
        }
Ejemplo n.º 6
0
        public void WriteBuildOptions()
        {
            WriteComment(" Build options ");
            WriteStartElement("build");

            MxmlcOptions options = project.CompilerOptions;

            WriteOption("accessible", options.Accessible);
            WriteOption("advancedTelemetry", options.AdvancedTelemetry);
            if (!string.IsNullOrEmpty(options.AdvancedTelemetryPassword))
            {
                WriteOption("advancedTelemetryPassword", options.AdvancedTelemetryPassword);
            }
            WriteOption("allowSourcePathOverlap", options.AllowSourcePathOverlap);
            WriteOption("benchmark", options.Benchmark);
            WriteOption("es", options.ES);
            WriteOption("inline", options.InlineFunctions);
            WriteOption("locale", options.Locale);
            WriteOption("loadConfig", options.LoadConfig);
            WriteOption("optimize", options.Optimize);
            WriteOption("omitTraces", options.OmitTraces);
            WriteOption("showActionScriptWarnings", options.ShowActionScriptWarnings);
            WriteOption("showBindingWarnings", options.ShowBindingWarnings);
            WriteOption("showInvalidCSS", options.ShowInvalidCSS);
            WriteOption("showDeprecationWarnings", options.ShowDeprecationWarnings);
            WriteOption("showUnusedTypeSelectorWarnings", options.ShowUnusedTypeSelectorWarnings);
            WriteOption("strict", options.Strict);
            WriteOption("useNetwork", options.UseNetwork);
            WriteOption("useResourceBundleMetadata", options.UseResourceBundleMetadata);
            WriteOption("warnings", options.Warnings);
            WriteOption("verboseStackTraces", options.VerboseStackTraces);
            WriteOption("linkReport", options.LinkReport);
            WriteOption("loadExterns", options.LoadExterns);
            WriteOption("staticLinkRSL", options.StaticLinkRSL);

            WriteOption("additional", string.Join("\n", options.Additional));
            WriteOption("compilerConstants", string.Join("\n", options.CompilerConstants));
            WriteOption("minorVersion", options.MinorVersion);

            WriteNamespaces(options);

            WriteEndElement();
        }
        private void AddCompilerConstants(MxmlcOptions options, bool debugMode)
        {
            WriteDefine("CONFIG::debug", debugMode ? "true" : "false");
            WriteDefine("CONFIG::release", debugMode ? "false" : "true");
            WriteDefine("CONFIG::timeStamp", "'" + DateTime.Now.ToString("d") + "'");
            var isMobile = project.MovieOptions.Platform == "AIR Mobile";
            var isDesktop = project.MovieOptions.Platform == "AIR";
            WriteDefine("CONFIG::air", isMobile || isDesktop ? "true" : "false");
            WriteDefine("CONFIG::mobile", isMobile ? "true" : "false");
            WriteDefine("CONFIG::desktop", isDesktop ? "true" : "false");

            if (options.CompilerConstants != null)
            {
                foreach (string define in options.CompilerConstants)
                {
                    int p = define.IndexOf(',');
                    if (p < 0) continue;
                    WriteDefine(define.Substring(0, p), define.Substring(p + 1));
                }
            }
        }
Ejemplo n.º 8
0
        void WriteNamespaces(MxmlcOptions options)
        {
            if (options.Namespaces == null || options.Namespaces.Length == 0) return;
            var namespaces = new StringBuilder();
            foreach (var ns in options.Namespaces)
            {
                if (string.IsNullOrEmpty(ns.Uri) || string.IsNullOrEmpty(ns.Manifest)) continue;

                string relPath = project.GetRelativePath(ns.Manifest);

                namespaces.Append(ns.Uri).Append('\n').Append(relPath).Append('\n');
            }

            if (namespaces.Length == 0) return;
            
            namespaces.Remove(namespaces.Length - 1, 1);

            WriteOption("namespaces", namespaces.ToString());
        }
        private void AddCompilerOptions(MxmlcOptions options, bool debugMode)
        {
            if (options.Locale.Length > 0)
            {
                WriteStartElement("locale");
                    WriteElementString("locale-element", options.Locale);
                WriteEndElement();
            }
            if (options.Accessible) WriteElementString("accessible", "true");
            if (options.AllowSourcePathOverlap) WriteElementString("allow-source-path-overlap", "true");
            if (options.ES)
            {
                WriteElementString("es", "true");
                WriteElementString("as3", "false");
            }
            if (!options.Strict) WriteElementString("strict", "false");
            if (!options.ShowActionScriptWarnings) WriteElementString("show-actionscript-warnings", "false");
            if (!options.ShowBindingWarnings) WriteElementString("show-binding-warnings", "false");
            if (!options.ShowInvalidCSS) WriteElementString("show-invalid-css-property-warnings", "false");
            if (!options.ShowDeprecationWarnings) WriteElementString("show-deprecation-warnings", "false");
            if (!options.ShowUnusedTypeSelectorWarnings) WriteElementString("show-unused-type-selector-warnings", "false");
            if (!options.UseResourceBundleMetadata) WriteElementString("use-resource-bundle-metadata", "false");

            if (!debugMode && options.Optimize) WriteElementString("optimize", "true");
            if (!debugMode && flex4) WriteElementString("omit-trace-statements", options.OmitTraces ? "true" : "false");
            if (debugMode) WriteElementString("verbose-stacktraces", "true");
            else WriteElementString("verbose-stacktraces", options.VerboseStackTraces ? "true" : "false");
        }
        private void AddNamespaces(MxmlcOptions options)
        {
            if (options.Namespaces == null || options.Namespaces.Length == 0) return;

            WriteStartElement("namespaces");

            foreach (var ns in options.Namespaces)
            {
                string path = ns.Manifest.Trim();
                string uri = ns.Uri.Trim();
                if (path.Length == 0 || uri.Length == 0) continue;
                path = project.GetAbsolutePath(path);
                if (!File.Exists(path)) continue;

                WriteStartElement("namespace");

                WriteElementString("uri", uri);
                WriteElementString("manifest", path);

                WriteEndElement();
            }

            WriteEndElement();
        }
        private void AddTargetPlayer(MxmlcOptions options)
        {
            int majorVersion = project.MovieOptions.MajorVersion;
            int minorVersion = project.MovieOptions.MinorVersion;
            string version;
            if (options.MinorVersion.Length > 0)
                version = majorVersion + "." + options.MinorVersion;
            else
                version = majorVersion + "." + minorVersion;

            string platform = project.MovieOptions.Platform;
            if (platform != PluginCore.PlatformData.FLASHPLAYER_PLATFORM
                    && project.MovieOptions.HasPlatformSupport && project.MovieOptions.PlatformSupport.IsFlashPlatform)
                version = PluginCore.PlatformData.ResolveFlashPlayerVersion(project.Language, platform, version);

            WriteElementString("target-player", version);
        }
Ejemplo n.º 12
0
        private void AddTargetPlayer(MxmlcOptions options)
        {
            int majorVersion = project.MovieOptions.MajorVersion;
            int minorVersion = project.MovieOptions.MinorVersion;
            if (project.MovieOptions.Platform == AS3MovieOptions.AIR_PLATFORM
                || project.MovieOptions.Platform == AS3MovieOptions.AIR_MOBILE_PLATFORM)
                AS3Project.GuessFlashPlayerForAIR(ref majorVersion, ref minorVersion);

            string version;
            if (options.MinorVersion.Length > 0)
                version = majorVersion + "." + options.MinorVersion;
            else
                version = majorVersion + "." + minorVersion;

            WriteElementString("target-player", version);
        }