Esempio n. 1
0
        private static string GenerateFBuildNodeList(string aliasName, IList <BuildComponent> objectGroups)
        {
            var sb      = new StringBuilder();
            var aliases = new List <string>();

            // Ensure nodes are placed before nodes which depend on them.
            bool changed;

            do
            {
                changed = false;
                for (var i = 0; i < objectGroups.Count; ++i)
                {
                    if (!objectGroups[i].Dependencies.Any())
                    {
                        continue;
                    }

                    var highest = objectGroups[i].Dependencies.Select(objectGroups.IndexOf).OrderBy(n => n).Last();
                    if (highest > i)
                    {
                        var thisObject = objectGroups[i];
                        objectGroups.RemoveAt(i);
                        objectGroups.Insert(highest, thisObject);
                        changed = true;
                    }
                }
            } while (changed);

            foreach (var objectGroup in objectGroups)
            {
                aliases.Add(objectGroup.Alias);
                sb.Append(objectGroup.ToString());
            }

            if (aliases.Any())
            {
                sb.Append(FASTBuildCommon.GetAliasTag(aliasName, aliases));
            }
            return(sb.ToString());
        }
Esempio n. 2
0
        private static string GenerateFBuildTargets(bool anyObjects, bool anyLibs)
        {
            var aliases = new List <string>();

            if (anyObjects)
            {
                aliases.Add("ObjectsListsAlias");
            }
            if (anyLibs)
            {
                aliases.Add("DLLListAlias");
            }
            if (anyObjects || anyLibs)
            {
                return(FASTBuildCommon.GetAliasTag("all", aliases));
            }
            else
            {
                return("");
            }
        }