Пример #1
0
        public XSolutionSpec(
            Initializer initializer,
            XBranch branch,
            SharedSolutionSpec sharedSpec)
            : base(initializer)
        {
            if (!(initializer.Parent is XBranch))
            {
                throw new Exception("A SolutionSpec must be a direct child of a Git branch.");
            }

            // The XSolutionSpec is available to siblings (ie. up to the end of the parent git branch).
            initializer.Services.Add(this);
            SolutionSpec = new SolutionSpec(sharedSpec, initializer.Reader);

            //XSharedSolutionSpec.RemoveElementWarnings( initializer );
            initializer.Reader.Handle(initializer
                                      .Element.Elements()
                                      .Where(c => c.Name.LocalName == nameof(SolutionSpec.NPMProjects) ||
                                             c.Name.LocalName == nameof(SolutionSpec.PublishedProjects) ||
                                             c.Name.LocalName == nameof(SolutionSpec.NotPublishedProjects) ||
                                             c.Name.LocalName == nameof(SolutionSpec.CKSetupComponentProjects)));

            // Registers the SolutionSpec as a branch settings: the Solution specifications becomes
            // available to any of this branch plugins.
            branch.Parent.ProtoGitFolder.PluginRegistry.RegisterSettings(SolutionSpec, branch.Name);
            foreach (var type in GitPluginRegistry.GlobalRegister.GetAllGitPlugins().Except(SolutionSpec.ExcludedPlugins))
            {
                branch.Parent.ProtoGitFolder.PluginRegistry.Register(type, branch.Name, allowGitPlugin: true);
            }
        }
Пример #2
0
 public XSharedSolutionSpec(
     Initializer initializer,
     SharedSolutionSpec previous = null)
     : base(initializer)
 {
     if (previous != null)
     {
         SharedSpec = new SharedSolutionSpec(previous, initializer.Reader);
         initializer.Services.Remove <SharedSolutionSpec>();
     }
     else
     {
         SharedSpec = new SharedSolutionSpec(initializer.Reader);
     }
     //RemoveElementWarnings( initializer );
     initializer.Services.Add(SharedSpec);
 }