Skip to content

Commit 58b8b7b

Browse files
authored
Merge pull request #2507 from v-thepet/batch12
MSBuild #12
2 parents 1ab4263 + 50467be commit 58b8b7b

10 files changed

+261
-283
lines changed

docs/msbuild/msbuild-task-reference.md

Lines changed: 82 additions & 82 deletions
Large diffs are not rendered by default.

docs/msbuild/msbuild-task.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ manager: douge
2121
ms.workload:
2222
- "multiple"
2323
---
24-
# MSBuild Task
24+
# MSBuild task
2525
Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] projects from another [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project.
2626

2727
## Parameters
@@ -42,32 +42,32 @@ Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_
4242
|`Targets`|Optional `String` parameter.<br /><br /> Specifies the target or targets to build in the project files. Use a semicolon to separate a list of target names. If no targets are specified in the `MSBuild` task, the default targets specified in the project files are built. **Note:** The targets must occur in all the project files. If they do not, a build error occurs.|
4343
|`ToolsVersion`|Optional `String` parameter.<br /><br /> Specifies the `ToolsVersion` to use when building projects passed to this task.<br /><br /> Enables an [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] task to build a project that targets a different version of the [!INCLUDE[dnprdnshort](../code-quality/includes/dnprdnshort_md.md)] than the one specified in the project. Valid values are `2.0`, `3.0` and `3.5`. Default value is `3.5`.|
4444
|`UnloadProjectsOnCompletion`|Optional `Boolean` parameter.<br /><br /> If `true`, the project will be unloaded once the operation is complete.|
45-
|`UseResultsCache`|Optional `Boolean` parameter.<br /><br /> If `true`, the cached result will be returned, if present. If theMSBuild task is run, its result will be cached in a scope (ProjectFileName, GlobalProperties)[TargetNames]<br /><br /> as a list of build items|
45+
|`UseResultsCache`|Optional `Boolean` parameter.<br /><br /> If `true`, the cached result will be returned, if present.<br /><br /> If the MSBuild task is run, its result will be cached in a scope <br /><br /> (ProjectFileName, GlobalProperties)[TargetNames]<br /><br /> as a list of build items|
4646

4747
## Remarks
48-
In addition to the parameters listed above, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension Base Class](../msbuild/taskextension-base-class.md).
48+
In addition to the parameters listed above, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension base class](../msbuild/taskextension-base-class.md).
4949

50-
Unlike using the [Exec Task](../msbuild/exec-task.md) to start MSBuild.exe, this task uses the same [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] process to build the child projects. The list of already-built targets that can be skipped is shared between the parent and child builds. This task is also faster because no new [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] process is created.
50+
Unlike using the [Exec task](../msbuild/exec-task.md) to start *MSBuild.exe*, this task uses the same [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] process to build the child projects. The list of already-built targets that can be skipped is shared between the parent and child builds. This task is also faster because no new [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] process is created.
5151

5252
This task can process not only project files but also solution files.
5353

5454
Any configuration that is required by [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] to enable projects to build at the same time, even if the configuration involves remote infrastructure (for example, ports, protocols, timeouts, retries, and so forth), must be made configurable by using a configuration file. When possible, configuration items should be able to be specified as task parameters on the `MSBuild` task.
5555

