public override void Reset()
        {
            var versioningStyle = VersioningStyle.GetDefaultGlobalVariable();

            VersioningStyle.FromGlobalVariable(versioningStyle);
            AutoUpdateAssemblyVersion = false;
            AutoUpdateFileVersion     = false;
            BuildAction          = BuildActionType.Both;
            StartDate            = new DateTime(2000, 1, 1);
            ReplaceNonNumerics   = true;
            IncrementBeforeBuild = true;
            AssemblyInfoFilename = String.Empty;
            ConfigurationName    = "Any";
            UseGlobalSettings    = false;
            IsUniversalTime      = false;
            DetectChanges        = true;
        }
Beispiel #2
0
        public override void Reset()
        {
            AutoUpdateAssemblyVersion = false;
            AutoUpdateFileVersion     = false;

            BuildAction = BuildActionType.Both;

            var versioningStyle = VersioningStyle.GetDefaultGlobalVariable();

            VersioningStyle.FromGlobalVariable(versioningStyle);

            IsUniversalTime      = false;
            StartDate            = new DateTime(2000, 1, 1);
            ReplaceNonNumerics   = true;
            IncrementBeforeBuild = true;
            DetectChanges        = true;

            Apply = ApplyGlobalSettings.OnlyWhenChosen;
        }
Beispiel #3
0
        public override void Load()
        {
            var vs = new VersioningStyle();

            vs.FromGlobalVariable(
                $"{Settings.Default.GlobalMajor}.{Settings.Default.GlobalMinor}.{Settings.Default.GlobalBuild}.{Settings.Default.GlobalRevision}");
            VersioningStyle = vs;

            BuildAction =
                (BuildActionType)Enum.Parse(typeof(BuildActionType), Settings.Default.GlobalBuildAction);
            AutoUpdateAssemblyVersion = Settings.Default.GlobalAutoUpdateAssemblyVersion;
            AutoUpdateFileVersion     = Settings.Default.GlobalAutoUpdateFileVersion;
            ReplaceNonNumerics        = Settings.Default.GlobalReplaceNonNumeric;
            IsUniversalTime           = Settings.Default.GlobalUseUniversalClock;
            IncrementBeforeBuild      = Settings.Default.GlobalIncrementBeforeBuild;
            StartDate     = Settings.Default.GlobalStartDate;
            DetectChanges = Settings.Default.DetectChanges;
            Apply         =
                (ApplyGlobalSettings)Enum.Parse(typeof(ApplyGlobalSettings), Settings.Default.GlobalApply);
        }
 public override void Load()
 {
     try
     {
         var versioningStyle = GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                                 Resources
                                                                 .GlobalVarName_buildVersioningStyle,
                                                                 VersioningStyle.GetDefaultGlobalVariable
                                                                     ());
         VersioningStyle.FromGlobalVariable(versioningStyle);
         AutoUpdateAssemblyVersion =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_updateAssemblyVersion,
                                                          "false"));
         AutoUpdateFileVersion =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_updateFileVersion,
                                                          "false"));
         try
         {
             BuildAction =
                 (BuildActionType)
                 Enum.Parse(typeof(BuildActionType),
                            GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                              Resources.GlobalVarName_buildAction,
                                                              "Both"));
         }
         catch (ArgumentException)
         {
             BuildAction = BuildActionType.Both;
         }
         StartDate =
             DateTime.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                              Resources.GlobalVarName_startDate,
                                                              "2000/01/01"));
         ReplaceNonNumerics =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_replaceNonNumerics,
                                                          "true"));
         IncrementBeforeBuild =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_incrementBeforeBuild,
                                                          "true"));
         AssemblyInfoFilename = GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                                  Resources
                                                                  .GlobalVarName_assemblyInfoFilename,
                                                                  "");
         ConfigurationName = GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                               Resources.GlobalVarName_configurationName,
                                                               "Any");
         UseGlobalSettings =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_useGlobalSettings,
                                                          (GlobalIncrementSettings.ApplySettings
                                                           == GlobalIncrementSettings.ApplyGlobalSettings
                                                           .AsDefault).ToString()));
         IsUniversalTime =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_useUniversalClock,
                                                          "false"));
         DetectChanges =
             bool.Parse(GlobalVariables.GetGlobalVariable(SolutionItem.Globals,
                                                          Resources.GlobalVarName_detectChanges,
                                                          "true"));
     }
     catch (Exception ex)
     {
         Logger.Write(
             $"Error occured while reading BuildVersionIncrement settings from \"{SolutionItem.Filename}\"\n{ex}",
             LogLevel.Error);
     }
 }