Example #1
0
        public VSProject EnsureProjectExists(
            Bam.Core.Module module)
        {
            var moduleType = module.GetType();
            lock (this.ProjectMap)
            {
                if (!this.ProjectMap.ContainsKey(moduleType))
                {
                    var project = new VSProject(this, module);
                    this.ProjectMap.Add(moduleType, project);

                    var groups = module.GetType().GetCustomAttributes(typeof(Bam.Core.ModuleGroupAttribute), true);
                    if (groups.Length > 0)
                    {
                        var solutionFolderName = (groups as Bam.Core.ModuleGroupAttribute[])[0].GroupName;
                        this.AddNestedEntity(solutionFolderName, project);
                    }
                }
                if (null == module.MetaData)
                {
                    module.MetaData = this.ProjectMap[moduleType];
                }
                return this.ProjectMap[moduleType];
            }
        }
Example #2
0
 public VSSettingsGroup(
     VSProject project,
     Bam.Core.Module module,
     ESettingsGroup group,
     Bam.Core.TokenizedString include = null)
 {
     this.Project = project;
     this.Module  = module;
     this.Group   = group;
     this.Include = include;
     if (null != include)
     {
         this.RelativeDirectory = module.CreateTokenizedString("@trimstart(@relativeto(@dir($(0)),$(packagedir)),../)", include);
     }
     this.Settings = new Bam.Core.Array <VSSetting>();
 }
 public VSSettingsGroup(
     VSProject project,
     Bam.Core.Module module,
     ESettingsGroup group,
     Bam.Core.TokenizedString include = null)
 {
     this.Project = project;
     this.Module  = module;
     this.Group   = group;
     this.Include = include;
     if (null != include)
     {
         this.RelativeDirectory = module.CreateTokenizedString("@trimstart(@relativeto(@dir($(0)),$(packagedir)),../)", include);
         lock (this.RelativeDirectory)
         {
             if (!this.RelativeDirectory.IsParsed)
             {
                 // may have been parsed already, e.g. a common header
                 this.RelativeDirectory.Parse();
             }
         }
     }
     this.Settings = new Bam.Core.Array <VSSetting>();
 }
Example #4
0
 LinkAgainstProject(
     VSProject dependentProject)
 {
     lock (this)
     {
         if (this.OrderOnlyDependentProjects.Contains(dependentProject))
         {
             throw new Bam.Core.Exception("Project already exists as an order only dependency");
         }
         this.LinkDependentProjects.AddUnique(dependentProject);
     }
 }
Example #5
0
 public void RequiresProject(
     VSProject dependentProject)
 {
     lock (this)
     {
         if (this.LinkDependentProjects.Contains(dependentProject))
         {
             throw new Bam.Core.Exception("Project already exists as a link dependency");
         }
         this.OrderOnlyDependentProjects.AddUnique(dependentProject);
     }
 }
Example #6
0
 private void AddNestedEntity(
     string fullpath,
     VSProject project,
     VSSolutionFolder parent = null)
 {
     var split = fullpath.Split('/');
     var path = split[0];
     if (!this.SolutionFolders.ContainsKey(path))
     {
         this.SolutionFolders.Add(path, new VSSolutionFolder(path));
     }
     var folder = this.SolutionFolders[path];
     if (null != parent)
     {
         parent.NestedEntities.AddUnique(folder);
     }
     if (1 == split.Length)
     {
         folder.NestedEntities.AddUnique(project);
     }
     else
     {
         this.AddNestedEntity(string.Join("/", split.Skip(1)), project, folder);
     }
 }
Example #7
0
 public VSProjectFilter(
     VSProject project)
 {
     this.Project = project;
 }