Skip to content

Commit 2c5b57b

Browse files
committed
Rename BuildOutputFrameworkSpecific > PackFrameworkSpecific for consistency
Since a packaging project (for example) doesn't actually contain build artifacts but can still default its root content to a framework-specific folder, we should instead adopt the uniform `Pack*` prefix we now use everywhere. Fixes #438
1 parent 6ad70a9 commit 2c5b57b

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

src/NuGetizer.Tasks/NuGetizer.Authoring.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Copyright (c) .NET Foundation. All rights reserved.
2525

2626
<PackBuildOutput>false</PackBuildOutput>
2727
<PackFolder>Ignore</PackFolder>
28-
<BuildOutputFrameworkSpecific>false</BuildOutputFrameworkSpecific>
28+
<PackFrameworkSpecific>false</PackFrameworkSpecific>
2929
</PropertyGroup>
3030

3131
<!--

src/NuGetizer.Tasks/NuGetizer.Compatibility.props

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Copyright (c) .NET Foundation. All rights reserved.
4444
<PackFrameworkReferences Condition="'$(PackFrameworkReferences)' == '' and '$(IncludeFrameworkReferencesInPackage)' != ''">$(IncludeFrameworkReferencesInPackage)</PackFrameworkReferences>
4545
<PackProjectReferences Condition="'$(PackProjectReferences)' == '' and '$(PackProjectReference)' != ''">true</PackProjectReferences>
4646

47-
<DevelopmentDependency Condition="'$(IsDevelopmentDependency)' != ''">$(IsDevelopmentDependency)</DevelopmentDependency>
47+
<DevelopmentDependency Condition="'$(DevelopmentDependency)' == '' and '$(IsDevelopmentDependency)' != ''">$(IsDevelopmentDependency)</DevelopmentDependency>
48+
49+
<PackFrameworkSpecific Condition="'$(PackFrameworkSpecific)' == '' and '$(BuildOutputFrameworkSpecific)' != ''">$(BuildOutputFrameworkSpecific)</PackFrameworkSpecific>
4850
</PropertyGroup>
4951

5052
</Project>

src/NuGetizer.Tasks/NuGetizer.Inference.targets

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Copyright (c) .NET Foundation. All rights reserved.
240240

241241
<ItemGroup Condition="'$(PackInferenceIdentity)' == 'None' and ('$(PackFolder)' == 'build' or '$(PackFolder)' == 'buildTransitive')">
242242
<None Update="@(None)" Condition="'%(None.PackFolder)' == ''" PackFolder="$(PackFolder)" />
243-
<None Update="@(None)" Condition="'%(None.FrameworkSpecific)' == ''" FrameworkSpecific="$(BuildOutputFrameworkSpecific)" />
243+
<None Update="@(None)" Condition="'%(None.FrameworkSpecific)' == ''" FrameworkSpecific="$(PackFrameworkSpecific)" />
244244
</ItemGroup>
245245

246246
<!-- If we have an exclude wildcard to evaluate, do so and keep only non-matching items -->
@@ -362,13 +362,13 @@ Copyright (c) .NET Foundation. All rights reserved.
362362
@(DocumentationProjectOutputGroupOutput -> '%(FinalOutputPath)');
363363
@(_SatelliteDllsProjectOutputGroupOutput -> '%(FinalOutputPath)')">
364364
<PackFolder>$(PackFolder)</PackFolder>
365-
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
365+
<FrameworkSpecific>$(PackFrameworkSpecific)</FrameworkSpecific>
366366
</_InferredProjectOutput>
367367

368368
<_InferredProjectOutput Include="@(DebugSymbolsProjectOutputGroupOutput -> '%(FinalOutputPath)')"
369369
Condition="'$(PackSymbols)' != 'false'">
370370
<PackFolder>$(PackFolder)</PackFolder>
371-
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
371+
<FrameworkSpecific>$(PackFrameworkSpecific)</FrameworkSpecific>
372372
</_InferredProjectOutput>
373373

