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

Generate the Windows manifests as well #2704

Merged
merged 21 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c615baa
Generate the Windows manifests as well
mattleibow Sep 26, 2021
390b339
Make a new @(MauiAppIcon)
mattleibow Sep 27, 2021
d6ad433
comment
mattleibow Sep 27, 2021
57cded8
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Sep 27, 2021
244240f
MauiAppIcon -> MauiIcon
mattleibow Sep 27, 2021
03effc8
zuuup
mattleibow Sep 27, 2021
63c5cd2
Use targets instead
mattleibow Sep 27, 2021
bae7d6b
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Oct 7, 2021
8434788
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Jan 28, 2022
a571c72
Fix the tests
mattleibow Jan 29, 2022
8704176
extract
mattleibow Jan 30, 2022
120f887
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Jan 30, 2022
bf3ec44
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Jan 31, 2022
16af9e3
better errors
mattleibow Jan 31, 2022
4af2100
Update the templates
mattleibow Jan 31, 2022
861ad3e
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Feb 1, 2022
395dcaa
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Feb 2, 2022
626c544
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Feb 9, 2022
43a5c60
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Feb 11, 2022
15ea937
Merge remote-tracking branch 'origin/main' into dev/win-manifest
mattleibow Feb 23, 2022
96ff11f
make sure to really build windows
mattleibow Feb 23, 2022
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
45 changes: 45 additions & 0 deletions .nuspec/Microsoft.Maui.Resizetizer.targets
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
AssemblyFile="$(_ResizetizerTaskAssemblyName)"
TaskName="Microsoft.Maui.Resizetizer.GetMauiAssetPath" />

<UsingTask
AssemblyFile="$(_ResizetizerTaskAssemblyName)"
TaskName="Microsoft.Maui.Resizetizer.GeneratePackageAppxManifest" />

<PropertyGroup>
<CleanDependsOn>
$(CleanDependsOn);
Expand All @@ -53,11 +57,13 @@
<_MauiFontStampFile>$(IntermediateOutputPath)mauifont.stamp</_MauiFontStampFile>
<_MauiSplashInputsFile>$(IntermediateOutputPath)mauisplash.inputs</_MauiSplashInputsFile>
<_MauiSplashStampFile>$(IntermediateOutputPath)mauisplash.stamp</_MauiSplashStampFile>
<_MauiManifestStampFile>$(IntermediateOutputPath)mauimanifest.stamp</_MauiManifestStampFile>

<_ResizetizerIntermediateOutputRoot>$(IntermediateOutputPath)resizetizer\</_ResizetizerIntermediateOutputRoot>
<_MauiIntermediateImages>$(_ResizetizerIntermediateOutputRoot)r\</_MauiIntermediateImages>
<_MauiIntermediateFonts>$(_ResizetizerIntermediateOutputRoot)f\</_MauiIntermediateFonts>
<_MauiIntermediateSplashScreen>$(_ResizetizerIntermediateOutputRoot)sp\</_MauiIntermediateSplashScreen>
<_MauiIntermediateManifest>$(_ResizetizerIntermediateOutputRoot)m\</_MauiIntermediateManifest>
<_MauiIntermediateColors>$(_MauiIntermediateSplashScreen)maui_colors.xml</_MauiIntermediateColors>
<_MauiIntermediateDrawable>$(_MauiIntermediateSplashScreen)maui_splash_image.xml</_MauiIntermediateDrawable>
<_MauiIntermediateStoryboard>$(_MauiIntermediateSplashScreen)MauiSplash.storyboard</_MauiIntermediateStoryboard>
Expand Down Expand Up @@ -162,6 +168,11 @@
$(ProcessMauiFontsBeforeTargets);
AssignTargetPaths;
</ProcessMauiFontsBeforeTargets>

<MauiGeneratePackageAppxManifestDependsOnTargets>
$(MauiGeneratePackageAppxManifestDependsOnTargets);
ResizetizeCollectItems;
</MauiGeneratePackageAppxManifestDependsOnTargets>
</PropertyGroup>

<!-- WPF -->
Expand Down Expand Up @@ -546,6 +557,40 @@
</ItemGroup>
</Target>

<!-- This is required because the "CalculateAppxGenerateProjectPriEnabled" target explicitly depends
on "_ValidatePresenceOfAppxManifestItems" and we need to get in before then. -->
<Target Name="_ValidatePresenceOfAppxManifestItemsBeforeTarget"
BeforeTargets="_ValidatePresenceOfAppxManifestItems"
DependsOnTargets="MauiGeneratePackageAppxManifest" />

