Skip to content

Commit ac66872

Browse files
committed
Merge branch 'patch-7' of https://github.com/changeworld/visualstudio-docs into from-public-2366
2 parents 12f1eb2 + 5226c23 commit ac66872

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

docs/msbuild/item-metadata-in-target-batching.md

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,65 @@
22
title: "Item Metadata in Target Batching | Microsoft Docs"
33
ms.date: "11/04/2016"
44
ms.topic: "conceptual"
5-
helpviewer_keywords:
5+
helpviewer_keywords:
66
- "batching [MSBuild]"
77
- "MSBuild, target batching"
88
- "target batching [MSBuild]"
99
ms.assetid: f3cc4186-6a4c-4161-bbe5-1ec638b4925b
1010
author: mikejo5000
1111
ms.author: mikejo
1212
manager: jillfra
13-
ms.workload:
13+
ms.workload:
1414
- "multiple"
1515
---
1616
# Item metadata in target batching
17-
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] has the ability to perform dependency analysis on the inputs and outputs of a build target. If it is determined that the inputs or outputs of the target are up-to-date, the target will be skipped and the build will proceed. `Target` elements use the `Inputs` and `Outputs` attributes to specify the items to inspect during dependency analysis.
18-
19-
If a target contains a task that uses batched items as inputs or outputs, the `Target` element of the target should use batching in its `Inputs` or `Outputs` attributes to enable [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] to skip batches of items that are already up-to-date.
20-
21-
## Batch targets
22-
The following example contains an item list named `Res` that is divided into two batches based on the `Culture` item metadata. Each of these batches is passed into the `AL` task, which creates an output assembly for each batch. By using batching on the `Outputs` attribute of the `Target` element, [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] can determine if each of the individual batches is up-to-date before running the target. Without using target batching, both batches of items would be run by the task every time the target was executed.
23-
24-
```xml
25-
<Project
26-
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
27-
28-
<ItemGroup>
29-
<Res Include="Strings.fr.resources">
30-
<Culture>fr</Culture>
31-
</Res>
32-
<Res Include="Strings.jp.resources">
33-
<Culture>jp</Culture>
34-
</Res>
35-
<Res Include="Menus.fr.resources">
36-
<Culture>fr</Culture>
37-
</Res>
38-
<Res Include="Dialogs.fr.resources">
39-
<Culture>fr</Culture>
40-
</Res>
41-
<Res Include="Dialogs.jp.resources">
42-
<Culture>jp</Culture>
43-
</Res>
44-
<Res Include="Menus.jp.resources">
45-
<Culture>jp</Culture>
46-
</Res>
47-
</ItemGroup>
48-
49-
<Target Name="Build"
50-
Inputs="@(Res)"
51-
Outputs="%(Culture)\MyApp.resources.dll">
52-
53-
<AL Resources="@(Res)"
54-
TargetType="library"
55-
OutputAssembly="%(Culture)\MyApp.resources.dll"
56-
57-
</Target>
58-
59-
</Project>
60-
```
61-
62-
## See also
63-
[How to: Build incrementally](../msbuild/how-to-build-incrementally.md)
64-
[Batching](../msbuild/msbuild-batching.md)
65-
[Target element (MSBuild)](../msbuild/target-element-msbuild.md)
66-
[Item metadata in task batching](../msbuild/item-metadata-in-task-batching.md)
17+
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] has the ability to perform dependency analysis on the inputs and outputs of a build target. If it is determined that the inputs or outputs of the target are up-to-date, the target will be skipped and the build will proceed. `Target` elements use the `Inputs` and `Outputs` attributes to specify the items to inspect during dependency analysis.
18+
19+
If a target contains a task that uses batched items as inputs or outputs, the `Target` element of the target should use batching in its `Inputs` or `Outputs` attributes to enable [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] to skip batches of items that are already up-to-date.
20+
21+
## Batch targets
22+
The following example contains an item list named `Res` that is divided into two batches based on the `Culture` item metadata. Each of these batches is passed into the `AL` task, which creates an output assembly for each batch. By using batching on the `Outputs` attribute of the `Target` element, [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] can determine if each of the individual batches is up-to-date before running the target. Without using target batching, both batches of items would be run by the task every time the target was executed.
23+
24+
```xml
25+
<Project
26+
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
27+
28+
<ItemGroup>
29+
<Res Include="Strings.fr.resources">
30+
<Culture>fr</Culture>
31+
</Res>
32+
<Res Include="Strings.jp.resources">
33+
<Culture>jp</Culture>
34+
</Res>
35+
<Res Include="Menus.fr.resources">
36+
<Culture>fr</Culture>
37+
</Res>
38+
<Res Include="Dialogs.fr.resources">
39+
<Culture>fr</Culture>
40+
</Res>
41+
<Res Include="Dialogs.jp.resources">
42+
<Culture>jp</Culture>
43+
</Res>
44+
<Res Include="Menus.jp.resources">
45+
<Culture>jp</Culture>
46+
</Res>
47+
</ItemGroup>
48+
49+
<Target Name="Build"
50+
Inputs="@(Res)"
51+
Outputs="%(Culture)\MyApp.resources.dll">
52+
53+
<AL Resources="@(Res)"
54+
TargetType="library"
55+
OutputAssembly="%(Culture)\MyApp.resources.dll">
56+
57+
</Target>
58+
59+
</Project>
60+
```
61+
62+
## See also
63+
[How to: Build incrementally](../msbuild/how-to-build-incrementally.md)
64+
[Batching](../msbuild/msbuild-batching.md)
65+
[Target element (MSBuild)](../msbuild/target-element-msbuild.md)
66+
[Item metadata in task batching](../msbuild/item-metadata-in-task-batching.md)

0 commit comments

Comments
 (0)