374374
<_InferredPackageFile Include="@(_InferredProjectOutput -> Distinct())" />
@@ -379,7 +379,7 @@ Copyright (c) .NET Foundation. All rights reserved.
379379
<_InferredPackageFile Include="@(ResourceCopyLocalItems)"
380380
PackFolder="$(PackFolder)"
381381
TargetPath="%(ResourceCopyLocalItems.DestinationSubPath)"
382-
FrameworkSpecific="$(BuildOutputFrameworkSpecific)"
382+
FrameworkSpecific="$(PackFrameworkSpecific)"
383383
Condition="$(PrivatePackageReferenceIds.Contains(';%(ResourceCopyLocalItems.NuGetPackageId);'))" />
384384
</ItemGroup>
385385

@@ -388,7 +388,7 @@ Copyright (c) .NET Foundation. All rights reserved.
388388
<_InferredPackageFile Include="@(_InferredPublishItem -> '%(FullPath)')">
389389
<PackFolder>$(PackFolder)</PackFolder>
390390
<FrameworkSpecific>false</FrameworkSpecific>
391-
<!-- NOTE: we don't set `BuildOutputFrameworkSpecific` since we're not packing the build output
391+
<!-- NOTE: we don't set `PackFrameworkSpecific` since we're not packing the build output
392392
but rather the *publish* output. Users could change that by setting a TF-specific PackFolder -->
393393
</_InferredPackageFile>
394394
</ItemGroup>
@@ -402,7 +402,7 @@ Copyright (c) .NET Foundation. All rights reserved.
402402
'%(PackageReference.Pack)' != 'false' and
403403
('%(PackageReference.PrivateAssets)' != 'all' or '%(PackageReference.Pack)' == 'true')">
404404
<PackFolder>Dependency</PackFolder>
405-
<!--<FrameworkSpecific Condition="'$(BuildOutputFrameworkSpecific)' == 'true'">true</FrameworkSpecific>-->
405+
<!--<FrameworkSpecific Condition="'$(PackFrameworkSpecific)' == 'true'">true</FrameworkSpecific>-->
406406
</_InferredPackageFile>
407407

