示例#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];
            }
        }
示例#2
0
 public Target(
     Bam.Core.TokenizedString nameOrOutput,
     bool isPhony,
     string variableName,
     Bam.Core.Module module,
     int count)
 {
     this.Path = nameOrOutput;
     this.IsPhony = isPhony;
     if (isPhony)
     {
         return;
     }
     if (count > 0)
     {
         return;
     }
     if (Bam.Core.Graph.Instance.IsReferencedModule(module) || !System.String.IsNullOrEmpty(variableName))
     {
         // make the target names unique across configurations
         if (System.String.IsNullOrEmpty(variableName))
         {
             this.VariableName = System.String.Format("{0}_{1}", module.GetType().Name, module.BuildEnvironment.Configuration.ToString());
         }
         else
         {
             this.VariableName = System.String.Format("{0}_{1}", variableName, module.BuildEnvironment.Configuration.ToString());
         }
     }
 }
示例#3
0
        public Target EnsureTargetExists(
            Bam.Core.Module module)
        {
            var moduleType = module.GetType();
            lock (this.TargetMap)
            {
                if (!this.TargetMap.ContainsKey(moduleType))
                {
                    Project project = null;
                    // TODO: remember projects, both by a Module or by a Package
                    if (this.ProjectPerModule)
                    {
                        throw new System.NotSupportedException();
                    }
                    else
                    {
                        project = this.EnsureProjectExists(module, module.PackageDefinition.FullName);
                    }

                    var target = new Target(module, project);
                    this.TargetMap.Add(moduleType, target);

                    project.Targets.Add(moduleType, target);
                }
            }
            if (null == module.MetaData)
            {
                module.MetaData = this.TargetMap[moduleType];
            }
            return module.MetaData as Target;
        }
示例#4
0
        public Target(
            Bam.Core.Module module,
            Project project)
        {
            this.IsA = "PBXNativeTarget";
            this.Name = module.GetType().Name;
            this.Module = module;
            this.Project = project;
            this.Type = EProductType.NA;

            var configList = new ConfigurationList(this);
            this.ConfigurationList = configList;
            project.ConfigurationLists.Add(configList);

            this.TargetDependencies = new Bam.Core.Array<TargetDependency>();
        }
示例#5
0
 Bam.Core.IBuildModeMetaData.ModuleOutputDirectory(
     Bam.Core.Module currentModule,
     Bam.Core.Module encapsulatingModule)
 {
     return Bam.Core.TokenizedString.CreateVerbatim(System.IO.Path.Combine(encapsulatingModule.GetType().Name, currentModule.BuildEnvironment.Configuration.ToString()));
 }