Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e64fb20
Removed Debug and Release enlistment files, replaced them with custom…
dustin-wojciechowski Jul 25, 2023
19f1e88
Fixed formatting, removed hardened runtime
dustin-wojciechowski Jul 25, 2023
93e6471
Formatting
dustin-wojciechowski Jul 25, 2023
ae314b0
Reverted generated change to packagereference
dustin-wojciechowski Jul 25, 2023
c4758f5
Fixed packagereference
dustin-wojciechowski Jul 25, 2023
aaf346a
Added condition to enable/disabledebug entitlements
dustin-wojciechowski Jul 26, 2023
170be9c
Added condition for release as well
dustin-wojciechowski Jul 26, 2023
223c554
Made the same changes to maui-mobile template as well.
dustin-wojciechowski Jul 27, 2023
2f06874
Adding back UseHardenedRuntime to Release
dustin-wojciechowski Jul 27, 2023
498c6a0
Removed entitlements that are now added in ios sdk.
dustin-wojciechowski Aug 28, 2023
398cd7b
Removed custom entitlements for maui-mobile templates
dustin-wojciechowski Aug 28, 2023
09d6649
Merge remote-tracking branch 'origin/main' into dev/update-templates-…
dustin-wojciechowski Aug 30, 2023
ee820eb
Removed network.client entitlement from csproj
dustin-wojciechowski Aug 30, 2023
0db44b5
Added condition in defaultitems to include network.client entitlement…
dustin-wojciechowski Aug 30, 2023
6606116
Moved maui blazor conditions to a new DefaultItems file within the Bu…
dustin-wojciechowski Aug 30, 2023
8c4e46f
Removed unnecessary spacing
dustin-wojciechowski Aug 30, 2023
f4cf8da
spacing
dustin-wojciechowski Aug 30, 2023
026dd4e
Added comment explaining the entitlement
dustin-wojciechowski Aug 30, 2023
c38bdf2
Removed unnecessary code in defaultitems for maccatalyst.
dustin-wojciechowski Aug 31, 2023
8376498
Merge remote-tracking branch 'origin/main' into dev/update-templates-…
dustin-wojciechowski Sep 14, 2023
696f8aa
This enables the import of the DefaultItems for MacCatalyst.targets.
dustin-wojciechowski Sep 14, 2023
aca87ef
Replaced ProjectCapability check with UsingMicrosoftNETSdkRazor check…
dustin-wojciechowski Sep 18, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<PropertyGroup>
<EnableDefaultMauiBlazorEntitlements Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='' And '$(UsingMicrosoftNETSdkRazor)'=='true'">true</EnableDefaultMauiBlazorEntitlements>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm this essentially looks like it's hard-coding some Blazor Hybrid logic into this target, which seems a bit too specific. I'm not sure this logic is quite right, either, because I don't think the MAUI project itself has to necessarily use the Razor SDK, yet the app likely still wants to use these entitlements if it has Blazor usage in it (perhaps indirectly through a project reference).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I got the idea from the Microsoft.Maui.Sdk.ProjectCapabilities.targets file. It would have been more favorable to use the MauiBlazor ProjectCapability directly, but the condition checking for that wasn't working in the integration test.

I had not thought of an indirect reference without using the Razor SDK though. I will investigate and see if I can come up with an alternative means.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh weird... I don't really like that either. Looks like it's ancient. I think it's a reasonable for telemetry but I'm not sure I like it for functional purposes... Though it doesn't even necessarily look right for that because it doesn't actually check if it's MAUI SDK + Razor, though probably that's fine because this very target is from MAUI to begin with.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should this rather be in the maui blazor webview nuget? Then installing the webview nuget also sets this?

</PropertyGroup>

<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='true'And '$(Configuration)' == 'Release'">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='true'And '$(Configuration)' == 'Release'">
<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='true' And '$(Configuration)' == 'Release'">

<!--Essential for MAUI Blazor, as it allows your sandboxed app to connect to a server process.-->
<CustomEntitlements Include="com.apple.security.app-sandbox" Type="boolean" Value="true" />
<CustomEntitlements Include="com.apple.security.network.client" Type="boolean" Value="true" />
</ItemGroup>

<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='True'And '$(Configuration)' == 'Debug'">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='True'And '$(Configuration)' == 'Debug'">
<ItemGroup Condition="'$(EnableDefaultMauiBlazorEntitlements)'=='True' And '$(Configuration)' == 'Debug'">

<CustomEntitlements Include="com.apple.security.get-task-allow" Type="boolean" Value="true" />
Copy link
Copy Markdown
Member

@mattleibow mattleibow Sep 28, 2023

Choose a reason for hiding this comment

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

This is in the iOS sdk now so we can leave it out? If this is just needed because main is net7, then we need an issue tracking this to be removed in the net8 branch asap and it needs to be marked for GA using the Milestones.

</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
<MtouchLink Condition="'$(MtouchLink)' == '' and '$(Configuration)' == 'Debug' and '$(UseInterpreter)' == 'true'">None</MtouchLink>
</PropertyGroup>

<Import Project="Microsoft.Maui.Controls.DefaultItems.targets" />

</Project>
11 changes: 0 additions & 11 deletions src/Templates/src/templates/maui-blazor/MauiApp.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,4 @@
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="MS_EXT_VERSION" />
</ItemGroup>

<!-- Build Properties must be defined within these property groups to ensure successful publishing
to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
</Project>

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions src/Templates/src/templates/maui-mobile/MauiApp.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,4 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="MS_EXT_VERSION" />
</ItemGroup>

<!-- Build Properties must be defined within these property groups to ensure successful publishing
to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
</Project>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
<ItemGroup Condition="'$(EnableDefaultItems)'=='True' And '$(EnableDefaultCssItems)'=='True' And '$(EnableDefaultEmbeddedResourceItems)'=='True'">
<None Remove="**\*.css" Condition="'$(EnableDefaultNoneItems)'=='True'" />
</ItemGroup>

</Project>