Skip to content

Commit 9c26222

Browse files
authored
Merge pull request #2481 from v-thepet/msbuild2
MBuild PR #7
2 parents 363849f + acfc9f5 commit 9c26222

10 files changed

+108
-110
lines changed

docs/msbuild/how-to-select-the-files-to-build.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ manager: douge
1515
ms.workload:
1616
- "multiple"
1717
---
18-
# How to: Select the Files to Build
18+
# How to: Select the files to build
1919
When you build a project that contains several files, you can list each file separately in the project file, or you can use wildcards to include all the files in one directory or a nested set of directories.
2020

21-
## Specifying Inputs
21+
## Specify inputs
2222
Items represent the inputs for a build. For more information on items, see [Items](../msbuild/msbuild-items.md).
2323

2424
To include files for a build, they must be included in an item list in the [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project file. Multiple files can be added to item lists by either including the files individually or using wildcards to include many files at once.
@@ -29,7 +29,7 @@ When you build a project that contains several files, you can list each file sep
2929

3030
`<CSFile Include="form1.cs"/>`
3131

32-
- or -
32+
or
3333

3434
`<VBFile Include="form1.vb"/>`
3535

@@ -42,44 +42,44 @@ When you build a project that contains several files, you can list each file sep
4242

4343
`<CSFile Include="form1.cs;form2.cs"/>`
4444

45-
- or -
45+
or
4646

4747
`<VBFile Include="form1.vb;form2.vb"/>`
4848

49-
## Specifying Inputs with Wildcards
49+
## Specify inputs with wildcards
5050
You can also use wildcards to recursively include all files or only specific files from subdirectories as inputs for a build. For more information about wildcards, see [Items](../msbuild/msbuild-items.md)
5151

52-
The following examples are based on a project that contains graphics files in the following directories and subdirectories, with the project file located in the Project directory:
52+
The following examples are based on a project that contains graphics files in the following directories and subdirectories, with the project file located in the *Project* directory:
5353

54-
Project\Images\BestJpgs
54+
*Project\Images\BestJpgs*
5555

56-
Project\Images\ImgJpgs
56+
*Project\Images\ImgJpgs*
5757

58-
Project\Images\ImgJpgs\Img1
58+
*Project\Images\ImgJpgs\Img1*
5959

60-
#### To include all .jpg files in the Images directory and subdirectories
60+
#### To include all *.jpg* files in the *Images* directory and subdirectories
6161

6262
- Use the following `Include` attribute:
6363

6464
`Include="Images\**\*.jpg"`
6565

66-
#### To include all .jpg files starting with "img"
66+
#### To include all *.jpg* files starting with *img*
6767

6868
- Use the following `Include` attribute:
6969

7070
`Include="Images\**\img*.jpg"`
7171

72-
#### To include all files in directories with names ending in "jpgs"
72+
#### To include all files in directories with names ending in *jpgs*
7373

7474
- Use one of the following `Include` attributes:
7575

7676
`Include="Images\**\*jpgs\*.*"`
7777

78-
- or -
78+
or
7979

8080
`Include="Images\**\*jpgs\*"`
8181

82-
## Passing Items to a Task
82+
## Pass items to a task
8383
In a project file, you can use the @() notation in tasks to specify an entire item list as the input for a build. You can use this notation whether you list all files separately or use wildcards.
8484

8585
#### To use all Visual C# or Visual Basic files as inputs
@@ -88,12 +88,12 @@ When you build a project that contains several files, you can list each file sep
8888

8989
`<CSC Sources="@(CSFile)">...</CSC>`
9090

91-
- or -
91+
or
9292

9393
`<VBC Sources="@(VBFile)">...</VBC>`
9494

9595
> [!NOTE]
96-
> You must use wildcards with items to specifiy the inputs for a build; you cannot specify the inputs using the `Sources` attribute in [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] tasks such as [Csc](../msbuild/csc-task.md) or [Vbc](../msbuild/vbc-task.md). The following example is not valid in a project file:
96+
> You must use wildcards with items to specify the inputs for a build; you cannot specify the inputs using the `Sources` attribute in [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] tasks such as [Csc](../msbuild/csc-task.md) or [Vbc](../msbuild/vbc-task.md). The following example is not valid in a project file:
9797
>
9898
> `<CSC Sources="*.cs">...</CSC>`
9999
@@ -132,7 +132,7 @@ When you build a project that contains several files, you can list each file sep
132132
```
133133

134134
## Example
135-
The following code example uses a wildcard to include all the .cs files.
135+
The following code example uses a wildcard to include all the *.cs* files.
136136

137137
```xml
138138
<Project DefaultTargets="Compile"
@@ -165,6 +165,6 @@ When you build a project that contains several files, you can list each file sep
165165
</Project>
166166
```
167167

168-
## See Also
169-
[How to: Exclude Files from the Build](../msbuild/how-to-exclude-files-from-the-build.md)
170-
[Items](../msbuild/msbuild-items.md)
168+
## See also
169+
[How to: Exclude files from the build](../msbuild/how-to-exclude-files-from-the-build.md)
170+
[Items](../msbuild/msbuild-items.md)

docs/msbuild/how-to-specify-which-target-to-build-first.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ manager: douge
1515
ms.workload:
1616
- "multiple"
1717
---
18-
# How to: Specify Which Target to Build First
18+
# How to: Specify which target to build first
1919
A project file can contain one or more `Target` elements that define how the project is built. The [!INCLUDE[vstecmsbuildengine](../msbuild/includes/vstecmsbuildengine_md.md)] ([!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)]) engine builds the first project it finds, and any dependencies, unless the project file contains a `DefaultTargets` attribute, an `InitialTargets` attribute, or a target is specified at the command line using the **/target** switch.
2020

21-
## Using the InitialTargets Attribute
21+
## Use the InitialTargets attribute
2222
The `InitialTargets` attribute of the `Project` element specifies a target that will run first, even if targets are specified on the command line or in the `DefaultTargets` attribute.
2323

2424
#### To specify one initial target
@@ -35,7 +35,7 @@ A project file can contain one or more `Target` elements that define how the pro
3535

3636
`<Project InitialTargets="Clean;Compile">`
3737

38-
## Using the DefaultTargets Attribute
38+
## Use the DefaultTargets attribute
3939
The `DefaultTargets` attribute of the `Project` element specifies which target or targets are built if a target is not specified explicitly on the command line. If targets are specified in both the `InitialTargets` and `DefaultTargets` attributes and no target is specified on the command line, [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] runs the targets specified in the `InitialTargets` attribute followed by the targets specified in the `DefaultTargets` attribute.
4040

4141
#### To specify one default target
@@ -52,7 +52,7 @@ A project file can contain one or more `Target` elements that define how the pro
5252

5353
`<Project DefaultTargets="Clean;Compile">`
5454

55-
## Using the /target Switch
55+
## Use the /target Switch
5656
If a default target is not defined in the project file, or if you do not want to use that default target, you can use the command line switch **/target** to specify a different target. The target or targets specified with the **/target** switch are run instead of the targets specified by the `DefaultTargets` attribute. Targets specified in the `InitialTargets` attribute always run first.
5757

5858
#### To use a target other than the default target first
@@ -67,7 +67,7 @@ A project file can contain one or more `Target` elements that define how the pro
6767

6868
`msbuild <file name>.proj /t:Clean;Compile`
6969

70-
## See Also
70+
## See also
7171
[MSBuild](../msbuild/msbuild.md)
7272
[Targets](../msbuild/msbuild-targets.md)
73-
[How to: Clean a Build](../msbuild/how-to-clean-a-build.md)
73+
[How to: Clean a build](../msbuild/how-to-clean-a-build.md)

docs/msbuild/how-to-use-environment-variables-in-a-build.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ manager: douge
1515
ms.workload:
1616
- "multiple"
1717
---
18-
# How to: Use Environment Variables in a Build
18+
# How to: Use environment variables in a build
1919
When you build projects, it is often necessary to set build options using information that is not in the project file or the files that comprise your project. This information is typically stored in environment variables.
2020

21-
## Referencing Environment Variables
21+
## Reference environment variables
2222
All environment variables are available to the [!INCLUDE[vstecmsbuildengine](../msbuild/includes/vstecmsbuildengine_md.md)] ([!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)]) project file as properties.
2323

2424
> [!NOTE]
@@ -34,7 +34,7 @@ When you build projects, it is often necessary to set build options using inform
3434

3535
#### To provide a default value for a property
3636

37-
- Use a `Condition` attribute on a property to set the value only if the property has no value. For example, the following code sets the `ToolsPath` property to c:\tools only if the `ToolsPath` environment variable is not set:
37+
- Use a `Condition` attribute on a property to set the value only if the property has no value. For example, the following code sets the `ToolsPath` property to *c:\tools* only if the `ToolsPath` environment variable is not set:
3838

3939
`<ToolsPath Condition="'$(TOOLSPATH)' == ''">c:\tools</ToolsPath>`
4040

@@ -58,7 +58,7 @@ When you build projects, it is often necessary to set build options using inform
5858
</Project>
5959
```
6060

61-
## See Also
61+
## See also
6262
[MSBuild ](../msbuild/msbuild.md)
63-
[MSBuild Properties](../msbuild/msbuild-properties.md)
64-
[How to: Build the Same Source Files with Different Options](../msbuild/how-to-build-the-same-source-files-with-different-options.md)
63+
[MSBuild properties](../msbuild/msbuild-properties.md)
64+
[How to: Build the same source files with different options](../msbuild/how-to-build-the-same-source-files-with-different-options.md)

docs/msbuild/how-to-use-project-sdk.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ manager: douge
1212
ms.workload:
1313
- "multiple"
1414
---
15-
# How to: Use MSBuild Project SDKs
15+
# How to: Use MSBuild project SDKs
1616

1717
[!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] 15.0 introduced the concept of the "project SDK", which simplifies using software development kits that require properties and targets to be imported.
1818

@@ -40,9 +40,9 @@ During evaluation of the project, [!INCLUDE[vstecmsbuild](../extensibility/inter
4040
</Project>
4141
```
4242

43-
## Referencing a Project SDK
43+
## Reference a project SDK
4444

45-
There are three ways to reference a project SDK
45+
There are three ways to reference a project SDK:
4646

4747
1. Use the `Sdk` attribute on the `<Project/>` element:
4848

@@ -82,7 +82,7 @@ During evaluation of the project, [!INCLUDE[vstecmsbuild](../extensibility/inter
8282

8383
When using the `<Import/>` element, you can specify an optional `Version` attribute as well. For example, you can specify `<Import Project="Sdk.props" Sdk="My.Custom.Sdk" Version="1.2.3" />`.
8484

85-
## How Project SDKs are Resolved
85+
## How project SDKs are resolved
8686

8787
When evaluating the import, [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] dynamically resolves the path to the project SDK based on the name and version you specified. [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] also has a list of registered SDK resolvers which are plug-ins that locate project SDKs on your machine. These plug-ins include:
8888

@@ -103,11 +103,11 @@ The NuGet-based SDK resolver supports specifying a version in your [global.json]
103103
}
104104
```
105105

106-
Only one version of each project SDK can be used during a build. If you are referencing two different versions of the same project SDK, MSBuild will emit a warning. It is recommended to **not** specify a version in your projects if a version is specified in your `global.json`.
106+
Only one version of each project SDK can be used during a build. If you are referencing two different versions of the same project SDK, MSBuild will emit a warning. It is recommended to **not** specify a version in your projects if a version is specified in your *global.json*.
107107

108-
## See Also
108+
## See also
109109

110-
[MSBuild Concepts](../msbuild/msbuild-concepts.md)
111-
[Customize Your Build](../msbuild/customize-your-build.md)
112-
[Packages, Metadata, and Frameworks](/dotnet/core/packages)
110+
[MSBuild concepts](../msbuild/msbuild-concepts.md)
111+
[Customize your build](../msbuild/customize-your-build.md)
112+
[Packages, metadata, and frameworks](/dotnet/core/packages)
113113
[Additions to the csproj format for .NET Core](/dotnet/core/tools/csproj)

docs/msbuild/how-to-use-reserved-xml-characters-in-project-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ manager: douge
1414
ms.workload:
1515
- "multiple"
1616
---
17-
# How to: Use Reserved XML Characters in Project Files
17+
# How to: Use reserved XML characters in project files
1818
When you author project files, you might need to use reserved XML characters, for example, in property values or in task parameter values. However, some reserved characters must be replaced by a named entity so that the project file can be parsed.
1919

20-
## Using Reserved Characters
20+
## Use reserved characters
2121
The following table describes the reserved XML characters that must be replaced by the corresponding named entity so that the project file can be parsed.
2222

2323
|Reserved character|Named entity|
@@ -66,6 +66,6 @@ When you author project files, you might need to use reserved XML characters, fo
6666
</Project>
6767
```
6868

69-
## See Also
70-
[MSBuild Reference](../msbuild/msbuild-reference.md)
69+
## See also
70+
[MSBuild reference](../msbuild/msbuild-reference.md)
7171
[MSBuild](../msbuild/msbuild.md)

docs/msbuild/how-to-use-the-same-target-in-multiple-project-files.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ manager: douge
1414
ms.workload:
1515
- "multiple"
1616
---
17-
# How to: Use the Same Target in Multiple Project Files
17+
# How to: Use the same target in multiple project files
1818
If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project files, you might have discovered that you need to use the same tasks and targets in different project files. Instead of including the complete description of those tasks or targets in every project file, you can save a target in a separate project file and then import that project into any other project that needs to use the target.
1919

20-
## Using the Import Element
21-
The `Import` element is used to insert one project file into another project file. The project file that is being imported must be a valid [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project file and contain well-formed XML. The `Project` attribute specifies the path to the imported project file. For more information on the `Import` element, see [Import Element (MSBuild)](../msbuild/import-element-msbuild.md).
20+
## Use the Import element
21+
The `Import` element is used to insert one project file into another project file. The project file that is being imported must be a valid [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project file and contain well-formed XML. The `Project` attribute specifies the path to the imported project file. For more information on the `Import` element, see [Import element (MSBuild)](../msbuild/import-element-msbuild.md).
2222

2323
#### To import a project
2424

@@ -30,10 +30,10 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
3030

3131
3. Following the `Import` element, define all properties and items that must override default definitions of properties and items in the imported project.
3232

33-
## Order of Evaluation
33+
## Order of evaluation
3434
When [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] reaches an `Import` element, the imported project is effectively inserted into the importing project at the location of the `Import` element. Therefore, the location of the `Import` element can affect the values of properties and items. It is important to understand the properties and items that are set by the imported project, and the properties and items that the imported project uses.
3535

36-
When the project builds, all properties are evaluated first, followed by items. For example, the following XML defines the imported project file MyCommon.targets:
36+
When the project builds, all properties are evaluated first, followed by items. For example, the following XML defines the imported project file *MyCommon.targets*:
3737

3838
```xml
3939
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -47,7 +47,7 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
4747
</Project>
4848
```
4949

50-
The following XML defines MyApp.proj, which imports MyCommon.targets:
50+
The following XML defines *MyApp.proj*, which imports *MyCommon.targets*:
5151

5252
```xml
5353
<Project
@@ -64,7 +64,7 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
6464

6565
`Name="MyCommon"`
6666

67-
Because the project is imported after the property `Name` has been defined in MyApp.proj, the definition of `Name` in MyCommon.targets overrides the definition in MyApp.proj. If, the project is imported before the property Name is defined, the build would display the following message:
67+
Because the project is imported after the property `Name` has been defined in *MyApp.proj*, the definition of `Name` in *MyCommon.targets* overrides the definition in *MyApp.proj*. If the project is imported before the property Name is defined, the build would display the following message:
6868

6969
`Name="MyApp"`
7070

@@ -77,7 +77,7 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
7777
3. Define in the project file all properties and items that must override default definitions of properties and items in the imported project.
7878

7979
## Example
80-
The following code example shows the MyCommon.targets file that the second code example imports. The .targets file evaluates properties from the importing project to configure the build.
80+
The following code example shows the *MyCommon.targets* file that the second code example imports. The *.targets* file evaluates properties from the importing project to configure the build.
8181

8282
```xml
8383
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -95,7 +95,7 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
9595
```
9696

9797
## Example
98-
The following code example imports the MyCommon.targets file.
98+
The following code example imports the *MyCommon.targets* file.
9999

100100
```xml
101101
<Project DefaultTargets="Build"
@@ -107,6 +107,6 @@ If you have authored several [!INCLUDE[vstecmsbuild](../extensibility/internals/
107107
</Project>
108108
```
109109

110-
## See Also
111-
[Import Element (MSBuild)](../msbuild/import-element-msbuild.md)
110+
## See also
111+
[Import element (MSBuild)](../msbuild/import-element-msbuild.md)
112112
[Targets](../msbuild/msbuild-targets.md)

0 commit comments

Comments
 (0)