/// <summary> Upgrade project reference to use new verion Accpac.Net </summary> /// <param name="title">The title of this step</param> /// <param name="accpacPropsOriginallyInSolutionFolder"> /// Boolean flag denoting if the Accpac props file originally existed /// in the Solution folder. /// If it did, we don't need to do anything because it will have been updated by the previous /// wizard step. /// If it didn't already exist in the Solution folder, we need to remove it. /// The SDK samples use a common Accpac props file located elsewhere in the /// SDK folder structure ("Settings") /// </param> private void SyncAccpacLibraries(string title, bool accpacPropsOriginallyInSolutionFolder) { var msg = string.Empty; // Log start of step LogEventStart(title); // Was the Accpac props file originally found in the solution folder? if (accpacPropsOriginallyInSolutionFolder == false) { msg = String.Format(Resources.Template_AccpacPropsFileNotFoundInRootOfSolutionFolder, Constants.Common.AccpacPropsFile); Log(msg); msg = Resources.SearchingInAllProjectDirectoriesInstead; Log(msg); // Accpac Props file is likely located in one or more folders OTHER THAN the solution root. // We will then find them and update the csproj file located in the same folder to point to a // version of the props file that will live in the solution root instead. IEnumerable <string> list = FileUtilities.EnumerateFiles(_settings.DestinationSolutionFolder, Constants.Common.AccpacPropsFile); var fileCount = ((List <string>)list).Count; if (fileCount > 0) { msg = String.Format(Resources.Template_XCopiesOfPropsFileWereFound, fileCount, Constants.Common.AccpacPropsFile); Log(msg); foreach (var file in list) { msg = $" {file}\n"; Log(msg); } msg = String.Format(Resources.Template_AttemptingToUpdateAllCsprojFiles, Constants.Common.AccpacPropsFile); Log(msg); PropsFileManager.UpdateAccpacPropsFileReferencesInProjects(list); msg = String.Format(Resources.Template_RemovingAllCopiesOfAccpacPropsFile, Constants.Common.AccpacPropsFile); Log(msg); PropsFileManager.RemoveAccpacPropsFromProjectFolders(list); } } else { // Accpac props file was found in the root of the solution folder. // Not necessary to look elsewhere for it :) } // Always copy the new props file to the solution root PropsFileManager.CopyAccpacPropsFileToSolutionFolder(_settings); msg = string.Format(Resources.Template_UpgradeLibrary, Constants.PerRelease.FromAccpacNumber, Constants.PerRelease.ToAccpacNumber); Log(msg); // Log end of step LogEventEnd(title); Log(""); }
/// <summary> Start the solution upgrade process </summary> /// <param name="settings">Settings for processing</param> public void Process(Settings settings) { const int WORKINGSTEPS = 6; LogSpacerLine('-'); Log(Resources.BeginUpgradeProcess); LogSpacerLine(); // Save settings for local usage _settings = settings; if (Constants.Common.EnableSolutionBackup) { DoOptionalSolutionBackup(backupSelected: _settings.WizardSteps[0].CheckboxValue, solutionFolder: _settings.DestinationSolutionFolder); } // Track whether or not the AccpacDotNetVersion.props file originally existed in the Solution folder bool AccpacPropsFileOriginallyInSolutionfolder = false; // Does the AccpacDotNetVersion.props file exist in the Solution folder? AccpacPropsFileOriginallyInSolutionfolder = PropsFileManager.IsAccpacDotNetVersionPropsLocatedInSolutionFolder(_settings); // Start at step 1 and ignore last two steps for (var index = 0; index < _settings.WizardSteps.Count; index++) { var title = _settings.WizardSteps[index].Title; LaunchProcessingEvent(title); // Insert a spacer line for each case statement below if (index >= 1 && index <= WORKINGSTEPS) { LogSpacerLine('-'); } // Step 0 is Main and Last two steps are Upgrade and Upgraded switch (index) { // // Developer Note: // Ensure the constant WORKINGSTEPS, defined at start of function, has been // updated if steps are added or removed from the following switch statement. // case 1: if (Constants.PerRelease.SyncKendoFiles) { SyncKendoFiles(title); } break; case 2: if (Constants.PerRelease.SyncWebFiles) { SyncWebFiles(title); } break; case 3: if (Constants.PerRelease.UpdateAccpacDotNetLibrary) { SyncAccpacLibraries(title, AccpacPropsFileOriginallyInSolutionfolder); } break; case 4: if (Constants.PerRelease.RemovePreviousJqueryLibraries) { RemovePreviousJqueryLibraries(title); } break; case 5: if (Constants.PerRelease.UpdateMicrosoftDotNetFramework) { UpdateTargetedDotNetFrameworkVersion(title); } break; case 6: if (Constants.PerRelease.UpdateUnifyDisabled) { UpdateUnifyDisabled(title); } break; case 7: if (Constants.PerRelease.AddBinIncludeFile) { AddBinIncludeFile(title); } break; #if ENABLE_TK_244885 case X: ConsolidateEnumerations(title); break; #endif } } LogSpacerLine(); Log(Resources.EndUpgradeProcess); LogSpacerLine('-'); }
/// <summary> Start the generation process </summary> /// <param name="settings">Settings for processing</param> public void Process(Settings settings) { LogSpacerLine('-'); Log(Resources.BeginUpgradeProcess); LogSpacerLine(); // Save settings for local usage _settings = settings; // Track whether or not the AccpacDotNetVersion.props file originally existed in the Solution folder bool AccpacPropsFileOriginallyInSolutionfolder = false; //Utilities.InitSettings(_settings); //var commonSteps = new CommonReleaseUpgradeSteps(_settings); //var customSteps = new CustomReleaseUpgradeSteps(_settings); #region Backup Solution - Currently Disabled //_backupFolder = BackupSolution(); #endregion // Does the AccpacDotNetVersion.props file exist in the Solution folder? AccpacPropsFileOriginallyInSolutionfolder = PropsFileManager.IsAccpacDotNetVersionPropsLocatedInSolutionFolder(_settings); // Start at step 1 and ignore last two steps for (var index = 0; index < _settings.WizardSteps.Count; index++) { var title = _settings.WizardSteps[index].Title; LaunchProcessingEvent(title); // Step 0 is Main and Last two steps are Upgrade and Upgraded switch (index) { #region Common Upgrade Steps case 1: LogSpacerLine('-'); SyncKendoFiles(title); break; case 2: LogSpacerLine('-'); SyncWebFiles(title); break; #endregion #region Accpac .NET library update - Comment out if no update required //case 3: // LogSpacerLine('-'); // SyncAccpacLibraries(title, AccpacPropsFileOriginallyInSolutionfolder); // break; #endregion #region Release Specific Upgrade Steps #if ENABLE_TK_244885 case 3: ConsolidateEnumerations(title); break; #endif case 3: LogSpacerLine('-'); UpdateThemeColor(title); break; case 4: LogSpacerLine('-'); UpdateCheckboxes(title); break; case 5: LogSpacerLine('-'); UpdateNewtonsoftPackage(title); break; #endregion } } LogSpacerLine(); Log(Resources.EndUpgradeProcess); LogSpacerLine('-'); }