5656
Beginning in [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 3.5, Solution projects now surface TargetOutputs from all of the sub-projects it builds.
5757

58-
## Passing Properties to Projects
59-
In versions of [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] prior to [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 3.5, passing different sets of properties to different projects listed in the [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] item was challenging. If you used the Properties attribute of the [MSBuild Task](../msbuild/msbuild-task.md), then its setting was applied to all of the projects being built unless you batched the [MSBuild Task](../msbuild/msbuild-task.md) and conditionally provided different properties for each project in the item list.
58+
## Pass properties to projects
59+
In versions of [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] prior to [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 3.5, passing different sets of properties to different projects listed in the [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] item was challenging. If you used the Properties attribute of the [MSBuild task](../msbuild/msbuild-task.md), then its setting was applied to all of the projects being built unless you batched the [MSBuild task](../msbuild/msbuild-task.md) and conditionally provided different properties for each project in the item list.
6060

61-
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 3.5, however, provides two new reserved metadata items, Properties and AdditionalProperties, that provide you a flexible way to pass different properties for different projects being built using the [MSBuild Task](../msbuild/msbuild-task.md).
61+
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 3.5, however, provides two new reserved metadata items, Properties and AdditionalProperties, that provide you a flexible way to pass different properties for different projects being built using the [MSBuild task](../msbuild/msbuild-task.md).
6262

6363
> [!NOTE]
64-
> These new metadata items are applicable only to items passed in the Projects attribute of the [MSBuild Task](../msbuild/msbuild-task.md).
64+
> These new metadata items are applicable only to items passed in the Projects attribute of the [MSBuild task](../msbuild/msbuild-task.md).
6565
66-
## Multi-Processor Build Benefits
67-
One of the major benefits of using this new metadata occurs when you build your projects in parallel on a multi-processor system. The metadata allows you to consolidate all projects into a single [MSBuild Task](../msbuild/msbuild-task.md) call without having to perform any batching or conditional [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] tasks. And when you call only a single [MSBuild Task](../msbuild/msbuild-task.md), all of the projects listed in the Projects attribute will be built in parallel. (Only, however, if the `BuildInParallel=true` attribute is present in the [MSBuild Task](../msbuild/msbuild-task.md).) For more information, see [Building Multiple Projects in Parallel](../msbuild/building-multiple-projects-in-parallel-with-msbuild.md).
66+
## Multi-processor build benefits
67+
One of the major benefits of using this new metadata occurs when you build your projects in parallel on a multi-processor system. The metadata allows you to consolidate all projects into a single [MSBuild task](../msbuild/msbuild-task.md) call without having to perform any batching or conditional [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] tasks. And when you call only a single [MSBuild task](../msbuild/msbuild-task.md), all of the projects listed in the Projects attribute will be built in parallel. (Only, however, if the `BuildInParallel=true` attribute is present in the [MSBuild task](../msbuild/msbuild-task.md).) For more information, see [Building multiple projects in parallel](../msbuild/building-multiple-projects-in-parallel-with-msbuild.md).
6868

69-
## Properties Metadata
70-
A common scenario is when you are building multiple solution files using the [MSBuild Task](../msbuild/msbuild-task.md), only using different build configurations. You may want to build solution a1 using the Debug configuration and solution a2 using the Release configuration. In [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 2.0, this project file would look like the following:
69+
## Properties metadata
70+
A common scenario is when you are building multiple solution files using the [MSBuild task](../msbuild/msbuild-task.md), only using different build configurations. You may want to build solution a1 using the Debug configuration and solution a2 using the Release configuration. In [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 2.0, this project file would look like the following:
7171

7272
> [!NOTE]
7373
> In the following example, "..." represents additional solution files.
@@ -83,7 +83,7 @@ Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_
8383
</Project>
8484
```
8585

86-
By using the Properties metadata, however, you can simplify this to use a single [MSBuild Task](../msbuild/msbuild-task.md), as shown by the following:
86+
By using the Properties metadata, however, you can simplify this to use a single [MSBuild task](../msbuild/msbuild-task.md), as shown by the following:
8787

8888
### a.proj
8989

@@ -120,8 +120,8 @@ Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_
120120
</Project>
121121
```
122122

123-
## AdditionalProperties Metadata
124-
Consider the following scenario where you are building two solution files using the [MSBuild Task](../msbuild/msbuild-task.md), both using the Release configuration, but one using the x86 architecture and the other using the ia64 architecture. In [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 2.0, you would need to create multiple instances of the [MSBuild Task](../msbuild/msbuild-task.md): one to build the project using the Release configuration with the x86 Architecture, the other using the Release configuration with the ia64 architecture. Your project file would look like the following:
123+
## AdditionalProperties metadata
124+
Consider the following scenario where you are building two solution files using the [MSBuild task](../msbuild/msbuild-task.md), both using the Release configuration, but one using the x86 architecture and the other using the ia64 architecture. In [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 2.0, you would need to create multiple instances of the [MSBuild task](../msbuild/msbuild-task.md): one to build the project using the Release configuration with the x86 Architecture, the other using the Release configuration with the ia64 architecture. Your project file would look like the following:
125125

126126
### a.proj
127127

@@ -136,7 +136,7 @@ Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_
136136
</Project>
137137
```
138138

139-
By using the AdditionalProperties metadata, you can simplify this to use a single [MSBuild Task](../msbuild/msbuild-task.md) by using the following:
139+
By using the AdditionalProperties metadata, you can simplify this to use a single [MSBuild task](../msbuild/msbuild-task.md) by using the following:
140140

141141
### a.proj
142142

@@ -182,6 +182,6 @@ Builds [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_
182182
</Project>
183183
```
184184

185-
## See Also
185+
## See also
186186
[Tasks](../msbuild/msbuild-tasks.md)
187-
[Task Reference](../msbuild/msbuild-task-reference.md)
187+
[Task reference](../msbuild/msbuild-task-reference.md)

docs/msbuild/msbuild-tasks-specific-to-visual-cpp.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,35 @@ manager: douge
1818
ms.workload:
1919
- "cplusplus"
2020
---
21-
# MSBuild Tasks Specific to Visual C++
22-
Tasks provide the code that runs during the build process. When Visual C++ is installed, the following tasks are available, in addition to those that are installed with [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)]. For more information, see [MSBuild (Visual C++) Overview](/cpp/build/msbuild-visual-cpp-overview).
21+
# MSBuild tasks specific to Visual C++
22+
Tasks provide the code that runs during the build process. When Visual C++ is installed, the following tasks are available, in addition to those that are installed with [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)]. For more information, see [MSBuild (Visual C++) overview](/cpp/build/msbuild-visual-cpp-overview).
2323

2424
In addition to the parameters for each task, every task also has the following parameters.
2525

2626
|Parameter|Description|
2727
|---------------|-----------------|
2828
|`Condition`|Optional `String` parameter.<br /><br /> A `Boolean` expression that the [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] engine uses to determine whether this task will be executed. For information about the conditions that are supported by [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)], see [Conditions](../msbuild/msbuild-conditions.md).|
29-
|`ContinueOnError`|Optional parameter. Can contain one of the following values:<br /><br /> - **WarnAndContinue** or **true**. When a task fails, subsequent tasks in the [Target](../msbuild/target-element-msbuild.md) element and the build continue to execute, and all errors from the task are treated as warnings<br />- **ErrorAndContinue**. When a task fails, subsequent tasks in the `Target` element and the build continue to execute, and all errors from the task are treated as errors.<br />- **ErrorAndStop** or **false** (default). When a task fails, the remaining tasks in the`Target` element and the build aren't executed, and the entire `Target` element and the build are considered to have failed.<br /><br /> Versions of the .NET Framework before 4.5 supported only the `true` and `false` values.<br /><br /> For more information, see [How to: Ignore Errors in Tasks](../msbuild/how-to-ignore-errors-in-tasks.md).|
29+
|`ContinueOnError`|Optional parameter. Can contain one of the following values:<br /><br /> - **WarnAndContinue** or **true**. When a task fails, subsequent tasks in the [Target](../msbuild/target-element-msbuild.md) element and the build continue to execute, and all errors from the task are treated as warnings<br />- **ErrorAndContinue**. When a task fails, subsequent tasks in the `Target` element and the build continue to execute, and all errors from the task are treated as errors.<br />- **ErrorAndStop** or **false** (default). When a task fails, the remaining tasks in the`Target` element and the build aren't executed, and the entire `Target` element and the build are considered to have failed.<br /><br /> Versions of the .NET Framework before 4.5 supported only the `true` and `false` values.<br /><br /> For more information, see [How to: Ignore errors in tasks](../msbuild/how-to-ignore-errors-in-tasks.md).|
3030

31-
## Related Topics
31+
### Related topics
3232

3333
|Title|Description|
3434
|-----------|-----------------|
35-
|[BscMake Task](../msbuild/bscmake-task.md)|Wraps the Microsoft Browse Information Maintenance Utility tool (bscmake.exe).|
36-
|[CL Task](../msbuild/cl-task.md)|Wraps the Visual C++ compiler tool (cl.exe).|
37-
|[CPPClean Task](../msbuild/cppclean-task.md)|Deletes the temporary files that MSBuild creates when a Visual C++ project is built.|
38-
|[LIB Task](../msbuild/lib-task.md)|Wraps the Microsoft 32-Bit Library Manager tool (lib.exe).|
39-
|[Link Task](../msbuild/link-task.md)|Wraps the Visual C++ linker tool (link.exe).|
40-
|[MIDL Task](../msbuild/midl-task.md)|Wraps the Microsoft Interface Definition Language (MIDL) compiler tool (midl.exe).|
41-
|[MT Task](../msbuild/mt-task.md)|Wraps the Microsoft Manifest Tool (mt.exe).|
42-
|[RC Task](../msbuild/rc-task.md)|Wraps the Microsoft Windows Resource Compiler tool (rc.exe).|
43-
|[SetEnv Task](../msbuild/setenv-task.md)|Sets or deletes the value of a specified environment variable.|
44-
|[VCMessage Task](../msbuild/vcmessage-task.md)|Logs warning messages and error messages during a build. (Not extendable. Internal use only.)|
45-
|[XDCMake Task](../msbuild/xdcmake-task.md)|Wraps the XML Documentation tool (xdcmake.exe), which merges XML document comment (.xdc) files into an .xml file.|
46-
|[XSD Task](../msbuild/xsd-task.md)|Wraps the XML Schema Definition tool (xsd.exe), which generates schema or class files from a source. *See note below.*|
47-
|[MSBuild Reference](../msbuild/msbuild-reference.md)|Describes the elements of the MSBuild system.|
35+
|[BscMake task](../msbuild/bscmake-task.md)|Wraps the Microsoft Browse Information Maintenance Utility tool (*bscmake.exe*).|
36+
|[CL task](../msbuild/cl-task.md)|Wraps the Visual C++ compiler tool (*cl.exe*).|
37+
|[CPPClean task](../msbuild/cppclean-task.md)|Deletes the temporary files that MSBuild creates when a Visual C++ project is built.|
38+
|[LIB task](../msbuild/lib-task.md)|Wraps the Microsoft 32-Bit Library Manager tool (*lib.exe*).|
39+
|[Link task](../msbuild/link-task.md)|Wraps the Visual C++ linker tool (*link.exe*).|
40+
|[MIDL task](../msbuild/midl-task.md)|Wraps the Microsoft Interface Definition Language (MIDL) compiler tool (*midl.exe*).|
41+
|[MT task](../msbuild/mt-task.md)|Wraps the Microsoft Manifest Tool (*mt.exe*).|
42+
|[RC task](../msbuild/rc-task.md)|Wraps the Microsoft Windows Resource Compiler tool (*rc.exe*).|
43+
|[SetEnv task](../msbuild/setenv-task.md)|Sets or deletes the value of a specified environment variable.|
44+
|[VCMessage task](../msbuild/vcmessage-task.md)|Logs warning messages and error messages during a build. (Not extendable. Internal use only.)|
45+
|[XDCMake task](../msbuild/xdcmake-task.md)|Wraps the XML Documentation tool (*xdcmake.exe*), which merges XML document comment (*.xdc*) files into an *.xml* file.|
46+
|[XSD task](../msbuild/xsd-task.md)|Wraps the XML Schema Definition tool (*xsd.exe*), which generates schema or class files from a source. *See note below.*|
47+
|[MSBuild reference](../msbuild/msbuild-reference.md)|Describes the elements of the MSBuild system.|
4848
|[Tasks](../msbuild/msbuild-tasks.md)|Describes tasks, which are units of code that can be combined to produce a build.|
49-
|[Task Writing](../msbuild/task-writing.md)|Describes how to create a task.|
49+
|[Task writing](../msbuild/task-writing.md)|Describes how to create a task.|
5050

5151
> [!NOTE]
52-
> In Visual Studio 2017, C++ project support for xsd.exe is deprecated. You can still use the **Microsoft.VisualC.CppCodeProvider** APIs by manually adding **CppCodeProvider.dll** to the GAC.
52+
> In Visual Studio 2017, C++ project support for *xsd.exe* is deprecated. You can still use the **Microsoft.VisualC.CppCodeProvider** APIs by manually adding *CppCodeProvider.dll* to the GAC.

0 commit comments

Comments
 (0)