Skip to content

Commit 6ad259d

Browse files
drewnoakesjoperezr
andauthored
Fix dashboard publish pack by adding published assets to tools folder (dotnet#1816)
* Fix dashboard publish pack by adding published assets to tools folder * Error out when publish items are empty --------- Co-authored-by: Jose Perez Rodriguez <[email protected]>
1 parent f8db736 commit 6ad259d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

eng/dashboardpack/dashboardpack.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,20 @@
2828

2929
<Target Name="BeforeBuild" BeforeTargets="Build">
3030
<MSBuild Projects="../../src/Aspire.Dashboard/Aspire.Dashboard.csproj" Targets="publish" Properties="Configuration=$(Configuration);Platform=$(Platform);TargetFramework=$(TargetFramework);RuntimeIdentifier=$(DashboardRuntime)" />
31+
32+
<!-- After publishing the project, we ensure that the published assets get packed in the nuspec. -->
33+
<ItemGroup>
34+
<_PublishItems Include="$(DotNetOutputPath)Aspire.Dashboard/$(Configuration)/$(TargetFramework)/$(DashboardRuntime)/publish/**/*" />
35+
<None Include="@(_PublishItems)" Pack="true" PackagePath="tools/" />
36+
</ItemGroup>
37+
38+
<!-- Throw an error if _PublishItems is empty. -->
39+
<Error Condition="'@(_PublishItems)' == ''" Text="No files were found to pack. Ensure that the project being packed has a publish target defined." />
3140
</Target>
3241

3342
<ItemGroup>
3443
<None Include="Sdk.props" Pack="true" PackagePath="Sdk/" />
3544
<None Include="Sdk.targets" Pack="true" PackagePath="Sdk/" />
36-
<None Include="$(DotNetOutputPath)Aspire.Dashboard/$(Configuration)/$(TargetFramework)/$(DashboardRuntime)/publish/**/*" Pack="true" PackagePath="tools/" />
3745
<None Include="UnixFilePermissions.xml" Pack="true" PackagePath="data/" Condition=" '$(DashboardPlatformType)' == 'Unix' " />
3846
</ItemGroup>
3947

0 commit comments

Comments
 (0)