/// <summary>
        /// Get the parameters from the General option page
        /// </summary>
        /// <param name="mGeneralOptions"></param>
        /// <returns>The parameters from General option page</returns>
        private string GetGeneralParameters()
        {
            var compilerSettings = SettingsProvider.CompilerSettingsModel;
            var parameters       = new StringBuilder();

            // Get the Clang Flags list
            if (!string.IsNullOrWhiteSpace(compilerSettings.CompileFlags))
            {
                parameters.Append(GetClangFlags());
            }

            // Get the continue when errors are detected flag
            if (compilerSettings.ContinueOnError)
            {
                parameters.Append($" {ScriptConstants.kContinue}");
            }

            // Get the verbose mode flag
            if (compilerSettings.VerboseMode)
            {
                parameters.Append($" {ScriptConstants.kVerboseMode}");
            }

            // Get the projects to ignore list
            if (!string.IsNullOrWhiteSpace(compilerSettings.ProjectsToIgnore))
            {
                parameters.Append($" {ScriptConstants.kProjectsToIgnore} (''{TransformInPowerShellArray(compilerSettings.ProjectsToIgnore)}'')");
            }

            // Get the files to ignore list
            if (!string.IsNullOrWhiteSpace(compilerSettings.FilesToIgnore))
            {
                parameters.Append($" {ScriptConstants.kFilesToIgnore} (''{TransformInPowerShellArray(compilerSettings.FilesToIgnore)}'')");
            }

            // Get the selected Additional Includes type
            if (0 == string.Compare(ClangGeneralAdditionalIncludesConvertor.ToString(compilerSettings.AdditionalIncludes), ComboBoxConstants.kSystemIncludeDirectories))
            {
                parameters.Append($" {ScriptConstants.kSystemIncludeDirectories}");
            }

            if (jsonCompilationDbActive)
            {
                parameters.Append($" {ScriptConstants.kJsonCompilationDb}");
            }

            return(parameters.ToString());
        }
Beispiel #2
0
        private string GetGeneralParameters(ClangGeneralOptionsView aGeneralOptions)
        {
            string parameters = string.Empty;

            if (false == string.IsNullOrWhiteSpace(aGeneralOptions.ClangFlags))
            {
                parameters = ScriptConstants.kClangFlags;
                if (true == aGeneralOptions.TreatWarningsAsErrors)
                {
                    parameters += string.Format(" (''{0}'',''{1}'')", ScriptConstants.kTreatWarningsAsErrors, RebuildParameterList(aGeneralOptions.ClangFlags));
                }
                else
                {
                    parameters += string.Format(" (''{0}'')", RebuildParameterList(aGeneralOptions.ClangFlags));
                }
            }

            if (true == aGeneralOptions.Continue)
            {
                parameters = $"{parameters} {ScriptConstants.kContinue}";
            }

            if (true == aGeneralOptions.VerboseMode)
            {
                parameters = $"{parameters} {ScriptConstants.kVerboseMode}";
            }

            if (false == string.IsNullOrWhiteSpace(aGeneralOptions.ProjectsToIgnore))
            {
                parameters = $"{parameters} {ScriptConstants.kProjectsToIgnore} (''{RebuildParameterList(aGeneralOptions.ProjectsToIgnore)}'')";
            }

            if (false == string.IsNullOrWhiteSpace(aGeneralOptions.FilesToIgnore))
            {
                parameters = $"{parameters} {ScriptConstants.kFilesToIgnore} (''{RebuildParameterList(aGeneralOptions.FilesToIgnore)}'')";
            }

            if (0 == string.Compare(ClangGeneralAdditionalIncludesConvertor.ToString(aGeneralOptions.AdditionalIncludes), ComboBoxConstants.kSystemIncludeDirectories))
            {
                parameters = $"{parameters} {ScriptConstants.kSystemIncludeDirectories}";
            }

            return($"{parameters}");
        }
        /// <summary>
        /// Get the parameters from the General option page
        /// </summary>
        /// <param name="mGeneralOptions"></param>
        /// <returns>The parameters from General option page</returns>
        private string GetGeneralParameters()
        {
            var generalSettings = SettingsProvider.GeneralSettings;
            var parameters      = string.Empty;

            // Get the Clang Flags list
            if (!string.IsNullOrWhiteSpace(generalSettings.ClangFlags))
            {
                parameters = GetClangFlags();
            }

            // Get the continue when errors are detected flag
            if (generalSettings.Continue)
            {
                parameters += $" {ScriptConstants.kContinue}";
            }

            // Get the verbose mode flag
            if (generalSettings.VerboseMode)
            {
                parameters += $" {ScriptConstants.kVerboseMode}";
            }

            // Get the projects to ignore list
            if (!string.IsNullOrWhiteSpace(generalSettings.ProjectsToIgnore))
            {
                parameters += $" {ScriptConstants.kProjectsToIgnore} (''{TransformInPowerShellArray(generalSettings.ProjectsToIgnore)}'')";
            }

            // Get the files to ignore list
            if (!string.IsNullOrWhiteSpace(generalSettings.FilesToIgnore))
            {
                parameters += $" {ScriptConstants.kFilesToIgnore} (''{TransformInPowerShellArray(generalSettings.FilesToIgnore)}'')";
            }

            // Get the selected Additional Includes type
            if (0 == string.Compare(ClangGeneralAdditionalIncludesConvertor.ToString(generalSettings.AdditionalIncludes), ComboBoxConstants.kSystemIncludeDirectories))
            {
                parameters += $" {ScriptConstants.kSystemIncludeDirectories}";
            }

            return(parameters);
        }