コード例 #1
0
ファイル: IntrinsicTask.cs プロジェクト: yxbdali/msbuild
        /// <summary>
        /// Remove items from the world. Removes to items that are part of the project manifest are backed up, so
        /// they can be reverted when the project is reset after the end of the build.
        /// </summary>
        private void ExecuteRemove(BuildItemGroupChildXml child, ItemBucket bucket)
        {
            if (!Utilities.EvaluateCondition(child.Condition, child.ConditionAttribute, bucket.Expander, ParserOptions.AllowAll, loggingServices, buildEventContext))
            {
                return;
            }

            BuildItemGroup group = bucket.Lookup.GetItems(child.Name);

            if (group == null)
            {
                // No items of this type to remove
                return;
            }

            List <BuildItem> itemsToRemove = BuildItemGroup.FindItemsMatchingSpecification(group, child.Remove, child.RemoveAttribute, bucket.Expander, executionDirectory);

            if (itemsToRemove != null)
            {
                bucket.Lookup.RemoveItems(itemsToRemove);
            }
        }