uisng MBBuild 16.10 to build/pack (#997)

* Build with preview

* Add msbuildPath to cake

* [Build] Build tasks first

* Installl Universal

* Fix it
This commit is contained in:
Rui Marinho 2021-05-11 08:20:27 +01:00 коммит произвёл GitHub
Родитель 07da5031e6
Коммит 2363233566
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -39,7 +39,9 @@ string agentName = EnvironmentVariable("AGENT_NAME", "");
bool isCIBuild = !String.IsNullOrWhiteSpace(agentName);
string artifactStagingDirectory = EnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY", ".");
string workingDirectory = EnvironmentVariable("SYSTEM_DEFAULTWORKINGDIRECTORY", ".");
string envProgramFiles = EnvironmentVariable("ProgramFiles(x86)");
var configuration = GetBuildVariable("BUILD_CONFIGURATION", GetBuildVariable("configuration", "DEBUG"));
var msbuildPath = GetBuildVariable("msbuild", $"{envProgramFiles}\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe");
var target = Argument("target", "Default");
if(String.IsNullOrWhiteSpace(target))
@ -164,6 +166,8 @@ Information ("artifactStagingDirectory: {0}", artifactStagingDirectory);
Information("workingDirectory: {0}", workingDirectory);
Information("NUNIT_TEST_WHERE: {0}", NUNIT_TEST_WHERE);
Information("TARGET: {0}", target);
Information("MSBUILD: {0}", msbuildPath);
var releaseChannel = ReleaseChannel.Stable;
if(releaseChannelArg == "Preview")

Просмотреть файл

@ -1,10 +1,13 @@
param(
[string] $configuration = 'Debug',
[string] $msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
[string] $msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe"
)
Write-Host $msbuild
$artifacts = Join-Path $PSScriptRoot ../artifacts
$sln = Join-Path $PSScriptRoot ../Microsoft.Maui-net6.sln
$slnTasks = Join-Path $PSScriptRoot ../Microsoft.Maui.BuildTasks-net6.sln
# Bootstrap .\bin\dotnet\
$csproj = Join-Path $PSScriptRoot ../src/DotNet/DotNet.csproj
@ -50,6 +53,14 @@ if ($IsWindows)
# Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
$env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH)
# Have to build the solution tasks
& $msbuild $slnTasks `
/p:configuration=$configuration `
/p:SymbolPackageFormat=snupkg `
/restore `
/t:build `
/bl:"$artifacts/maui-build-tasks-$configuration.binlog"
# Have to build the solution first so the xbf files are there for pack
& $msbuild $sln `
/p:configuration=$configuration `

Просмотреть файл

@ -1,3 +1,4 @@
VisualStudio (VisualStudioChannel.Preview, VisualStudioTier.Enterprise, 16, @"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview", true)
.Workload (VisualStudioWorkload.ManagedDesktop)
.Workload (VisualStudioWorkload.NetCrossPlat);
.Workload (VisualStudioWorkload.NetCrossPlat)
.Workload (VisualStudioWorkload.Universal);