Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit a7575a1

Browse files
authored
fix: Change packaging details for Sdk and Tool (#214)
* fix: Correct build/ content packing in Tool * fix: Ignore NU5128 in Metapackage.Sdk remove Placeholder (_._ file) logic in favor of nuspec management and ignoring NU5128
1 parent 679e8d4 commit a7575a1

3 files changed

Lines changed: 11 additions & 27 deletions

File tree

src/CodeGeneration.Roslyn.PluginMetapackage.Sdk/build/CodeGeneration.Roslyn.PluginMetapackage.Sdk.targets

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
group.Add(dep);
4747
}
4848
}
49+
// if not present, add empty <files/> node to prevent packing .nuspec's directory
50+
if (document.Root.Element(ns + "files") == null)
51+
{
52+
document.Root.Add(new XElement(ns + "files"));
53+
}
4954
document.Save(PatchedNuspecFilePath);
5055
]]>
5156
</Code>
@@ -58,8 +63,11 @@
5863
<PackDependsOn>$(PackDependsOn);PackMetapackage;</PackDependsOn>
5964
<!-- Workaround the hardcoded ContinuePackingAfterGeneratingNuspec -->
6065
<GenerateNuspecDependsOn>SetContinuePackingAfterNuspecToFalse;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
61-
<!-- Put _._ placeholder files in lib/TFM package folders -->
62-
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackTfmPlaceholder;</TargetsForTfmSpecificContentInPackage>
66+
<!--
67+
Ignore NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location.
68+
Reason: It's exactly what we want (no content at all).
69+
-->
70+
<NoWarn>$(NoWarn);NU5128</NoWarn>
6371
</PropertyGroup>
6472

6573
<!--
@@ -106,21 +114,6 @@
106114
Text="$(_CheckCgrToolReferenceExistsWarning.Trim())" />
107115
</Target>
108116

109-
<!--
110-
Puts _._ placeholder file in lib/TFM package folder, per TFM.
111-
112-
Disable by setting SkipPackTfmPlaceholder=true
113-
-->
114-
<Target
115-
Name="PackTfmPlaceholder"
116-
Condition="'$(SkipPackTfmPlaceholder)' != 'true'">
117-
<ItemGroup>
118-
<TfmSpecificPackageFile
119-
Include="$(MSBuildThisFileDirectory)/_._"
120-
PackagePath="lib/$(TargetFramework)/" />
121-
</ItemGroup>
122-
</Target>
123-
124117
<!-- Build paths used in PatchNuspecFile target -->
125118
<Target
126119
Name="PreparePathsForPatchNuspecFile"

src/CodeGeneration.Roslyn.PluginMetapackage.Sdk/build/_._

Whitespace-only changes.

src/CodeGeneration.Roslyn.Tool/CodeGeneration.Roslyn.Tool.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
<RollForward>Major</RollForward>
1010
<!-- Ignore 'Missing XML comments', it's a tool. -->
1111
<NoWarn>$(NoWarn);CS1591</NoWarn>
12-
<!--
13-
NU5129 false positive - similar to https://github.com/NuGet/Home/issues/8627
14-
Possible cause: generating the .props file dynamically during build.
15-
-->
16-
<NoWarn>$(NoWarn);NU5129</NoWarn>
1712
<!-- Packing -->
1813
<DevelopmentDependency>true</DevelopmentDependency>
1914
<!--
@@ -33,11 +28,7 @@
3328
</PropertyGroup>
3429

3530
<ItemGroup>
36-
<None Include="build/**">
37-
<Pack>true</Pack>
38-
<PackagePath>build/</PackagePath>
39-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40-
</None>
31+
<None Include="build/**" Pack="true" PackagePath="build" />
4132
<Compile Update="CommandLine\Strings.Designer.cs">
4233
<DesignTime>True</DesignTime>
4334
<AutoGen>True</AutoGen>

0 commit comments

Comments
 (0)