Exemplo n.º 1
0
        public void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            var gitDirectory = GitDirFinder.TreeWalkForGitDir(SolutionDirectory);

            if (string.IsNullOrEmpty(gitDirectory))
            {
                return;
            }

            var configuration = ConfigurationProvider.Provide(gitDirectory, fileSystem);

            if (!string.IsNullOrEmpty(AssemblyVersioningScheme))
            {
                AssemblyVersioningScheme versioningScheme;
                if (Enum.TryParse(AssemblyVersioningScheme, true, out versioningScheme))
                {
                    configuration.AssemblyVersioningScheme = versioningScheme;
                }
                else
                {
                    throw new WarningException(string.Format("Unexpected assembly versioning scheme '{0}'.", AssemblyVersioningScheme));
                }
            }

            // TODO This should be covered by tests
            // TODO would be good to not have to duplicate this in both msbuild tasks
            // Null is intentional. Empty string means the user has set the value to an empty string and wants to clear the tag
            if (DevelopBranchTag != null)
            {
                configuration.DevelopBranchTag = DevelopBranchTag;
            }

            if (ReleaseBranchTag != null)
            {
                configuration.ReleaseBranchTag = ReleaseBranchTag;
            }

            if (TagPrefix != null)
            {
                configuration.TagPrefix = TagPrefix;
            }

            if (NextVersion != null)
            {
                configuration.NextVersion = NextVersion;
            }

            CachedVersion semanticVersion;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out semanticVersion, configuration))
            {
                return;
            }
            CreateTempAssemblyInfo(semanticVersion, configuration);
        }
Exemplo n.º 2
0
        private static Output InnerExecute(Input input, TaskLogger logger)
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(input.CompileFiles, input.ProjectFile);

            if (!GitVersionTaskUtils.GetVersionVariables(input, out var versionVariables))
            {
                return(null);
            }

            return(CreateTempAssemblyInfo(input, versionVariables));
        }
Exemplo n.º 3
0
        protected override void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            if (GetVersionVariables(out var versionVariables))
            {
                return;
            }

            CreateTempAssemblyInfo(versionVariables);
        }
Exemplo n.º 4
0
        public void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            VersionVariables versionVariables;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out versionVariables, NoFetch, new Authentication(), fileSystem))
            {
                return;
            }
            CreateTempAssemblyInfo(versionVariables);
        }
Exemplo n.º 5
0
        private static Output InnerExecute(Input input, TaskLogger logger)
        {
            var execute = GitVersionTaskCommonFunctionality.CreateExecuteCore();

            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(input.CompileFiles, input.ProjectFile);

            if (!execute.TryGetVersion(input.SolutionDirectory, out var versionVariables, input.NoFetch, new Authentication()))
            {
                return(null);
            }

            return(CreateTempAssemblyInfo(input, versionVariables));
        }
        public void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            VersionAndBranchAndDate versionAndBranch;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out versionAndBranch))
            {
                return;
            }

            CreateTempAssemblyInfo(versionAndBranch);
        }
Exemplo n.º 7
0
        void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            VersionVariables versionVariables;

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

            CreateTempHeaderFile(versionVariables);
        }
        public void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            CachedVersion semanticVersion;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out semanticVersion))
            {
                return;
            }

            CreateTempAssemblyInfo(semanticVersion);
        }
Exemplo n.º 9
0
        public void InnerExecute()
        {
            var avs = ParseAssemblyVersioningScheme(AssemblyVersioningScheme);

            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            SemanticVersion semanticVersion;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out semanticVersion))
            {
                return;
            }

            CreateTempAssemblyInfo(semanticVersion, avs);
        }
Exemplo n.º 10
0
        public void InnerExecute()
        {
            TempFileTracker.DeleteTempFiles();

            InvalidFileChecker.CheckForInvalidFiles(CompileFiles, ProjectFile);

            var gitDirectory = GitDirFinder.TreeWalkForGitDir(SolutionDirectory);

            if (string.IsNullOrEmpty(gitDirectory))
            {
                return;
            }

            var configuration = ConfigurationProvider.Provide(gitDirectory, fileSystem);

            Tuple <CachedVersion, GitVersionContext> semanticVersion;

            if (!VersionAndBranchFinder.TryGetVersion(SolutionDirectory, out semanticVersion, configuration))
            {
                return;
            }
            CreateTempAssemblyInfo(semanticVersion.Item1, semanticVersion.Item2.Configuration);
        }