Example #1
0
        public static CommonCompilerOptionsCommandLine AddOptions(CommandLineApplication app)
        {
            CommonCompilerOptionsCommandLine commandLineOptions = new CommonCompilerOptionsCommandLine();

            commandLineOptions.DefineOption =
                AddOption(app, DefineOptionName, "Preprocessor definitions", CommandOptionType.MultipleValue);

            commandLineOptions.SuppressWarningOption =
                AddOption(app, SuppressWarningOptionName, "Suppresses the specified warning", CommandOptionType.MultipleValue);

            commandLineOptions.LanguageVersionOption =
                AddOption(app, LanguageVersionOptionName, "The version of the language used to compile", CommandOptionType.SingleValue);

            commandLineOptions.PlatformOption =
                AddOption(app, PlatformOptionName, "The target platform", CommandOptionType.SingleValue);

            /* // The following is not available in VBC.
             * commandLineOptions.AllowUnsafeOption =
             *  AddOption(app, AllowUnsafeOptionName, "Allow unsafe code", CommandOptionType.BoolValue);
             */

            commandLineOptions.WarningsAsErrorsOption =
                AddOption(app, WarningsAsErrorsOptionName, "Turn all warnings into errors", CommandOptionType.BoolValue);

            commandLineOptions.OptimizeOption =
                AddOption(app, OptimizeOptionName, "Enable compiler optimizations", CommandOptionType.BoolValue);

            commandLineOptions.KeyFileOption =
                AddOption(app, KeyFileOptionName, "Path to file containing the key to strong-name sign the output assembly", CommandOptionType.SingleValue);

            commandLineOptions.DelaySignOption =
                AddOption(app, DelaySignOptionName, "Delay-sign the output assembly", CommandOptionType.BoolValue);

            commandLineOptions.PublicSignOption =
                AddOption(app, PublicSignOptionName, "Public-sign the output assembly", CommandOptionType.BoolValue);

            commandLineOptions.DebugTypeOption =
                AddOption(app, DebugTypeOptionName, "The type of PDB to emit: portable or full", CommandOptionType.SingleValue);

            commandLineOptions.EmitEntryPointOption =
                AddOption(app, EmitEntryPointOptionName, "Output an executable console program", CommandOptionType.BoolValue);

            commandLineOptions.GenerateXmlDocumentationOption =
                AddOption(app, GenerateXmlDocumentationOptionName, "Generate XML documentation file", CommandOptionType.BoolValue);

            commandLineOptions.AdditionalArgumentsOption =
                AddOption(app, AdditionalArgumentsOptionName, "Pass the additional argument directly to the compiler", CommandOptionType.MultipleValue);

            commandLineOptions.OutputNameOption =
                AddOption(app, OutputNameOptionName, "Output assembly name", CommandOptionType.SingleValue);

            return(commandLineOptions);
        }
        public static CommonCompilerOptionsCommandLine AddOptions(CommandLineApplication app)
        {
            CommonCompilerOptionsCommandLine commandLineOptions = new CommonCompilerOptionsCommandLine();

            commandLineOptions.DefineOption =
                AddOption(app, DefineOptionName, "Preprocessor definitions", CommandOptionType.MultipleValue);

            commandLineOptions.SuppressWarningOption =
                AddOption(app, SuppressWarningOptionName, "Suppresses the specified warning", CommandOptionType.MultipleValue);

            commandLineOptions.LanguageVersionOption =
                AddOption(app, LanguageVersionOptionName, "The version of the language used to compile", CommandOptionType.SingleValue);

            commandLineOptions.PlatformOption =
                AddOption(app, PlatformOptionName, "The target platform", CommandOptionType.SingleValue);

            commandLineOptions.AllowUnsafeOption =
                AddOption(app, AllowUnsafeOptionName, "Allow unsafe code", CommandOptionType.BoolValue);

            commandLineOptions.WarningsAsErrorsOption =
                AddOption(app, WarningsAsErrorsOptionName, "Turn all warnings into errors", CommandOptionType.BoolValue);

            commandLineOptions.OptimizeOption =
                AddOption(app, OptimizeOptionName, "Enable compiler optimizations", CommandOptionType.BoolValue);

            commandLineOptions.KeyFileOption =
                AddOption(app, KeyFileOptionName, "Path to file containing the key to strong-name sign the output assembly", CommandOptionType.SingleValue);

            commandLineOptions.DelaySignOption =
                AddOption(app, DelaySignOptionName, "Delay-sign the output assembly", CommandOptionType.BoolValue);

            commandLineOptions.PublicSignOption =
                AddOption(app, PublicSignOptionName, "Public-sign the output assembly", CommandOptionType.BoolValue);

            commandLineOptions.DebugTypeOption =
                AddOption(app, DebugTypeOptionName, "The type of PDB to emit: portable or full", CommandOptionType.SingleValue);

            commandLineOptions.EmitEntryPointOption =
                AddOption(app, EmitEntryPointOptionName, "Output an executable console program", CommandOptionType.BoolValue);

            commandLineOptions.GenerateXmlDocumentationOption =
                AddOption(app, GenerateXmlDocumentationOptionName, "Generate XML documentation file", CommandOptionType.BoolValue);

            commandLineOptions.AdditionalArgumentsOption =
                AddOption(app, AdditionalArgumentsOptionName, "Pass the additional argument directly to the compiler", CommandOptionType.MultipleValue);

            commandLineOptions.OutputNameOption =
                AddOption(app, OutputNameOptionName, "Output assembly name", CommandOptionType.SingleValue);

            return commandLineOptions;
        }