Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<!-- This Target is called early on in the chain for both single-RID and multi-RID containers - but for single-RID it's important
that we ensure all of the data necessary to create a single-RID container is computed after we exit this target. -->
<Target Name="ComputeContainerConfig" DependsOnTargets="ComputeContainerBaseImage;_ComputeContainerExecutionArgs">
<Target Name="ComputeContainerConfig" DependsOnTargets="ComputeContainerBaseImage;_ContainerEstablishRIDNess;_ComputeContainerExecutionArgs">
<PropertyGroup Label="VS defaults">
<!-- RegistryUrl is used by existing VS targets for Docker builds - this lets us fill that void -->
<ContainerRegistry Condition="'$(RegistryUrl)' != ''">$(RegistryUrl)</ContainerRegistry>
Expand Down Expand Up @@ -181,21 +181,20 @@
<PropertyGroup>
<PublishContainerDependsOn>
_ContainerVerifySDKVersion;
_ContainerEstablishRIDNess;
ComputeContainerConfig;
_CheckContainersPackage
_CheckContainersPackage;
</PublishContainerDependsOn>
</PropertyGroup>

<!-- These args are relevant to container execution and are per-RID by nature. Therefore they're a direct dependency of the _PublishSingleContainer
target and not computed at the outer, multi-RID build layer. -->
<Target Name="_ComputeContainerExecutionArgs" Condition="'$(_IsSingleRIDBuild)' == 'true'">
<Target Name="_ComputeContainerExecutionArgs" DependsOnTargets="_ContainerEstablishRIDNess" Condition="'$(_IsSingleRIDBuild)' == 'true'">
<PropertyGroup>
<!-- The Container RID should default to the RID used for the entire build (to ensure things run on the platform they are built for), but the user knows best and so should be able to set it explicitly.
For builds that have a RID, we default to that RID. Otherwise, we default to the Linux RID matching the architecture of the currently-executing SDK. -->
<_ContainerIsTargetingWindows>false</_ContainerIsTargetingWindows>
<_ContainerIsTargetingWindows Condition="$(ContainerRuntimeIdentifier.StartsWith('win'))">true</_ContainerIsTargetingWindows>

<!-- Set the WorkingDirectory depending on the RID -->
<ContainerWorkingDirectory Condition="'$(ContainerWorkingDirectory)' == '' and !$(_ContainerIsTargetingWindows)">/app/</ContainerWorkingDirectory>
<ContainerWorkingDirectory Condition="'$(ContainerWorkingDirectory)' == '' and $(_ContainerIsTargetingWindows)">C:\app\</ContainerWorkingDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public void CanDeferContainerAppCommand(
{
[prop] = value.ToString(),
[ContainerRuntimeIdentifier] = $"{os}-x64",
["_IsSingleRIDBuild"] = "true",

}, projectName: $"{nameof(CanDeferContainerAppCommand)}_{prop}_{value}_{string.Join("_", expectedAppCommandArgs)}");
using var _ = d;
Expand Down Expand Up @@ -312,7 +311,6 @@ public void CanComputeContainerUser(string tfm, string rid, string? expectedUser
["TargetFrameworkVersion"] = tfm,
["TargetFramework"] = "net" + tfm.TrimStart('v'),
["ContainerRuntimeIdentifier"] = rid,
["_IsSingleRIDBuild"] = "true",
}, projectName: $"{nameof(CanComputeContainerUser)}_{tfm}_{rid}_{expectedUser}");
using var _ = d;
var instance = project.CreateProjectInstance(ProjectInstanceSettings.None);
Expand Down