|
240 | 240 | </Target> |
241 | 241 |
|
242 | 242 | <Target Name="_PublishSingleContainer" |
243 | | - Returns="@(GeneratedContainers)"> |
| 243 | + Returns="@(GeneratedContainer)"> |
244 | 244 | <PropertyGroup Condition="'$(DOTNET_HOST_PATH)' == ''"> |
245 | 245 | <DotNetHostDirectory>$(NetCoreRoot)</DotNetHostDirectory> |
246 | 246 | <DotNetHostFileName>dotnet</DotNetHostFileName> |
|
284 | 284 | <Output TaskParameter="GeneratedArchiveOutputPath" PropertyName="GeneratedArchiveOutputPath" /> |
285 | 285 | <Output TaskParameter="GeneratedContainerMediaType" PropertyName="GeneratedContainerMediaType" /> |
286 | 286 | <Output TaskParameter="GeneratedContainerNames" ItemName="GeneratedContainerName" /> |
| 287 | + <Output TaskParameter="GeneratedDigestLabel" ItemName="ContainerLabel" /> |
287 | 288 | </CreateNewImage> |
288 | 289 |
|
289 | 290 | <ItemGroup> |
290 | | - <GeneratedContainers Include="GeneratedContainer"> |
| 291 | + <GeneratedContainer Include="GeneratedContainer"> |
291 | 292 | <Manifest>$(GeneratedContainerManifest)</Manifest> |
292 | 293 | <Configuration>$(GeneratedContainerConfiguration)</Configuration> |
293 | 294 | <ManifestDigest>$(GeneratedContainerDigest)</ManifestDigest> |
294 | 295 | <ManifestMediaType>$(GeneratedContainerMediaType)</ManifestMediaType> |
295 | | - </GeneratedContainers> |
| 296 | + </GeneratedContainer> |
296 | 297 | </ItemGroup> |
297 | 298 | </Target> |
298 | 299 |
|
299 | | - <Target Name="_PublishMultiArchContainers" DependsOnTargets="$(PublishContainerDependsOn)" > |
| 300 | + <Target Name="_PublishMultiArchContainers" DependsOnTargets="$(PublishContainerDependsOn)" Returns="@(GeneratedContainer)" > |
300 | 301 | <PropertyGroup> |
301 | 302 | <!--We want to skip publishing individual images in case of multi-arch tarball publishing or local daemon (only docker) publishing because all images are published in one tarball.--> |
302 | 303 | <!--We don't want to skip publishing individual images in case of remote registry because the individual images should be available in the registry before image index is pushed.--> |
303 | 304 | <!--We don't want to skip publishing individual images in case of local daemon podman because podman loads multi-arch tarball differently - only individual image for the current platform.--> |
304 | 305 | <_SkipContainerPublishing>false</_SkipContainerPublishing> |
305 | 306 | <_SkipContainerPublishing Condition="$(ContainerArchiveOutputPath) != '' or ( $(ContainerRegistry) == '' and ( $(LocalRegistry) == '' or $(LocalRegistry) == 'Docker' ) )">true</_SkipContainerPublishing> |
306 | | - |
| 307 | + |
307 | 308 | <!--We want to skip CreateImageIndex task in case of local daemon podman because it is not supported.--> |
308 | 309 | <_SkipCreateImageIndex>false</_SkipCreateImageIndex> |
309 | 310 | <_SkipCreateImageIndex Condition="$(ContainerArchiveOutputPath) == '' and $(ContainerRegistry) == '' and $(LocalRegistry) == 'Podman'">true</_SkipCreateImageIndex> |
|
346 | 347 | Projects="@(_InnerBuild)" |
347 | 348 | Targets="Publish;_ParseItemsForPublishingSingleContainer;_PublishSingleContainer" |
348 | 349 | BuildInParallel="true"> |
349 | | - <Output TaskParameter="TargetOutputs" ItemName="GeneratedContainers" /> |
| 350 | + <Output TaskParameter="TargetOutputs" ItemName="GeneratedContainer" /> |
350 | 351 | </MSBuild> |
351 | 352 |
|
352 | 353 | <CreateImageIndex Condition="'$(_SkipCreateImageIndex)' == 'false' " |
353 | | - GeneratedContainers="@(GeneratedContainers)" |
| 354 | + GeneratedContainers="@(GeneratedContainer)" |
354 | 355 | LocalRegistry="$(LocalRegistry)" |
355 | 356 | OutputRegistry="$(ContainerRegistry)" |
356 | 357 | ArchiveOutputPath="$(ContainerArchiveOutputPath)" |
|
403 | 404 |
|
404 | 405 | <Target Name="PublishContainer" |
405 | 406 | DependsOnTargets="$(PublishContainerDependsOn)" |
406 | | - Condition="'$(IsPublishable)' == 'true' AND '$(EnableSdkContainerSupport)' == 'true'"> |
| 407 | + Condition="'$(IsPublishable)' == 'true' AND '$(EnableSdkContainerSupport)' == 'true'" |
| 408 | + Returns="@(GeneratedContainer)" |
| 409 | + > |
407 | 410 | <PropertyGroup> |
408 | 411 | <_IsMultiTFMBuild Condition="'$(TargetFrameworks)' != '' and '$(TargetFramework)' == ''">true</_IsMultiTFMBuild> |
409 | 412 | <!-- we are multi-RID if: |
|
418 | 421 | </PropertyGroup> |
419 | 422 |
|
420 | 423 | <!-- Call _PublishMultiArchContainers if we are in a multi-rid build, and call _PublishSingleContainer if we are in a single-RID build --> |
421 | | - <CallTarget Condition="'$(_IsMultiRIDBuild)' == 'true' " Targets="_PublishMultiArchContainers" /> |
422 | | - <CallTarget Condition="'$(_IsSingleRIDBuild)' == 'true' " Targets="_PublishSingleContainer" /> |
| 424 | + <CallTarget Condition="'$(_IsMultiRIDBuild)' == 'true' " Targets="_PublishMultiArchContainers"> |
| 425 | + <Output TaskParameter="TargetOutputs" ItemName="GeneratedContainer" /> |
| 426 | + </CallTarget> |
| 427 | + <CallTarget Condition="'$(_IsSingleRIDBuild)' == 'true' " Targets="_PublishSingleContainer"> |
| 428 | + <Output TaskParameter="TargetOutputs" ItemName="GeneratedContainer" /> |
| 429 | + </CallTarget> |
423 | 430 |
|
424 | 431 | <Error Condition="'$(_IsMultiTFMBuild)' == 'true'" Code="CONTAINERS0666" Text="Containers cannot be published for multiple TargetFrameworks at this time. Please specify a TargetFramework." /> |
425 | 432 | </Target> |
|
0 commit comments