MSBuild: Items + Batching + CreateItem + Transforms Question -


I have an MSBILD project which amazes me that its result is this method. It is not that it is creating an issue or something of any kind, but I will try to understand it and I will improve my understanding.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Project xmlns = "http://schemas.microsoft.com/developer/msbuild/2003" Default Target = "TestTag 1; Test Target 2" toolversion = "3.5" & gt; & Lt; ItemGroup & gt; & Lt; Include PathDir = "C: \ RootDir \ UniqueDir1" /> & Lt; Include Pathar = "C: \ RootDire \ UniqueDir2" /> & Lt; / ItemGroup & gt; & Lt; Goal Name = "TestTarget1" Output = "% (PathDir.Identity)" & gt; & Lt; PropertyGroup & gt; & Lt; RootPath & gt;% (PathDir.Identity) & lt; / RootPath & gt; & Lt; / PropertyGroup & gt; & Lt; ItemGroup & gt; & Lt; Include subdirectory = "normal 1" /> & Lt; Include subdirectory = "General 2" /> & Lt; / ItemGroup & gt; & Lt; Include CreateItem = "@ (subdirectory-> '$ (pathpath) \% (identity)')" & gt; & Lt; Output Task parameter = "Include" ItemName = "FullPath" /> & Lt; / CreateItem & gt; & Lt; Message text = "@ (full path)" /> & Lt; / Target & gt; & Lt; Goal name = "TestTarget2" & gt; & Lt; Message text = "@ (full path)" /> & Lt; / Target & gt; & Lt; / Project & gt;  

So I have two main paths which are unique, and each of the unique paths in each of them has two directives with the same name. In the goal 1, I batching against the identification of items in the Pathidhi I'm doing this, and then the item is subdirectory, which contains common folder names found in unique directories, in which to create a new item full path. After this, after this, the output for the goal is as follows:

Goal 1:

  C: \ RootDayer \ UniqueDir1 \ Common1; C: \ RootDir \ UniqueDir1C: \ RootDir \ UniqueDir1 \ C: \ RootDir \ UniqueDir2 \ Common1; C: \ RootDir \ UniqueDir2 \ Common2  

Goal 2:

  C: \ RootDir \ UniqueDir1 \ Common 1; C: \ RootDir \ UniqueDir1 \ Common2; C: \ RootDir \ UniqueDir2 \ Common1; C: \ RootDir \ UniqueDir2 \ Common2  

So my guess is ... Why does Target1 only display that directory in which this directory is batching? I know that it's probably supposed to do with batching, but I know that all.

When a target is batch, then it is independently of other executables of the target with the same backup It exposes. So in the first execution you populate the FullPath item into content

  C: \ rootdair \ UniqueDir1 \ Common1; C: \ RootDir \ UniqueDir1 \ Common2  

Then on the second execution of the target you can populate the value of FullPath

  C: \ RootDir \ UniqueDir2 \ Common1; C: \ RootDir \ UniqueDir2 \ Common2  

Since the items are not visible to the same backup target, the second pass sees "No" of the FullPath item. But when TestTarget1 is complete, the values ​​of FullPath are added to the same value.

  C: \ RootDir \ UniqueDir1 \ Common1; C: \ RootDir \ UniqueDir1 \ Common2; C: \ RootDir \ UniqueDir2 \ Common1; C: \ RootDir \ UniqueDir2 \ Common2  

Does this clear? Batching can be misleading at times.

  • / ul>

    Comments

    Popular posts from this blog

    python - Overriding the save method in Django ModelForm -

    html - CSS autoheight, but fit content to height of div -

    qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -