示例#1
0
        public override bool Execute()
        {
            try
            {
                VersionVariables variables;

                if (ExecuteCore.TryGetVersion(SolutionDirectory, out variables, NoFetch, new Authentication()))
                {
                    var thisType = typeof(GetVersion);
                    foreach (var variable in variables)
                    {
                        thisType.GetProperty(variable.Key).SetValue(this, variable.Value, null);
                    }
                }
                return(true);
            }
            catch (WarningException errorException)
            {
                logger.LogWarning(errorException.Message);
                return(true);
            }
            catch (Exception exception)
            {
                logger.LogError("Error occurred: " + exception);
                return(false);
            }
            finally
            {
                Logger.Reset();
            }
        }
示例#2
0
        void InnerExecute()
        {
            VersionVariables versionVariables;

            if (!ExecuteCore.TryGetVersion(SolutionDirectory, out versionVariables, NoFetch, new Authentication()))
            {
                return;
            }

            var fileExtension = GetFileExtension();
            var fileName      = $"GitVersionInformation.g.{fileExtension}";

            if (IntermediateOutputPath == null)
            {
                fileName = $"GitVersionInformation_{Path.GetFileNameWithoutExtension(ProjectFile)}_{Path.GetRandomFileName()}.g.{fileExtension}";
            }

            var workingDirectory = IntermediateOutputPath ?? TempFileTracker.TempPath;

            GitVersionInformationFilePath = Path.Combine(workingDirectory, fileName);

            var generator = new GitVersionInformationGenerator(fileName, workingDirectory, versionVariables, new FileSystem());

            generator.Generate();
        }
        void InnerExecute()
        {
            VersionVariables result;

            if (!ExecuteCore.TryGetVersion(SolutionDirectory, out result, NoFetch, new Authentication()))
            {
                return;
            }

            WriteIntegrationParameters(BuildServerList.GetApplicableBuildServers(), result);
        }
示例#4
0
        void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            VersionVariables versionVariables;

            if (!ExecuteCore.TryGetVersion(SolutionDirectory, out versionVariables, NoFetch, new Authentication()))
            {
                return;
            }
            CreateTempAssemblyInfo(versionVariables);
        }
示例#5
0
 protected bool GetVersionVariables(out VersionVariables versionVariables)
 {
     return(!ExecuteCore.TryGetVersion(SolutionDirectory, out versionVariables, NoFetch, new Authentication()));
 }