408408
<!-- We can't use %(FrameworkFile)==true because it's not defined for raw file references and
@@ -427,7 +427,7 @@ Copyright (c) .NET Foundation. All rights reserved.
427427
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
428428
<Platform>$(Platform)</Platform>
429429
<OriginalTargetFramework>$(PackTargetFramework)</OriginalTargetFramework>
430-
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
430+
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(PackFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
431431
</PackageFile>
432432
</ItemGroup>
433433
</Target>
@@ -544,7 +544,7 @@ Copyright (c) .NET Foundation. All rights reserved.
544544
<ItemGroup Condition="'$(_ShouldPack)' != 'false' and '$(_PrivateAssets)' == 'all'">
545545
<_InferredPackageFile Include="@(_PrimaryOutputFinalFile)">
546546
<PackFolder>$(PackFolder)</PackFolder>
547-
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
547+
<FrameworkSpecific>$(PackFrameworkSpecific)</FrameworkSpecific>
548548
</_InferredPackageFile>
549549
</ItemGroup>
550550

@@ -555,7 +555,7 @@ Copyright (c) .NET Foundation. All rights reserved.
555555
<_InferredPackageFile Include="@(_PrimaryOutputFinalFile)"
556556
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(_PrimaryOutputFinalFile.FullPath)', '$(_ShouldIncludeAssetsRegex)', 'RegexOptions.IgnoreCase')) == 'true'">
557557
<PackFolder>$(PackFolder)</PackFolder>
558-
<FrameworkSpecific>$(BuildOutputFrameworkSpecific)</FrameworkSpecific>
558+
<FrameworkSpecific>$(PackFrameworkSpecific)</FrameworkSpecific>
559559
</_InferredPackageFile>
560560
</ItemGroup>
561561
</Target>

src/NuGetizer.Tasks/NuGetizer.targets

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
99
Copyright (c) .NET Foundation. All rights reserved.
1010
***********************************************************************************************
1111
-->
12-
<Project InitialTargets="_SetPropertiesFromCapabilities;_SetBuildOutputFrameworkSpecific" TreatAsLocalProperty="PackFolder" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12+
<Project InitialTargets="_SetPropertiesFromCapabilities;_SetPackFrameworkSpecific" TreatAsLocalProperty="PackFolder" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1313
<UsingTask TaskName="NuGetizer.Tasks.AssignPackagePath" AssemblyFile="NuGetizer.Tasks.dll" />
1414
<UsingTask TaskName="NuGetizer.Tasks.WriteItemsToFile" AssemblyFile="NuGetizer.Tasks.dll" />
1515

@@ -66,7 +66,7 @@ Copyright (c) .NET Foundation. All rights reserved.
6666
<PackageFile>
6767
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
6868
<Platform Condition="'%(PackageFile.Platform)' == ''">$(Platform)</Platform>
69-
<DefaultTargetFramework Condition="'%(PackageFile.DefaultTargetFramework)' == '' and ('$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true')">$(PackTargetFramework)</DefaultTargetFramework>
69+
<DefaultTargetFramework Condition="'%(PackageFile.DefaultTargetFramework)' == '' and ('$(IsPackagingProject)' != 'true' or '$(PackFrameworkSpecific)' == 'true')">$(PackTargetFramework)</DefaultTargetFramework>
7070
</PackageFile>
7171
</ItemGroup>
7272

@@ -128,7 +128,7 @@ Copyright (c) .NET Foundation. All rights reserved.
128128
<PackFolder>Metadata</PackFolder>
129129
<PackageId>$(PackageId)</PackageId>
130130
<Platform>$(Platform)</Platform>
131-
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
131+
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(PackFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
132132
</PackageFile>
133133
</ItemGroup>
134134
</Target>
@@ -179,7 +179,7 @@ Copyright (c) .NET Foundation. All rights reserved.
179179
'%(_ReferencedPackageContent.PackFolder)' == 'Metadata'">
180180
<!-- For consistency, annotate like the rest -->
181181
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
182-
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
182+
<DefaultTargetFramework Condition="'$(IsPackagingProject)' != 'true' or '$(PackFrameworkSpecific)' == 'true'">$(PackTargetFramework)</DefaultTargetFramework>
183183
<PackFolder>Dependency</PackFolder>
184184
</_ReferencedPackageDependency>
185185
<!-- Remove the referenced package actual contents if it provides a manifest, since it will be a dependency in that case. -->
@@ -198,7 +198,7 @@ Copyright (c) .NET Foundation. All rights reserved.
198198

199199
<!-- We don't retarget referenced content for packaging projects that aren't framework specific, and
200200
never retarget content that already has a PackageId. -->
201-
<ItemGroup Condition="'$(IsPackagingProject)' != 'true' or '$(BuildOutputFrameworkSpecific)' == 'true'">
201+
<ItemGroup Condition="'$(IsPackagingProject)' != 'true' or '$(PackFrameworkSpecific)' == 'true'">
202202
<_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''">
203203
<!-- Assign current package id if appropriate -->
204204
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
@@ -220,7 +220,7 @@ Copyright (c) .NET Foundation. All rights reserved.
220220
</ItemGroup>
221221

222222
<!-- Otherwise, assign target paths based on the original TFM -->
223-
<ItemGroup Condition="'$(IsPackagingProject)' == 'true' and '$(BuildOutputFrameworkSpecific)' != 'true'">
223+
<ItemGroup Condition="'$(IsPackagingProject)' == 'true' and '$(PackFrameworkSpecific)' != 'true'">
224224
<_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''">
225225
<!-- Assign current package id if appropriate -->
226226
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
@@ -277,8 +277,8 @@ Copyright (c) .NET Foundation. All rights reserved.
277277
<AdditionalProperties Condition="'$(_PrivateAssets)' == 'all'">IsPackable=false;%(_MSBuildProjectReferenceExistent.AdditionalProperties)</AdditionalProperties>
278278
<!-- If the project reference itself declares a PackFolder, use that instead of the calling project's -->
279279
<SetPackFolder Condition="'%(PackFolder)' != ''">PackFolder=%(PackFolder)</SetPackFolder>
280-
<!-- Otherwise, set both PackFolder and BuildOutputFrameworkSpecific so it will match the caller's -->
281-
<SetPackFolder Condition="'%(PackFolder)' == '' and '$(_PrivateAssets)' == 'all' and '$(PackFolder)' != '' and '$(PackFolder)' != 'Ignore'">PackFolder=$(PackFolder);BuildOutputFrameworkSpecific=$(BuildOutputFrameworkSpecific)</SetPackFolder>
280+
<!-- Otherwise, set both PackFolder and PackFrameworkSpecific so it will match the caller's -->
281+
<SetPackFolder Condition="'%(PackFolder)' == '' and '$(_PrivateAssets)' == 'all' and '$(PackFolder)' != '' and '$(PackFolder)' != 'Ignore'">PackFolder=$(PackFolder);PackFrameworkSpecific=$(PackFrameworkSpecific)</SetPackFolder>
282282
</_NuGetizedProjectReference>
283283
</ItemGroup>
284284

@@ -298,14 +298,14 @@ Copyright (c) .NET Foundation. All rights reserved.
298298
</PropertyGroup>
299299
</Target>
300300

301-
<Target Name="_SetBuildOutputFrameworkSpecific" Condition="'$(BuildOutputFrameworkSpecific)' == ''">
301+
<Target Name="_SetPackFrameworkSpecific" Condition="'$(PackFrameworkSpecific)' == ''">
302302
<!-- Determine whether primary output is framework specific -->
303303
<ItemGroup>
304-
<_BuildOutputFrameworkSpecific Include="@(PackFolderKind -> '%(FrameworkSpecific)')" Condition="'%(Identity)' == '$(PackFolder)'" />
304+
<_PackFrameworkSpecific Include="@(PackFolderKind -> '%(FrameworkSpecific)')" Condition="'%(Identity)' == '$(PackFolder)'" />
305305
</ItemGroup>
306306
<PropertyGroup>
307-
<BuildOutputFrameworkSpecific>@(_BuildOutputFrameworkSpecific)</BuildOutputFrameworkSpecific>
308-
<BuildOutputFrameworkSpecific Condition="'$(BuildOutputFrameworkSpecific)' == ''">false</BuildOutputFrameworkSpecific>
307+
<PackFrameworkSpecific>@(_PackFrameworkSpecific)</PackFrameworkSpecific>
308+
<PackFrameworkSpecific Condition="'$(PackFrameworkSpecific)' == ''">false</PackFrameworkSpecific>
309309
</PropertyGroup>
310310
</Target>
311311

src/NuGetizer.Tests/given_a_packaging_project.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ public void when_framework_specific_then_retargets_direct_and_referenced_content
182182
<PackageId>Packer</PackageId>
183183
<TargetFramework>net6.0</TargetFramework>
184184
<PackFolder>build</PackFolder>
185-
<BuildOutputFrameworkSpecific>true</BuildOutputFrameworkSpecific>
185+
<PackFrameworkSpecific>true</PackFrameworkSpecific>
186186
</PropertyGroup>
187187
<ItemGroup>
188188
<ProjectReference Include='Tasks.csproj' PrivateAssets='all' />
189189
<!-- NOTE: for other stuff, we can put it in the same folders as the build output by
190190
specifying PackFolder and FrameworkSpecific to match the project's. -->
191-
<None Include='readme.md' PackFolder='$(PackFolder)' FrameworkSpecific='$(BuildOutputFrameworkSpecific)' />
191+
<None Include='readme.md' PackFolder='$(PackFolder)' FrameworkSpecific='$(PackFrameworkSpecific)' />
192192
</ItemGroup>
193193
</Project>",
194194
"GetPackageContents", output,

0 commit comments

Comments
 (0)