public override bool Execute()
        {
            Hashtable hashtable;

            if (this.Include == null)
            {
                this.include = new TaskItem[0];
                return(true);
            }
            this.Include = ExpandWildcards(this.Include);
            this.Exclude = ExpandWildcards(this.Exclude);
            if ((this.AdditionalMetadata == null) && (this.Exclude == null))
            {
                return(true);
            }
            if (!PropertyParser.GetTable(base.Log, "AdditionalMetadata", this.AdditionalMetadata, out hashtable))
            {
                return(false);
            }
            Hashtable uniqueItems = GetUniqueItems(this.Exclude);
            ArrayList list        = this.CreateOutputItems(hashtable, uniqueItems);

            this.include = (ITaskItem[])list.ToArray(typeof(ITaskItem));
            return(!base.Log.HasLoggedErrors);
        }
예제 #2
0
        /// <summary>
        /// Execute.
        /// </summary>
        public override bool Execute()
        {
            if (Include == null)
            {
                Include = Array.Empty <ITaskItem>();
                return(true);
            }

            // Expand wild cards.
            Include = ExpandWildcards(Include);
            Exclude = ExpandWildcards(Exclude);

            // Simple case:  no additional attribute to add and no Exclude.  In this case the
            // ouptuts are simply the inputs.
            if (AdditionalMetadata == null && Exclude == null)
            {
                return(true);
            }

            // Parse the global properties into a hashtable.
            if (!PropertyParser.GetTable(Log, "AdditionalMetadata", AdditionalMetadata, out Dictionary <string, string> metadataTable))
            {
                return(false);
            }

            // Build a table of unique items.
            Dictionary <string, string> excludeItems = GetUniqueItems(Exclude);

            // Produce the output items, add attribute and honor exclude.
            List <ITaskItem> outputItems = CreateOutputItems(metadataTable, excludeItems);

            Include = outputItems.ToArray();

            return(!Log.HasLoggedErrors);
        }
예제 #3
0
        public override bool Execute()
        {
            if (Include == null)
            {
                Include = Array.Empty <ITaskItem>();
                return(true);
            }

            // Expand wild cards.
            (Include, bool expandedInclude) = TryExpandingWildcards(Include, XMakeAttributes.include);
            (Exclude, bool expandedExclude) = TryExpandingWildcards(Exclude, XMakeAttributes.exclude);

            // Execution stops if wildcard expansion fails due to drive enumeration and related env var is set.
            if (!(expandedInclude && expandedExclude))
            {
                return(false);
            }

            // Simple case:  no additional attribute to add and no Exclude.  In this case the
            // ouptuts are simply the inputs.
            if (AdditionalMetadata == null && Exclude == null)
            {
                return(true);
            }

            // Parse the global properties into a hashtable.
            if (!PropertyParser.GetTable(Log, "AdditionalMetadata", AdditionalMetadata, out Dictionary <string, string> metadataTable))
            {
                return(false);
            }

            // Build a table of unique items.
            Dictionary <string, string> excludeItems = GetUniqueItems(Exclude);

            // Produce the output items, add attribute and honor exclude.
            List <ITaskItem> outputItems = CreateOutputItems(metadataTable, excludeItems);

            Include = outputItems.ToArray();

            return(!Log.HasLoggedErrors);
        }
예제 #4
0
        /// <summary>
        /// Execute.
        /// </summary>
        public override bool Execute()
        {
            if (Include == null)
            {
                _include = new TaskItem[0];
                return(true);
            }

            // Expand wild cards.
            Include = ExpandWildcards(Include);
            Exclude = ExpandWildcards(Exclude);

            // Simple case:  no additional attribute to add and no Exclude.  In this case the
            // ouptuts are simply the inputs.
            if (AdditionalMetadata == null && Exclude == null)
            {
                return(true);
            }

            // Parse the global properties into a hashtable.
            Hashtable metadataTable;

            if (!PropertyParser.GetTable(Log, "AdditionalMetadata", this.AdditionalMetadata, out metadataTable))
            {
                return(false);
            }


            // Build a table of unique items.
            Hashtable excludeItems = GetUniqueItems(Exclude);

            // Produce the output items, add attribute and honor exclude.
            ArrayList outputItems = CreateOutputItems(metadataTable, excludeItems);

            _include = (ITaskItem[])outputItems.ToArray(typeof(ITaskItem));

            return(!Log.HasLoggedErrors);
        }