Skip to content

Specify .NET Search by Build Type #25837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions PowerShell.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,23 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<!-- Define properties for Framework dependent deployments in Packages
For GlobalTool, we want to search for the apphost in the global location.
For FxDependent, we want to search in the environment variable and global location.
For SelfContained, we want to search in the app local location.
-->
<PropertyGroup Condition=" '$(AppDeployment)' == 'GlobalTool' ">
<AppHostDotNetSearch>Global</AppHostDotNetSearch>
</PropertyGroup>

<PropertyGroup Condition=" '$(AppDeployment)' == 'FxDependent' ">
<AppHostDotNetSearch>EnvironmentVariable;Global</AppHostDotNetSearch>
</PropertyGroup>

<PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' ">
<AppHostDotNetSearch>AppLocal</AppHostDotNetSearch>
</PropertyGroup>

<!-- Define all OS, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PublishReadyToRun>true</PublishReadyToRun>
Expand Down
19 changes: 14 additions & 5 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,22 @@ Fix steps:
$Arguments += "/property:IsWindows=false"
}

# Framework Dependent builds do not support ReadyToRun as it needs a specific runtime to optimize for.
# The property is set in Powershell.Common.props file.
# We override the property through the build command line.
if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) {
$Arguments += "/property:PublishReadyToRun=false"
# We pass in the AppDeployment property to indicate which type of deployment we are doing.
# This allows the PowerShell.Common.props to set the correct properties for the build.
$AppDeployment = if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) {
# Global
"GlobalTool"
}
elseif($Options.Runtime -like 'fxdependent*' -and $Options.Runtime -match $optimizedFddRegex) {
# EnvironmentVariable, Global
"FxDependent"
}
else {
# AppLocal
"SelfContained"
}

$Arguments += "/property:AppDeployment=$AppDeployment"
$Arguments += "--configuration", $Options.Configuration
$Arguments += "--framework", $Options.Framework

Expand Down
Loading