Пример #1
0
 public NuGetMapper(NuGetSettings nuGetSettings, Version xrmVersion, string sourcePackagesConfigPath, string destinationPackagesConfigPath)
 {
     NuGetSettings                 = nuGetSettings;
     XrmVersion                    = xrmVersion;
     SourcePackagesConfigPath      = sourcePackagesConfigPath;
     DestinationPackagesConfigPath = destinationPackagesConfigPath;
 }
Пример #2
0
 public SolutionEditor(string solutionPath,
                       string templateDirectory,
                       string strongNamePath       = null,
                       NuGetSettings nuGetSettings = null)
 {
     NuGetSettings       = nuGetSettings ?? new NuGetSettings(templateDirectory);
     StrongNamePath      = strongNamePath ?? Path.Combine(templateDirectory, "bin\\sn.exe");
     TemplateDirectory   = templateDirectory;
     SolutionPath        = solutionPath;
     OutputBaseDirectory = Path.GetDirectoryName(solutionPath);
 }
Пример #3
0
 private void Execute(object info)
 {
     WorkAsync(new WorkAsyncInfo("Performing requested operations...", (w, e) => // Work To Do Asynchronously
     {
         var templatePath  = Path.GetFullPath(Path.Combine(Paths.PluginsPath, Settings.TemplateFolder));
         var nuGetSettings = new Logic.NuGetSettings(templatePath)
         {
             Sources = Settings.NugetSourcesList
         };
         if (e.Argument is InitializeSolutionInfo solutionInfo)
         {
             if (solutionInfo.InstallSnippets)
             {
                 Logic.VisualStudio.InstallCodeSnippets(Paths.PluginsPath);
             }
             Logic.SolutionInitializer.Execute(solutionInfo, templatePath, nuGetSettings: nuGetSettings);
         }
         else if (e.Argument is AddProjectToSolutionInfo projectInfo)
         {
             Logic.SolutionUpdater.Execute(projectInfo, templatePath, nuGetSettings: nuGetSettings);
         }
     }).WithLogger(this, TxtOutput, info));
 }
        public static void Execute(AddProjectToSolutionInfo info, string templateDirectory, string strongNamePath = null, NuGetSettings nuGetSettings = null)
        {
            Logger.AddDetail($"Starting to process solution '{info.SolutionPath}' using templates from '{templateDirectory}'");
            var adder = new SolutionUpdater(info.SolutionPath, templateDirectory, strongNamePath, nuGetSettings);

            adder.Projects = adder.GetProjectInfos(info);
            adder.CreateProjects(string.Empty);
            IEnumerable <string> solution = File.ReadAllLines(adder.SolutionPath);

            solution = SolutionFileEditor.AddMissingProjects(solution, adder.Projects.Values);
            File.WriteAllLines(adder.SolutionPath, solution);
            adder.ExecuteNuGetRestoreForSolution();
        }
 public SolutionUpdater(string solutionPath, string templateDirectory, string strongNamePath = null, NuGetSettings nuGetSettings = null)
     : base(solutionPath, templateDirectory, strongNamePath, nuGetSettings)
 {
 }
Пример #6
0
        public static void Execute(InitializeSolutionInfo info, string templateDirectory, string strongNamePath = null, NuGetSettings nuGetSettings = null)
        {
            Logger.AddDetail($"Starting to process solution '{info.SolutionPath}' using templates from '{templateDirectory}'");
            CreateSolution(info);
            var logic = new SolutionInitializer(info.SolutionPath, templateDirectory, strongNamePath, nuGetSettings);

            logic.Projects = logic.GetProjectInfos(info);
            logic.CreateProjects(info.RootNamespace);
            UpdateSolution(info, logic);
            logic.ExecuteNuGetRestoreForSolution();
            UpdateEarlyBoundConfigOutputPaths(info);
        }