<Target Name="MauiGeneratePackageAppxManifest"
DependsOnTargets="$(MauiGeneratePackageAppxManifestDependsOnTargets)"
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_ResizetizerInputsFile);$(_MauiSplashInputsFile);@(AppxManifest)"
Outputs="$(_MauiManifestStampFile);$(_MauiIntermediateManifest)Package.appxmanifest">

<GeneratePackageAppxManifest
IntermediateOutputPath="$(_MauiIntermediateManifest)"
AppxManifest="@(AppxManifest)"
GeneratedFilename="Package.appxmanifest"
ApplicationId="$(ApplicationId)"
ApplicationDisplayVersion="$(ApplicationDisplayVersion)"
ApplicationVersion="$(ApplicationVersion)"
ApplicationTitle="$(ApplicationTitle)"
AppIcon="@(MauiImage->WithMetadataValue('IsAppIcon', 'true'))"
SplashScreen="@(MauiSplashScreen)" />

<!-- replace user manifest -->
<ItemGroup>
<AppxManifest Remove="@(AppxManifest)" />
<AppxManifest Include="$(_MauiIntermediateManifest)Package.appxmanifest" />
</ItemGroup>

<!-- Stamp file for Outputs -->
<Touch Files="$(_MauiManifestStampFile)" AlwaysCreate="True" />
<ItemGroup>
<FileWrites Include="$(_MauiManifestStampFile)" />
</ItemGroup>
</Target>

<Target Name="_CleanResizetizer">
<RemoveDir Directories="$(_ResizetizerIntermediateOutputRoot)" Condition="Exists ('$(_ResizetizerIntermediateOutputRoot)' )" />
Expand Down
4 changes: 3 additions & 1 deletion eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ Task("dotnet-samples")
.Does(() =>
{
RunMSBuildWithDotNet("./Microsoft.Maui.Samples.slnf", new Dictionary<string, string> {
["UseWorkload"] = bool.TrueString,
["UseWorkload"] = "true",
["GenerateAppxPackageOnBuild"] = "true",
});
});

Expand Down Expand Up @@ -102,6 +103,7 @@ Task("dotnet-templates")
var properties = new Dictionary<string, string> {
// Properties that ensure we don't use cached packages, and *only* the empty NuGet.config
{ "RestoreNoCache", "true" },
{ "GenerateAppxPackageOnBuild", "true" },
{ "RestorePackagesPath", MakeAbsolute(templatesTest.CombineWithFilePath("packages")).FullPath },
{ "RestoreConfigFile", MakeAbsolute(templatesTest.CombineWithFilePath("nuget.config")).FullPath },

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<WindowsPackageType Condition=" $(TargetFramework.Contains('-windows10.0.20348')) ">None</WindowsPackageType>
<ApplicationTitle>.NET MAUI Controls</ApplicationTitle>
<ApplicationId>com.microsoft.maui.sample</ApplicationId>
<ApplicationId Condition="$(TargetFramework.Contains('-windows'))">f9e4fa3e-3505-4742-9b2b-d1acdaff4ec8</ApplicationId>
Copy link
Member Author

Choose a reason for hiding this comment

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

Windows uses a GUID for this, so we unfortunately need to condition. Maybe we can have an $(ApplicationGuid)? Then we don't need this and we can potentially use that GUID in other OS. Not sure what Tizen uses? @rookiejava

<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<_FastDeploymentDiagnosticLogging>True</_FastDeploymentDiagnosticLogging>
<Platforms>AnyCPU;x86</Platforms>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="f9e4fa3e-3505-4742-9b2b-d1acdaff4ec8"
Publisher="CN=.NET Foundation"
Version="1.0.0.0" />

<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Publisher="CN=.NET Foundation" />
<Properties>
<DisplayName>.NET MAUI Controls</DisplayName>
<PublisherDisplayName>.NET Foundation</PublisherDisplayName>
<Logo>appiconStoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
<Resource Language="x-generate" />
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName=".NET MAUI Controls"
Description=".NET MAUI Controls sample application"
BackgroundColor="transparent"
Square150x150Logo="appiconMediumTile.png"
Square44x44Logo="appiconLogo.png">
<uap:DefaultTile
Wide310x150Logo="appiconWideTile.png"
Square71x71Logo="appiconSmallTile.png"
Square310x310Logo="appiconLargeTile.png"
ShortName="Single Project">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile >
<uap:SplashScreen Image="dotnet_botSplashScreen.png" />
</uap:VisualElements>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements />
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
<DeviceCapability Name="location"/>
<DeviceCapability Name="location" />
</Capabilities>
</Package>
</Package>
Loading