Beispiel #1
0
        public static void UpdateAssemblyInfo(this ICakeContext context, VersionVariables variables, DirectoryPath workingDirectory, string assemblyInfoFile = "SolutionInfo.cs")
        {
            #region Arguments check (DupFinder Exclusion)
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (variables == null)
            {
                throw new ArgumentNullException(nameof(variables));
            }
            if (workingDirectory == null)
            {
                throw new ArgumentNullException(nameof(workingDirectory));
            }
            if (assemblyInfoFile == null)
            {
                throw new ArgumentNullException(nameof(assemblyInfoFile));
            }
            #endregion

            var fileSystem = new VCSVersion.Helpers.FileSystem();

            using (context.AddLoggers())
                using (var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(assemblyInfoFile, workingDirectory.FullPath, variables, fileSystem, true))
                {
                    assemblyInfoFileUpdater.Update();
                    assemblyInfoFileUpdater.CommitChanges();
                }
        }
Beispiel #2
0
        public static void UpdateAssemblyInfo(this ICakeContext context, VersionVariables variables, DirectoryPath workingDirectory)
        {
            var assemblyInfoFile = "SolutionInfo.cs";
            var fileSystem       = new VCSVersion.Helpers.FileSystem();

            using (context.AddLoggers())
                using (var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(assemblyInfoFile, workingDirectory.FullPath, variables, fileSystem, true))
                {
                    assemblyInfoFileUpdater.Update();
                    assemblyInfoFileUpdater.CommitChanges();
                }
        }