Esempio n. 1
0
        public override object GetValue(MemberInfo member, object instance)
        {
            var version = NerdbankGitVersioningTasks.NerdbankGitVersioningGetVersion(s => s
                                                                                     .DisableProcessLogOutput()
                                                                                     .SetFormat(NerdbankGitVersioningFormat.json))
                          .Result;

            if (UpdateBuildNumber)
            {
                AzurePipelines.Instance?.UpdateBuildNumber(version.SemVer2);
                TeamCity.Instance?.SetBuildNumber(version.SemVer2);
                AppVeyor.Instance?.UpdateBuildVersion($"{version.SemVer2}.build.{AppVeyor.Instance.BuildNumber}");
            }

            return(version);
        }
 public override object GetValue(MemberInfo member, object instance)
 {
     try
     {
         var version = NerdbankGitVersioningTasks.NerdbankGitVersioningGetVersion(s => s
                                                                                  .SetProcessWorkingDirectory(NukeBuild.RootDirectory)
                                                                                  .SetProject(Project)
                                                                                  .DisableProcessLogOutput()
                                                                                  .SetFormat(NerdbankGitVersioningFormat.Json))
                       .Result;
         if (UpdateBuildNumber)
         {
             AzurePipelines.Instance?.UpdateBuildNumber(version.SemVer2);
             TeamCity.Instance?.SetBuildNumber(version.SemVer2);
             AppVeyor.Instance?.UpdateBuildVersion($"{version.SemVer2}.build.{AppVeyor.Instance.BuildNumber}");
         }
         return(version);
     }
     catch (Exception)
     {
         return(null);
     }
 }