|
2 | 2 | title: "Item Metadata in Target Batching | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -helpviewer_keywords: |
| 5 | +helpviewer_keywords: |
6 | 6 | - "batching [MSBuild]"
|
7 | 7 | - "MSBuild, target batching"
|
8 | 8 | - "target batching [MSBuild]"
|
9 | 9 | ms.assetid: f3cc4186-6a4c-4161-bbe5-1ec638b4925b
|
10 | 10 | author: mikejo5000
|
11 | 11 | ms.author: mikejo
|
12 | 12 | manager: jillfra
|
13 |
| -ms.workload: |
| 13 | +ms.workload: |
14 | 14 | - "multiple"
|
15 | 15 | ---
|
16 | 16 | # 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