Skip to content

Commit 76c85d8

Browse files
authored
Edits to extension point materials
1 parent 00387ae commit 76c85d8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/reference/msbuild-targets.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: NuGet pack and restore as MSBuild targets | Microsoft Docs
33
author: kraigb
44
ms.author: kraigb
55
manager: ghogen
6-
ms.date: 03/13/2018
6+
ms.date: 03/23/2018
77
ms.topic: article
88
ms.prod: nuget
99
ms.technology: null
@@ -227,19 +227,21 @@ An example of a csproj file to pack a nuspec file is:
227227
</Project>
228228
```
229229

230-
### Advanced Extension Points to create customized package
230+
### Advanced extension points to create customized package
231231

232-
The Pack target provides two extension points which run in the inner build (target framework specific build) with the goal of being able to pack target framework specific content/assemblies into a package.
232+
The `pack` target provides two extension points that run in the inner, target framework specific build. The extension points support including target framework specific content and assemblies into a package:
233233

234-
#### For files that need to go inside lib folder (or folder specified via BuildOutputTargetFolder)
234+
- `TargetsForTfmSpecificBuildOutput` target: Use for files inside the `lib` folder or a folder specified using `BuildOutputTargetFolder`.
235+
- `TargetsForTfmSpecificContentInPackage` target: Use for files outside the `BuildOutputTargetFolder`.
235236

236-
A package author can write their own custom target and specify it as the value of the property ```$(TargetsForTfmSpecificBuildOutput)```. The target should write out any files that need to go into the ```BuildOutputTargetFolder (lib by default)``` into the ItemGroup ```BuildOutputInPackage``` and set the following two metadata values :
237+
#### TargetsForTfmSpecificBuildOutput
237238

238-
```a) FinalOutputPath :``` This is the absolute path of the file on disk (if not provided, the Identity is used to evaluate source path)
239+
Write a custom target and specify it as the value of the `$(TargetsForTfmSpecificBuildOutput)` property. For any files that need to go into the `BuildOutputTargetFolder` (lib by default), the target should write those files into the ItemGroup `BuildOutputInPackage` and set the following two metadata values:
239240

240-
```b) TargetPath :``` This is optional and defaults to the name of the file. Package authors need to set it when the file needs to go into a subfolder within ```lib\<TargetFramework>``` , like satellite assemblies, which go under their respective culture folders.
241+
- `FinalOutputPath`: The absolute path of the file; if not provided, the Identity is used to evaluate source path.
242+
- `TargetPath`: (Optional) Set when the file needs to go into a subfolder within `lib\<TargetFramework>` , like satellite assemblies that go under their respective culture folders. Defaults to the name of the file.
241243

242-
An example:
244+
Example:
243245

244246
```
245247
<PropertyGroup>
@@ -253,16 +255,14 @@ An example:
253255
</BuildOutputInPackage>
254256
</ItemGroup>
255257
</Target>
256-
257258
```
258259

259-
#### For files outside of BuildOutputTargetFolder
260-
261-
A similar extension point has been provided for files that need to be packed outside of lib folder but are still specific to a target framework. Package authors can write their own custom target and specify it as the value of the property ```$(TargetsForTfmSpecificContentInPackage)```. The target should write out any files that need to be included in the package into the ItemGroup ```TfmSpecificPackageFile``` and set the following optional metadata:
260+
#### TargetsForTfmSpecificContentInPackage
262261

263-
```a) PackagePath :``` Path where the file should be output in the package. NuGet will throw a warning if more than one file is added to the same package path.
262+
Write a custom target and specify it as the value of the `$(TargetsForTfmSpecificContentInPackage)` property. For any files to include in the package, the target should write those files into the ItemGroup `TfmSpecificPackageFile` and set the following optional metadata:
264263

265-
```b) BuildAction:``` Default value has been set to None. This is only required if the package path is in contentFiles folder.
264+
- `PackagePath`: Path where the file should be output in the package. NuGet issues a warning if more than one file is added to the same package path.
265+
- `BuildAction`: The build action to assign to the file, required only if the package path is in the `contentFiles` folder. Defaults to "None".
266266

267267
An example:
268268
```

0 commit comments

Comments
 (0)