Skip to content

Commit

Permalink
All of the examples work now
Browse files Browse the repository at this point in the history
  • Loading branch information
nagilson committed Nov 2, 2022
1 parent 7c50bac commit c95ff57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ Copyright (c) .NET Foundation. All rights reserved.
<RuntimeIdentifier Condition="'$(PlatformTarget)' == 'x86' or '$(PlatformTarget)' == ''">win7-x86</RuntimeIdentifier>
</PropertyGroup>

<!-- Check if variable is global, resets the value to it's original state if it was local.-->
<!-- Check if SelfContained is global, resets the value to it's original state if it was local.-->
<PropertyGroup>
<_OriginalSelfContainedValue>$(SelfContained)</_OriginalSelfContainedValue>
<SelfContained></SelfContained>
</PropertyGroup>

<Choose>
<!-- Assumes a global variable cannot be an undefined variable; not setting it to 'temp' as that may cause type resolution failures.-->
<!-- Assumes a global variable cannot be an undefined variable.-->
<When Condition="'$(SelfContained)' != '' and $(SelfContained) == $(_OriginalSelfContainedValue)">
<PropertyGroup>
<_SelfContainedIsGlobal>true</_SelfContainedIsGlobal>
Expand All @@ -82,15 +82,21 @@ Copyright (c) .NET Foundation. All rights reserved.
</Choose>

<PropertyGroup>
<SelfContained>$(OriginalSelfContainedValue)</SelfContained>
<SelfContained>$(_OriginalSelfContainedValue)</SelfContained>
<_OriginalSelfContainedValue></_OriginalSelfContainedValue>
</PropertyGroup>

<!-- PubishSelfContained may be set but not change self contained if we are not publishing, or self contained was already set globally. This condition tracks whether it will take effect.-->
<PropertyGroup Condition=" '$(_CommandLineDefinedSelfContained)' != 'true' and '$(_SelfContainedIsGlobal)' != 'true' and '$(_IsPublishing)' == 'true' and '$(PublishSelfContained)' == 'true'">
<PropertyGroup Condition=" '$(_CommandLineDefinedSelfContained)' != 'true' and '$(_SelfContainedIsGlobal)' != 'true' and '$(_IsPublishing)' == 'true' and ('$(PublishSelfContained)' == 'true' or '$(PublishSelfContained)' == 'false')">
<_PublishSelfContainedIsActive>true</_PublishSelfContainedIsActive>
</PropertyGroup>

<!-- Edit SelfContained to match the value of PublishSelfContained if we are publishing.
This Won't affect t:/Publish (because of _IsPublishing), and also won't override a global SelfContained property.-->
<PropertyGroup Condition="'$(_PublishSelfContainedIsActive)' == 'true'">
<SelfContained>$(PublishSelfContained)</SelfContained>
</PropertyGroup>

<PropertyGroup Condition="'$(UseCurrentRuntimeIdentifier)' == ''">
<UseCurrentRuntimeIdentifier Condition="
'$(RuntimeIdentifier)' == '' and
Expand All @@ -101,7 +107,7 @@ Copyright (c) .NET Foundation. All rights reserved.
'$(PublishReadyToRun)' == 'true' or
'$(PublishSingleFile)' == 'true' or
'$(PublishAot)' == 'true' or
'$(_PublishSelfContainedIsActive)' == 'true'
('$(_PublishSelfContainedIsActive)' == 'true' and '$(PublishSelfContained)' == 'true')
)">true</UseCurrentRuntimeIdentifier>
</PropertyGroup>

Expand Down Expand Up @@ -200,7 +206,7 @@ Copyright (c) .NET Foundation. All rights reserved.
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="SelfContained"/>

<NETSdkError Condition="'$(_PublishSelfContainedIsActive)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(RuntimeIdentifiers)' == ''"
<NETSdkError Condition="'$(_PublishSelfContainedIsActive)' == 'true' and '$(PublishSelfContained)' == 'true' and '$(RuntimeIdentifier)' == '' and '$(RuntimeIdentifiers)' == ''"
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="PublishSelfContained"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- Set default intermediate and output paths -->
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultOutputPaths.targets" Condition="'$(UsingNETSdkDefaults)' == 'true'"/>

<!-- Edit SelfContained to match the value of PublishSelfContained if we are publishing.
This Won't affect t:/Publish (because of _IsPublishing), and also won't override a global SelfContained property.-->
<PropertyGroup Condition="'$(_PublishSelfContainedIsActive)' == 'true'">
<SelfContained Condition="'$(PublishSelfContained)' == 'true' or '$(PublishSelfContained)' == 'false'">$(PublishSelfContained)</SelfContained>
</PropertyGroup>

<!-- Before any additional SDK targets are imported, import the publish profile.
This allows the publish profile to set properties like RuntimeIdentifier and them be
respected by the SDK. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void PublishWebAppWithPublishProfile(bool? selfContained, bool? useAppHos

var command = new PublishCommand(testProjectInstance);
command
.Execute("/p:PublishProfile=test")
.Execute("/p:PublishProfile=test", "-bl:C:\\users\\noahgilson\\SELFCP.binlog")
.Should()
.Pass();

Expand Down

0 comments on commit c95ff57

Please sign in to comment.