Skip to content

Commit

Permalink
Change RunningPublish property name to _IsPublishing (#79483)
Browse files Browse the repository at this point in the history
The crossgen publish capability currently uses a RunningPublish property
to signal that certain settings should be enabled. The SDK now provides a
property that serves the same purpose called '_IsPublishing'. By using the
SDK property, the right publish behavior will automatically happen if a user
runs 'dotnet publish' on the crossgen2 project.
  • Loading branch information
agocke committed Dec 14, 2022
1 parent 1529058 commit 8e15d9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/coreclr/tools/aot/crossgen2/crossgen2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<NativeAotSupported Condition="'$(DotNetBuildFromSource)' == 'true'">false</NativeAotSupported>
<!-- Trimming is not currently working, but set the appropriate feature flags for NativeAOT -->
<PublishTrimmed Condition="'$(NativeAotSupported)' == 'true'">true</PublishTrimmed>
<RuntimeIdentifiers Condition="'$(RunningPublish)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(_IsPublishing)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers>
<SelfContained>false</SelfContained>
<SelfContained Condition="'$(RunningPublish)' == 'true'">true</SelfContained>
<SelfContained Condition="'$(_IsPublishing)' == 'true'">true</SelfContained>
</PropertyGroup>

<Import Project="crossgen2.props" />
Expand Down Expand Up @@ -43,10 +43,10 @@

<Import Project="$(R2ROverridePath)" Condition="'$(R2ROverridePath)' != ''" />
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets"
Condition="'$(NativeAotSupported)' == 'true' and '$(RunningPublish)' == 'true'" />
Condition="'$(NativeAotSupported)' == 'true' and '$(_IsPublishing)' == 'true'" />

<Target Name="RewriteRuntimePackDir"
Condition="'$(RunningPublish)' == 'true'"
Condition="'$(_IsPublishing)' == 'true'"
DependsOnTargets="ResolveRuntimeFilesFromLocalBuild"
BeforeTargets="ResolveRuntimePackAssets">
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
<MSBuild Projects="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2.csproj"
Targets="Restore"
Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid())
;RunningPublish=true
;_IsPublishing=true
;RuntimeIdentifier=$(PackageRID)
;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath)
;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets" />

<MSBuild Projects="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2.csproj"
Targets="Publish;PublishItemsOutputGroup"
Properties="RunningPublish=true
Properties="_IsPublishing=true
;RuntimeIdentifier=$(PackageRID)
;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath)
;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets">
Expand Down

0 comments on commit 8e15d9f

Please sign in to comment.