private static void UpdateAssemblyVersions(InsertionArtifacts artifacts)
        {
            var versionsUpdater = new VersionsUpdater(GetAbsolutePathForEnlistment(), WarningMessages);

            foreach (var nameAndVersion in ReadAssemblyVersions(artifacts.GetDependentAssemblyVersionsFile()))
            {
                versionsUpdater.UpdateComponentVersion(nameAndVersion.Key, nameAndVersion.Value);
            }

            versionsUpdater.Save();
        }
Пример #2
0
        private static async Task <GitChange> UpdateAssemblyVersionsOpt(GitHttpClient gitClient, string commitId, InsertionArtifacts artifacts)
        {
            var versionsUpdater = await VersionsUpdater.Create(gitClient, commitId, WarningMessages);

            var pathToDependentAssemblyVersionsFile = artifacts.GetDependentAssemblyVersionsFile();

            if (File.Exists(pathToDependentAssemblyVersionsFile))
            {
                foreach (var nameAndVersion in ReadAssemblyVersions(pathToDependentAssemblyVersionsFile))
                {
                    versionsUpdater.UpdateComponentVersion(nameAndVersion.Key, nameAndVersion.Value);
                }
            }
            else
            {
                Console.WriteLine($"No dependent-assembly-versions file found at path '{pathToDependentAssemblyVersionsFile}'");
            }

            return(versionsUpdater.GetChangeOpt());
        }
        private static void UpdateAssemblyVersions(InsertionArtifacts artifacts)
        {
            var versionsUpdater = new VersionsUpdater(GetAbsolutePathForEnlistment(), WarningMessages);

            var pathToDependentAssemblyVersionsFile = artifacts.GetDependentAssemblyVersionsFile();

            if (File.Exists(pathToDependentAssemblyVersionsFile))
            {
                foreach (var nameAndVersion in ReadAssemblyVersions(pathToDependentAssemblyVersionsFile))
                {
                    versionsUpdater.UpdateComponentVersion(nameAndVersion.Key, nameAndVersion.Value);
                }
            }
            else
            {
                Console.WriteLine($"No dependent-assembly-versions file found at path '{pathToDependentAssemblyVersionsFile}'");
            }

            versionsUpdater.Save();
        }