Allow host info passed in from the command line to override machine settings (#5904)
* Allow host info passed in from the command line to override machine settings * Simplify the logic * Address PR comments to keep a separate HostRid and HostOSName that are static * Rename to BuildInfo.props * Address PR comments * Fix the previous merge * Fix spacing * Address PR comments
This commit is contained in:
parent
22816d7958
commit
45a1e9e56c
13 changed files with 73 additions and 25 deletions
|
@ -13,16 +13,12 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Output]
|
||||
public string Rid { get; set; }
|
||||
|
||||
[Output]
|
||||
public string Architecture { get; set; }
|
||||
|
||||
[Output]
|
||||
public string OSName { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
Rid = RuntimeEnvironment.GetRuntimeIdentifier();
|
||||
Architecture = RuntimeEnvironment.RuntimeArchitecture;
|
||||
OSName = GetOSShortName();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -44,7 +44,7 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
|||
|
||||
# Generate some props files that are imported by update-dependencies
|
||||
Write-Host "Generating property files..."
|
||||
dotnet msbuild $RepoRoot\build.proj /p:Architecture=$Architecture /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
dotnet msbuild $RepoRoot\build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to generate intermidates" }
|
||||
|
||||
# Restore the app
|
||||
|
|
|
@ -44,7 +44,7 @@ export PATH=$DOTNET_INSTALL_DIR:$PATH
|
|||
|
||||
# Generate some props files that are imported by update-dependencies
|
||||
echo "Generating property files..."
|
||||
dotnet msbuild "$REPO_ROOT/build.proj" /p:Architecture=x64 /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
dotnet msbuild "$REPO_ROOT/build.proj" /p:Architecture=x64 /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
|
||||
echo "Resotring $PROJECT_PATH..."
|
||||
dotnet restore "$PROJECT_PATH"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue