You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/msbuild-targets.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: NuGet pack and restore as MSBuild targets | Microsoft Docs
3
3
author: kraigb
4
4
ms.author: kraigb
5
5
manager: ghogen
6
-
ms.date: 03/13/2018
6
+
ms.date: 03/23/2018
7
7
ms.topic: article
8
8
ms.prod: nuget
9
9
ms.technology: null
@@ -227,19 +227,21 @@ An example of a csproj file to pack a nuspec file is:
227
227
</Project>
228
228
```
229
229
230
-
### Advanced Extension Points to create customized package
230
+
### Advanced extension points to create customized package
231
231
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:
233
233
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`.
235
236
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
237
238
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:
239
240
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.
241
243
242
-
An example:
244
+
Example:
243
245
244
246
```
245
247
<PropertyGroup>
@@ -253,16 +255,14 @@ An example:
253
255
</BuildOutputInPackage>
254
256
</ItemGroup>
255
257
</Target>
256
-
257
258
```
258
259
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
262
261
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:
264
263
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".
0 commit comments