Exemplo n.º 1
0
 public Configuration ParseGlobal()
 {
     var config = new Configuration();
     if (!File.Exists(_configFile))
         return config;
     return getConfig(_configFile, false);
 }
 public ConfigurationFormWriter(bool isLocal, Configuration configuration, IMSBuildLocator locator)
 {
     _isLocal = isLocal;
     Configuration = configuration;
     _locator = locator;
     _atReadTimeIgnoreFileExisted = configuration.IgnoreFile.Exists && configuration.IgnoreFile.Item.File.Trim().Length > 0;
 }
Exemplo n.º 3
0
 public Configuration ParseLocal()
 {
     var file = getLocalConfig();
     var config = new Configuration();
     config.ConfigurationFullpath = file;
     config.SolutionPath = _localPath;
     if (!_hasLocalConfig)
         return config;
     return getConfig(file, true);
 }
Exemplo n.º 4
0
        public string Transform(Configuration config)
        {
            if (config.ConfigurationFullpath == null)
                return "";
            _document = new XmlDocument();
            LoadXml(config);
            WriteStringSetting(config.GraphProvider, "mm-GraphProvider");
            WriteBoolSetting(config.MinimizerDebug, "mm-MinimizerDebug");
            writeStringListSetting(config.MinimizerAssemblies, "mm-MinimizerAssemblies", "Assembly");
            WriteStringSetting(config.MinimizerLevel, "mm-MinimizerLevel");
            WriteStringSetting(config.ProfilerSetup, "mm-ProfilerSetup");
            writeStringListSetting(config.ProfilerNamespaces, "mm-ProfilerNamespaces", "Namespace");
            WriteBoolSetting(config.IgnoreWarmup, "mm-IgnoreWarmup");
            WriteStringSetting(config.IgnoreThisUpgrade, "mm-IgnoreThisUpgrade");
            WriteBoolSetting(config.RealtimeFeedback, "mm-RealtimeFeedback");
            WriteBoolSetting(config.OverlayNotifications, "mm-OverlayNotifications");
            WriteBoolSetting(config.RiscEnabled, "mm-RiscEnabled");
            WriteBoolSetting(config.AllDisabled, "mm-AllDisabled");
            WriteBoolSetting(config.AnonFeedback, "mm-AnonFeedback");

            WriteBoolSetting(config.BuildErrorsInFeedbackWindow, "mm-BuildErrorsInFeedbackWindow");
            WriteBoolSetting(config.BuildWarningsInFeedbackWindow, "mm-BuildWarningsInFeedbackWindow");
            WriteBoolSetting(config.FailingTestsInFeedbackWindow, "mm-FailingTestsInFeedbackWindow");
            WriteBoolSetting(config.IgnoredTestsInFeedbackWindow, "mm-IgnoredTestsInFeedbackWindow");

            WriteBoolSetting(config.StartPaused, "StartPaused");
            writeVersionedSetting(config.MSBuild, "BuildExecutable");
            WriteBoolSetting(config.BuildSolution, "WhenWatchingSolutionBuildSolution");
            writeVersionedSetting(config.NUnit, "NUnitTestRunner");
            writeVersionedSetting(config.MSTest, "MSTestRunner");
            writeVersionedSetting(config.XUnit, "XUnitTestRunner");
            writeIgnoreFileSetting(config.IgnoreFile);
            writeStringListSetting(config.IgnoredAssemblies, "ShouldIgnoreTestAssembly", "Assembly");
            writeStringListSetting(config.IgnoredCategories, "ShouldIgnoreTestCategories", "Category");
            WriteStringSetting(config.ChangeDelay, "changedetectiondelay");
            WriteStringSetting(config.BuildOutputPath, "CustomOutput");
            WriteStringSetting(config.GrowlNotifyPath, "growlnotify");
            WriteBoolSetting(config.NotifyOnStartup, "notify_on_run_started");
            WriteBoolSetting(config.NotifyOnFinish, "notify_on_run_completed");
            WriteBoolSetting(config.Debug, "Debugging");
            WriteBoolSetting(config.RunAssembliesInParallel, "RunAssembliesInParallel");
            WriteBoolSetting(config.RunTestsInCompatibilityMode, "TestRunnerCompatibilityMode");
            WriteIntSetting(config.MSBuildParallelBuildCount, "MSBuildParallelBuildCount");
            return WriteXml();
        }
Exemplo n.º 5
0
 public Configuration Parse()
 {
     var config = new Configuration();
     if (!File.Exists(_configFile))
     {
         config.ConfigurationFullpath = _configFile;
         return config;
     }
     if (!OnlyGlobal && !File.Exists(getLocalConfig()))
     {
         config.ConfigurationFullpath = getLocalConfig();
         config.SolutionPath = _localPath;
         return config;
     }
     if (OnlyGlobal)
         return getConfig(_configFile, false);
     else
         return getConfig(getLocalConfig(), false);
 }
