You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/msbuild/msbuild-batching.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,16 @@ manager: douge
14
14
ms.workload:
15
15
- "multiple"
16
16
---
17
-
# MSBuild Batching
17
+
# MSBuild batching
18
18
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] has the ability to divide item lists into different categories, or batches, based on item metadata, and run a target or task one time with each batch.
19
19
20
-
## Task Batching
20
+
## Task batching
21
21
Task batching allows you to simplify your project files by providing a way to divide item lists into different batches and pass each of those batches into a task separately. This means that a project file only needs to have the task and its attributes declared once, even though it can be run several times.
22
22
23
-
You specify that you want [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] to perform batching with a task by using the %(*ItemMetaDataName*) notation in one of the task attributes. The following example splits the `Example` item list into batches based on the `Color` item metadata value, and passes each of the batches to the `MyTask` task separately.
23
+
You specify that you want [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] to perform batching with a task by using the %(\<ItemMetaDataName>) notation in one of the task attributes. The following example splits the `Example` item list into batches based on the `Color` item metadata value, and passes each of the batches to the `MyTask` task separately.
24
24
25
25
> [!NOTE]
26
-
> If you do not reference the item list elsewhere in the task attributes, or the metadata name may be ambiguous, you can use the %(*ItemCollection.ItemMetaDataName*) notation to fully qualify the item metadata value to use for batching.
26
+
> If you do not reference the item list elsewhere in the task attributes, or the metadata name may be ambiguous, you can use the %(\<ItemCollection.ItemMetaDataName>) notation to fully qualify the item metadata value to use for batching.
27
27
28
28
```xml
29
29
<Project
@@ -47,12 +47,12 @@ ms.workload:
47
47
</Project>
48
48
```
49
49
50
-
For more specific batching examples, see [Item Metadata in Task Batching](../msbuild/item-metadata-in-task-batching.md).
50
+
For more specific batching examples, see [Item metadata in task batching](../msbuild/item-metadata-in-task-batching.md).
51
51
52
52
## Target Batching
53
53
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] checks if the inputs and outputs of a target are up-to-date before it runs the target. If both inputs and outputs are up-to-date, the target is skipped. If a task inside of a target uses batching, [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] needs to determine if the inputs and outputs for each batch of items is up-to-date. Otherwise, the target is executed every time it is hit.
54
54
55
-
The following example shows a `Target` element that contains an `Outputs` attribute with the %(*ItemMetaDataName*) notation. [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] will divide the `Example` item list into batches based on the `Color` item metadata, and analyze the timestamps of the output files for each batch. If the outputs from a batch are not up-to-date, the target is run. Otherwise, the target is skipped.
55
+
The following example shows a `Target` element that contains an `Outputs` attribute with the %(\<ItemMetaDataName>) notation. [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] will divide the `Example` item list into batches based on the `Color` item metadata, and analyze the timestamps of the output files for each batch. If the outputs from a batch are not up-to-date, the target is run. Otherwise, the target is skipped.
56
56
57
57
```xml
58
58
<Project
@@ -78,9 +78,9 @@ ms.workload:
78
78
</Project>
79
79
```
80
80
81
-
For another example of target batching, see [Item Metadata in Target Batching](../msbuild/item-metadata-in-target-batching.md).
81
+
For another example of target batching, see [Item metadata in target batching](../msbuild/item-metadata-in-target-batching.md).
82
82
83
-
## Property Functions Using Metadata
83
+
## Property functions using metadata
84
84
Batching can be controlled by property functions that include metadata. For example,
Copy file name to clipboardExpand all lines: docs/msbuild/msbuild-best-practices.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ manager: douge
14
14
ms.workload:
15
15
- "multiple"
16
16
---
17
-
# MSBuild Best Practices
17
+
# MSBuild best practices
18
18
We recommend the following best practices for writing MSBuild scripts:
19
19
20
20
- Default property values are best handled by using the `Condition` attribute, and not by declaring a property whose default value can be overridden on the command line. For example, use
@@ -27,5 +27,5 @@ We recommend the following best practices for writing MSBuild scripts:
27
27
28
28
- Avoid wildcards when you select items. Instead, specify files explicitly. This makes it easier to track down errors that may occur when you add or delete files.
0 commit comments