Ejemplo n.º 1
0
        private int RunGitVersionTool(GitVersionOptions gitVersionOptions)
        {
            try
            {
                var variables = gitVersionTool.CalculateVersionVariables();

                gitVersionTool.OutputVariables(variables);
                gitVersionTool.UpdateAssemblyInfo(variables);
                gitVersionTool.UpdateWixVersionFile(variables);

                execCommand.Execute(variables);
            }
            catch (WarningException exception)
            {
                var error = $"An error occurred:{System.Environment.NewLine}{exception.Message}";
                log.Warning(error);
                return(1);
            }
            catch (Exception exception)
            {
                var error = $"An unexpected error occurred:{System.Environment.NewLine}{exception}";
                log.Error(error);

                if (gitVersionOptions == null)
                {
                    return(1);
                }

                log.Info("Attempting to show the current git graph (please include in issue): ");
                log.Info("Showing max of 100 commits");

                try
                {
                    LibGitExtensions.DumpGraph(gitVersionOptions.WorkingDirectory, mess => log.Info(mess), 100);
                }
                catch (Exception dumpGraphException)
                {
                    log.Error("Couldn't dump the git graph due to the following error: " + dumpGraphException);
                }
                return(1);
            }

            return(0);
        }
 public void WriteVersionInfoToBuildLog(WriteVersionInfoToBuildLog task)
 {
     gitVersionTool.OutputVariables(versionVariables, m => task.Log.LogMessage(m));
 }
Ejemplo n.º 3
0
 public void WriteVersionInfoToBuildLog(WriteVersionInfoToBuildLog task)
 {
     gitVersionTool.OutputVariables(versionVariables);
 }