Exemplo n.º 6
0
        private Configuration getConfig(string path, bool isLocal)
        {
            var config = new Configuration();
            try
            {
                config.ConfigurationFullpath = path;
                config.SolutionPath = _localPath;
                _xml = new XmlDocument();
                _xml.Load(path);
                config.GraphProvider = getValue("configuration/mm-GraphProvider", isLocal);
                config.MinimizerDebug = getBool("configuration/mm-MinimizerDebug", isLocal);
                config.MinimizerAssemblies.AddRange(getListOfStrings("configuration/mm-MinimizerAssemblies/Assembly", isLocal));
                config.MinimizerLevel = getValue("configuration/mm-MinimizerLevel", isLocal);
                config.ProfilerSetup = getValue("configuration/mm-ProfilerSetup", isLocal);
                config.ProfilerNamespaces.AddRange(getListOfStrings("configuration/mm-ProfilerNamespaces/Namespace", isLocal));
                config.IgnoreWarmup = getBool("configuration/mm-IgnoreWarmup", isLocal);
                config.IgnoreThisUpgrade = getValue("configuration/mm-IgnoreThisUpgrade", isLocal);
                config.RealtimeFeedback = getBool("configuration/mm-RealtimeFeedback", isLocal);
                config.OverlayNotifications = getBool("configuration/mm-OverlayNotifications", isLocal, false);
                config.AllDisabled = getBool("configuration/mm-AllDisabled", isLocal, false);
                config.AnonFeedback = getBool("configuration/mm-AnonFeedback", isLocal, true);

                config.BuildErrorsInFeedbackWindow = getBool("configuration/mm-BuildErrorsInFeedbackWindow", isLocal, true);
                config.BuildWarningsInFeedbackWindow = getBool("configuration/mm-BuildWarningsInFeedbackWindow", isLocal, true);
                config.FailingTestsInFeedbackWindow = getBool("configuration/mm-FailingTestsInFeedbackWindow", isLocal, true);
                config.IgnoredTestsInFeedbackWindow = getBool("configuration/mm-IgnoredTestsInFeedbackWindow", isLocal, true);

                config.StartPaused = getBool("configuration/StartPaused", isLocal);
                config.MSBuild.AddRange(GetVersionedSetting("configuration/BuildExecutable", isLocal));
                config.BuildSolution = getBool("configuration/WhenWatchingSolutionBuildSolution", isLocal);
                config.NUnit.AddRange(GetVersionedSetting("configuration/NUnitTestRunner", isLocal));
                config.MSTest.AddRange(GetVersionedSetting("configuration/MSTestRunner", isLocal));
                config.XUnit.AddRange(GetVersionedSetting("configuration/XUnitTestRunner", isLocal));
                config.IgnoreFile = getIgnoreFile(isLocal);
                config.IgnoredAssemblies.AddRange(getListOfStrings("configuration/ShouldIgnoreTestAssembly/Assembly", isLocal));
                config.IgnoredCategories.AddRange(getListOfStrings("configuration/ShouldIgnoreTestCategories/Category", isLocal));
                config.ChangeDelay = getValue("configuration/changedetectiondelay", isLocal);
                config.BuildOutputPath = getValue("configuration/CustomOutput", isLocal);
                config.GrowlNotifyPath = getValue("configuration/growlnotify", isLocal);
                config.GrowlNotifyPath = getValue("configuration/growlnotify", isLocal);
                config.NotifyOnStartup = getBool("configuration/notify_on_run_started", isLocal);
                config.NotifyOnFinish = getBool("configuration/notify_on_run_completed", isLocal);
                config.Debug = getBool("configuration/Debugging", isLocal);
                config.CatMode = getBool("configuration/MMFTW", isLocal, false);
                config.RunAssembliesInParallel = getBool("configuration/RunAssembliesInParallel", isLocal, false);
                config.RunTestsInCompatibilityMode = getBool("configuration/TestRunnerCompatibilityMode", isLocal, false);
                config.RiscEnabled = getBool("configuration/mm-RiscEnabled", isLocal, true);
                config.MSBuildParallelBuildCount = getInt("configuration/MSBuildParallelBuildCount", isLocal, 0);
                return config;
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
            }
            config = new Configuration {ConfigurationFullpath = path, SolutionPath = _localPath};
            return config;
        }
Exemplo n.º 7
0
 private void LoadXml(Configuration config)
 {
     try
     {
         _document.Load(config.ConfigurationFullpath);
     }
     catch
     {
         _document = new XmlDocument();
         var element = _document.CreateElement("configuration");
         _document.AppendChild(element);
     }
 }