Skip to content
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
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
</PropertyGroup>

<!-- TypeScript compilation -->
<PropertyGroup>
<TypeScriptTarget>ES2020</TypeScriptTarget>
<TypeScriptSourceMap>false</TypeScriptSourceMap>
<TypeScriptNoImplicitAny>true</TypeScriptNoImplicitAny>
<TypeScriptCompileOnSaveEnabled>true</TypeScriptCompileOnSaveEnabled>
<TypeScriptCompileBlocked Condition=" '$(TypeScriptCompileBlocked)' == '' and '$(CI)' != 'true' and '$(TF_BUILD)' != 'true' ">true</TypeScriptCompileBlocked>
</PropertyGroup>

<!-- Windows specific settings -->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True'">
<WindowsSdkPackageVersion>10.0.19041.44</WindowsSdkPackageVersion>
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,7 @@

<!-- Tell typescript to stop deleting everything before building the next TFM -->
<Target Name="TypeScriptDeleteOutputFromOtherConfigs" />
<!-- Don't include any JS files in the Content, we will embed it -->
<Target Name="GetTypeScriptOutputForPublishing" />

</Project>
8 changes: 1 addition & 7 deletions src/Core/src/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@
</ItemGroup>

<!-- TypeScript compilation -->
<PropertyGroup>
<TypeScriptTarget>ES2020</TypeScriptTarget>
<TypeScriptSourceMap>false</TypeScriptSourceMap>
<TypeScriptNoImplicitAny>true</TypeScriptNoImplicitAny>
<TypeScriptCompileOnSaveEnabled>true</TypeScriptCompileOnSaveEnabled>
<TypeScriptCompileBlocked Condition=" '$(TypeScriptCompileBlocked)' == '' and '$(CI)' != 'true' and '$(TF_BUILD)' != 'true' ">true</TypeScriptCompileBlocked>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.7.1">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -92,6 +85,7 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Handlers\HybridWebView\HybridWebView.js" LogicalName="_framework/hybridwebview.js" />
<None Remove="Handlers\HybridWebView\HybridWebView.js" />
</ItemGroup>

<Target Name="_CopyToBuildTasksDir" AfterTargets="Build">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,28 @@ void AssetExists(string filename)
$"Unable to find expected asset: {fullpath}");
}
}

[Test]
public void BuildWithIdentityClient()
{
var projectDir = TestDirectory;
var projectFile = Path.Combine(projectDir, $"{Path.GetFileName(projectDir)}.csproj");

Assert.IsTrue(DotnetInternal.New("maui", projectDir, DotNetCurrent),
$"Unable to create template maui. Check test output for errors.");

// .NET 9 and later was Unpackaged, so we need to remove the line
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

This comment is misleading. The test is adding package references to reproduce issue #32683, not removing the WindowsPackageType property. Consider updating it to something like:

// Add Microsoft.Identity.Client packages to test that JS files are properly embedded
Suggested change
// .NET 9 and later was Unpackaged, so we need to remove the line
// Add Microsoft.Identity.Client packages to test that JS files are properly embedded

Copilot uses AI. Check for mistakes.
FileUtilities.ReplaceInFile(projectFile,
"</Project>",
"""
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<PackageReference Include="Microsoft.Identity.Client" Version="4.79.1" />
<PackageReference Include="Microsoft.Identity.Client.Desktop.WinUI3" Version="4.79.1"/>
</ItemGroup>
</Project>
""");

Assert.IsTrue(DotnetInternal.Build(projectFile, "Debug", properties: BuildProps, msbuildWarningsAsErrors: true),
$"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors.");
}
}
Loading