NAnt.DotNet.Tasks.CscTask.WriteOptions C# (CSharp) Method

WriteOptions() protected method

Writes the compiler options to the specified TextWriter.
protected WriteOptions ( TextWriter writer ) : void
writer System.IO.TextWriter to which the compiler options should be written.
return void
        protected override void WriteOptions(TextWriter writer)
        {
            // causes the compiler to specify the full path of the file in which
            // an error was found
            WriteOption(writer, "fullpaths");

            // the base address for the DLL
            if (BaseAddress != null) {
                WriteOption(writer, "baseaddress", BaseAddress);
            }

            // XML documentation
            if (DocFile != null) {
                if (SupportsDocGeneration) {
                    WriteOption(writer, "doc", DocFile.FullName);
                } else {
                    Log(Level.Warning, ResourceUtils.GetString("String_CompilerDoesNotSupportXmlDoc"),
                        Project.TargetFramework.Description);
                }
            }

            // langversion
            if (LangVersion != null) {
                if (SupportsLangVersion) {
                    WriteOption(writer, "langversion", LangVersion);
                } else {
                    Log(Level.Warning, ResourceUtils.GetString("String_CompilerDoesNotSupportLangVersion"),
                        Project.TargetFramework.Description);
                }
            }

            // platform
            if (Platform != null) {
                if (SupportsPlatform) {
                    WriteOption(writer, "platform", Platform);
                } else {
                    Log(Level.Warning, ResourceUtils.GetString("String_CompilerDoesNotSupportPlatform"),
                        Project.TargetFramework.Description);
                }
            }

            // win32res
            if (Win32Res != null) {
                WriteOption (writer, "win32res", Win32Res.FullName);
            }

            // handle debug builds.
            switch (DebugOutput) {
                case DebugOutput.None:
                    break;
                case DebugOutput.Enable:
                    WriteOption(writer, "debug");
                    WriteOption(writer, "define", "DEBUG");
                    WriteOption(writer, "define", "TRACE");
                    break;
                case DebugOutput.Full:
                    WriteOption(writer, "debug");
                    break;
                case DebugOutput.PdbOnly:
                    WriteOption(writer, "debug", "pdbonly");
                    break;
                default:
                    throw new BuildException(string.Format(CultureInfo.InvariantCulture,
                        ResourceUtils.GetString("NA2011"), DebugOutput), Location);
            }

            if (FileAlign > 0) {
                WriteOption(writer, "filealign", FileAlign.ToString(CultureInfo.InvariantCulture));
            }

            if (NoStdLib) {
                WriteOption(writer, "nostdlib");
            }

            if (Checked) {
                WriteOption(writer, "checked");
            }

            if (Unsafe) {
                WriteOption(writer, "unsafe");
            }

            if (Optimize) {
                WriteOption(writer, "optimize");
            }

            if (WarningLevel != null) {
                WriteOption(writer, "warn", WarningLevel);
            }

            if (Codepage != null) {
                WriteOption(writer, "codepage", Codepage);
            }

            if (NoConfig && !Arguments.Contains("/noconfig")) {
                Arguments.Add(new Argument("/noconfig"));
            }
        }