Ejemplo n.º 1
0
        public static void ProcessPathPropertyList(this IEnumerable <Configuration> configurations, Project project, string conditionToApply, ProjectPropertyGroupElement pgpe, string outputPropertyName, string inputCategory, string inputPropertyName, string outputFolder)
        {
            UniquePathPropertyList propertyList = null;
            var masterProperty = pgpe.FindOrCreatePathPropertyListByCondition(outputPropertyName, "");

            var commonValues = configurations.GetCommonValues(inputCategory, inputPropertyName).ToArray();

            if (commonValues.Length > 0)
            {
                foreach (var i in commonValues)
                {
                    var pth = i;
                    if (pth.IndexOf("$(") == -1)
                    {
                        pth = outputFolder.RelativePathTo(pth.GetFullPath());
                    }
                    if (pth.Equals("$(OutDir)", StringComparison.InvariantCultureIgnoreCase))
                    {
                        continue;
                    }

                    pth = Event <CustomReplacement> .Raise(pth);

                    FindReferencedProperties(pth);

                    if (!masterProperty.Contains(pth))
                    {
                        if (propertyList == null)
                        {
                            propertyList = (pgpe.FindOrCreatePathPropertyListByCondition(outputPropertyName, conditionToApply));
                            if (conditionToApply.Is())
                            {
                                propertyList.Add("$({0})".format(outputPropertyName));
                            }
                        }
                        propertyList.Add(pth);
                    }
                }
            }
        }