Skip to content
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

Bump WASDK and BuildTools #13687

Merged
merged 9 commits into from
Mar 20, 2023
Merged
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
4 changes: 4 additions & 0 deletions eng/Microsoft.Extensions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
Version="$(MicrosoftWindowsAppSDKPackageVersion)"
NoWarn="NU1605"
/>
<PackageReference
Update="Microsoft.Windows.SDK.BuildTools"
Version="$(MicrosoftWindowsSDKBuildToolsPackageVersion)"
/>
<PackageReference
Update="Microsoft.Graphics.Win2D"
Version="$(MicrosoftGraphicsWin2DPackageVersion)"
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<!-- emsdk -->
<MicrosoftNETWorkloadEmscriptenPackageVersion>7.0.3</MicrosoftNETWorkloadEmscriptenPackageVersion>
<!-- wasdk -->
<MicrosoftWindowsAppSDKPackageVersion>1.2.230313.1</MicrosoftWindowsAppSDKPackageVersion>
<MicrosoftWindowsSDKBuildToolsPackageVersion>10.0.22621.755</MicrosoftWindowsSDKBuildToolsPackageVersion>
<MicrosoftWindowsAppSDKPackageVersion>1.3.230228005-preview1</MicrosoftWindowsAppSDKPackageVersion>
<MicrosoftWindowsSDKBuildToolsPackageVersion>10.0.22621.756</MicrosoftWindowsSDKBuildToolsPackageVersion>
<MicrosoftGraphicsWin2DPackageVersion>1.0.4</MicrosoftGraphicsWin2DPackageVersion>
<!-- Everything else -->
<MicrosoftAspNetCoreAuthorizationPackageVersion>7.0.4</MicrosoftAspNetCoreAuthorizationPackageVersion>
Expand Down
21 changes: 15 additions & 6 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Task("dotnet-build")
Task("dotnet-samples")
.Does(() =>
{
var tempDir = PrepareSeparateBuildContext("samplesTest", false);
var tempDir = PrepareSeparateBuildContext("samplesTest");

RunMSBuildWithDotNet("./Microsoft.Maui.Samples.slnf", new Dictionary<string, string> {
["UseWorkload"] = "true",
Expand All @@ -158,7 +158,10 @@ Task("dotnet-templates")

var dn = localDotnet ? dotnetPath : "dotnet";

var tempDir = PrepareSeparateBuildContext("templatesTest", true);
var tempDir = PrepareSeparateBuildContext(
"templatesTest",
props: "./src/Templates/tests/Directory.Build.props",
targets: "./src/Templates/tests/Directory.Build.targets");

// See: https://github.com/dotnet/project-system/blob/main/docs/design-time-builds.md
var designTime = new Dictionary<string, string> {
Expand Down Expand Up @@ -750,7 +753,7 @@ void RunTestWithLocalDotNet(string csproj)
});
}

DirectoryPath PrepareSeparateBuildContext(string dirName, bool generateDirectoryProps = false)
DirectoryPath PrepareSeparateBuildContext(string dirName, string props = null, string targets = null)
{
var dir = GetTempDirectory().Combine(dirName);
EnsureDirectoryExists(dir);
Expand All @@ -774,9 +777,15 @@ DirectoryPath PrepareSeparateBuildContext(string dirName, bool generateDirectory
$"<!-- <add key=\"local\" value=\"artifacts\" /> -->",
$"<add key=\"nuget-only\" value=\"{nugetOnly.FullPath}\" />");

// Create empty Directory.Build.props/targets
FileWriteText(dir.CombineWithFilePath("Directory.Build.props"), "<Project/>");
FileWriteText(dir.CombineWithFilePath("Directory.Build.targets"), "<Project/>");
// Create empty or copy test Directory.Build.props/targets
if (string.IsNullOrEmpty(props))
FileWriteText(dir.CombineWithFilePath("Directory.Build.props"), "<Project/>");
else
CopyFile(props, dir.CombineWithFilePath("Directory.Build.props"));
if (string.IsNullOrEmpty(targets))
FileWriteText(dir.CombineWithFilePath("Directory.Build.targets"), "<Project/>");
else
CopyFile(targets, dir.CombineWithFilePath("Directory.Build.targets"));

return MakeAbsolute(dir);
}
Expand Down
1 change: 1 addition & 0 deletions src/Core/src/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this line once WASDK updates to depend on the newer version - or we may just keep this so we control the base version.

<PackageReference Include="Microsoft.Graphics.Win2D" />
<ProjectReference Include="..\..\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Templates/tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>

</Project>
7 changes: 7 additions & 0 deletions src/Templates/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>

<Target Name="_MAUI_TEST_BuildToolsPackageWasUsed" BeforeTargets="_GetMakeAppxToolPath">
<Error Text="The build did not make use of the BuildTools package but instead ran the fallback target '_GetMakeAppxToolPath' to try and locate the tool." />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION_NO_DOT" PropertyName="_MauiPreviousDotNetVersionNoDot" />
<_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION" PropertyName="MicrosoftMauiPreviousDotNetReleasedVersion" />
<_ValuesToReplace Include="MicrosoftWindowsAppSDKPackageVersion" PropertyName="MicrosoftWindowsAppSDKPackageVersion" />
<_ValuesToReplace Include="MicrosoftWindowsSDKBuildToolsPackageVersion" PropertyName="MicrosoftWindowsSDKBuildToolsPackageVersion" />
<_ValuesToReplace Include="MicrosoftExtensionsPackageVersion" PropertyName="MicrosoftExtensionsPackageVersion" />
<_ValuesToReplace Include="MicrosoftExtensionsServicingPackageVersion" PropertyName="MicrosoftExtensionsServicingPackageVersion" />
<_ValuesToReplace Include="TizenUIExtensionsVersion" PropertyName="TizenUIExtensionsVersion" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
<PrivateAssets Condition=" '$(OutputType)' == 'Library' and '$(AndroidApplication)' != 'true' ">all</PrivateAssets>
</_MauiImplicitPackageReference>
</ItemGroup>
<ItemGroup Condition=" ('$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true') and ('$(TargetPlatformIdentifier)' == 'windows') ">
<_MauiRequiredImplicitPackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="@MicrosoftWindowsSDKBuildToolsPackageVersion@" PrivateAssets="all" />
</ItemGroup>
<!-- Always install the required dependecies, such as build tools for the SDK itself -->
<ItemGroup>
<_MauiRequiredImplicitPackageReference Remove="@(PackageReference)" />
Expand Down