示例#1
0
        public override void ApplyProjectDependencies(PackageState state)
        {
            if (!state.DontUseProjectDependencies)             // Allow disabling for testing
            {
                // Add an initial set of dependencies directly from the project files
                foreach (TBLogConfiguration config in LogFile.Configurations)
                {
                    foreach (TBLogItem project in config.References.Projects)
                    {
                        string src = QQnPath.NormalizePath(project.FullSrc);

                        foreach (Origin o in state.Origins)
                        {
                            BuildOrigin bo = o as BuildOrigin;
                            if (bo == null)
                            {
                                continue;
                            }

                            if (QQnPath.Equals(bo.ProjectFile, src) && !Dependencies.ContainsKey(o))
                            {
                                EnsureDependency(o, DependencyType.LinkedTo);
                            }
                        }
                    }
                }
            }

            foreach (TBLogItem item in LogFile.AllProjectOutput)
            {
                FileData fd = state.Files[item.FullSrc];

                if (!string.IsNullOrEmpty(fd.CopiedFrom))
                {
                    FileData src;

                    if (state.Files.TryGetValue(fd.CopiedFrom, out src))
                    {
                        if (src.Origin != this)
                        {
                            EnsureDependency(src.Origin, item.IsCopy ? DependencyType.Required : DependencyType.LinkedTo);
                        }
                    }
                }
            }

            foreach (TBLogItem item in LogFile.AllContents)
            {
                FileData fd = state.Files[item.FullSrc];

                if (!string.IsNullOrEmpty(fd.CopiedFrom))
                {
                    FileData src;

                    if (state.Files.TryGetValue(fd.CopiedFrom, out src))
                    {
                        if (src.Origin != this)
                        {
                            EnsureDependency(src.Origin, DependencyType.Required);
                        }
                    }
                }
            }
        }