Skip to content

Commit

Permalink
feat: Add template support for WinUI Desktop
Browse files Browse the repository at this point in the history
Update API surface to WinUI Preview 3
  • Loading branch information
jeromelaban committed Nov 17, 2020
1 parent c7bebb2 commit 063f98e
Show file tree
Hide file tree
Showing 26 changed files with 940 additions and 303 deletions.
2 changes: 1 addition & 1 deletion build/run-template-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ dotnet new unolib-crossruntime -n MyCrossRuntimeLib
Assert-ExitCodeIsZero

# WinUI - Default
dotnet new unoapp-winui -n UnoAppWinUI
dotnet new unoapp-winui -n UnoAppWinUI --winui-desktop=false
& $msbuild $debug UnoAppWinUI\UnoAppWinUI.sln
Assert-ExitCodeIsZero

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@

<_UnoLibTemplateFiles Include="..\UnoLibraryTemplate\**" Exclude="@(_UnoLibTemplateFilesExclude)" />
</ItemGroup>

<ItemGroup>
<UpToDateCheckInput Remove="content\unoapp-winui\UnoWinUIQuickStart.Windows.Package\Package.appxmanifest" />
</ItemGroup>

<Target Name="CopyUnoAppTemplate" BeforeTargets="Build">
<PropertyGroup>
Expand Down Expand Up @@ -156,9 +160,9 @@

<Target Name="AlignVsConfig" BeforeTargets="Build;Pack">
<!-- The master file for the .vsconfig is located in the wizard project -->
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp"/>
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp-prism"/>
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp-winui"/>
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp" />
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp-prism" />
<Copy SkipUnchangedFiles="true" SourceFiles="..\UnoSolutionTemplate.Wizard\.vsconfig" DestinationFolder="content/unoapp-winui" />
</Target>

<UsingTask TaskName="ReplaceContent" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
Expand Down Expand Up @@ -208,7 +212,7 @@
var replacedNuget = @"
<PackageReference Include=""Microsoft.WinUI"">
<Version>3.0.0-preview1.200515.3</Version>
<Version>3.0.0-preview3.201113.0</Version>
</PackageReference>
<PackageReference Include=""Microsoft.NETCore.UniversalWindowsPlatform"">";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"shortName": "unoapp-winui",
"sourceName": "UnoWinUIQuickStart",
"defaultName": "UnoApp",
"placeholderFilename": "template-ignore",
"preferNameDirectory": true,
"guids": [
Expand All @@ -32,7 +33,7 @@
"B445DF73-AC9E-4276-9FBA-7CB5AD5D2518",
"3EA9E612-E717-4E55-9034-DE653429FEFD", // WPF
"3EA9E612-E717-4E55-9034-C415CD62AF9A", // UWP
"2B1FDFB6-C93C-4CA1-A6AB-528C4B3654B9", // UWP
"2B1FDFB6-C93C-4CA1-A6AB-528C4B3654B9" // UWP
],
"symbols": {
"guid1": {
Expand All @@ -51,6 +52,46 @@
"format": "N"
}
},
"guid3": {
"type": "generated",
"generator": "guid",
"replaces": "$guid3$",
"parameters": {
"format": "N"
}
},
"guid4": {
"type": "generated",
"generator": "guid",
"replaces": "$guid4$",
"parameters": {
"format": "N"
}
},
"guid5": {
"type": "generated",
"generator": "guid",
"replaces": "$guid5$",
"parameters": {
"format": "N"
}
},
"guid6": {
"type": "generated",
"generator": "guid",
"replaces": "$guid6$",
"parameters": {
"format": "N"
}
},
"guid7": {
"type": "generated",
"generator": "guid",
"replaces": "$guid7$",
"parameters": {
"format": "N"
}
},
"windowsPublisherName": {
"type": "parameter",
"datatype": "text",
Expand Down Expand Up @@ -88,6 +129,24 @@
"defaultValue": "true",
"description": "Enables the macOS platform support project"
},
"skia-wpf": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "Enables the Skia/WPF platform support project"
},
"skia-gtk": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "Enables the Skia/GTK platform support project"
},
"winui-desktop": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true",
"description": "Enables the WinUI desktop platform support project"
},
"vscodeWasm": {
"type": "parameter",
"dataType": "bool",
Expand All @@ -111,13 +170,33 @@
"condition": "UWP",
"path": "UnoWinUIQuickStart.UWP\\UnoWinUIQuickStart.Uwp.csproj"
},
{
"condition": "winui-desktop",
"path": "UnoWinUIQuickStart.Windows.Desktop\\UnoWinUIQuickStart.Windows.Desktop.csproj"
},
{
"condition": "winui-desktop",
"path": "UnoWinUIQuickStart.Windows.Package\\UnoWinUIQuickStart.Windows.Package.csproj"
},
{
"condition": "Wasm",
"path": "UnoWinUIQuickStart.Wasm\\UnoWinUIQuickStart.Wasm.csproj"
},
{
"condition": "macOS",
"path": "UnoWinUIQuickStart.macOS\\UnoWinUIQuickStart.macOS.csproj"
},
{
"condition": "skia-gtk",
"path": "UnoWinUIQuickStart.macOS\\UnoWinUIQuickStart.Skia.Gtk.csproj"
},
{
"condition": "skia-wpf",
"path": "UnoWinUIQuickStart.macOS\\UnoWinUIQuickStart.Skia.WPF.csproj"
},
{
"condition": "skia-wpf",
"path": "UnoWinUIQuickStart.macOS\\UnoWinUIQuickStart.Skia.WPF.Host.csproj"
}
],
"sources": [
Expand Down Expand Up @@ -153,6 +232,19 @@
"UnoWinUIQuickStart.UWP/**/*"
]
},
{
"condition": "(!skia-gtk)",
"exclude": [
"UnoWinUIQuickStart.Skia.Gtk/**/*"
]
},
{
"condition": "(!skia-wpf)",
"exclude": [
"UnoWinUIQuickStart.Skia.WPF/**/*",
"UnoWinUIQuickStart.Skia.WPF.Host/**/*"
]
},
{
"condition": "(!vscodeWasm)",
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"$isMultiProjectTemplate$": "true"
},
"symbolInfo": [
{
"id": "windowsPublisherName",
"name": {
"text": "Provides the value to use for the Windows head publisher"
},
"isVisible": "true"
},
{
"id": "WebAssembly",
"name": {
"text": "Enables the WebAssembly platform support project"
},
"isVisible": "true"
},
{
"id": "UWP",
"name": {
Expand Down Expand Up @@ -43,6 +57,27 @@
"text": "Add support for macOS"
},
"isVisible": "true"
},
{
"id": "skia-wpf",
"name": {
"text": "Enables the Skia/WPF platform support project"
},
"isVisible": "true"
},
{
"id": "skia-gtk",
"name": {
"text": "Enables the Skia/GTK platform support project"
},
"isVisible": "true"
},
{
"id": "vscodeWasm",
"name": {
"text": "Adds the Visual Studio Code Debugging support files for WebAssembly"
},
"isVisible": "false"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>arm64</Platform>
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x86</Platform>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<RootNamespace>UnoWinUIQuickStart</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
<PackageReference Include="Microsoft.WinUI" Version="3.0.0-preview3.201113.0" />
<Manifest Include="$(ApplicationManifest)" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Uno.Core" Version="2.0.0" />
</ItemGroup>

<Import Project="..\UnoWinUIQuickStart.Shared\UnoWinUIQuickStart.Shared.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="$projectname$.app"/>

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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="$guid7$"
Publisher="O=UnoWinUIQuickStart"
Version="1.0.0.0" />

<Properties>
<DisplayName>UnoWinUIQuickStart</DisplayName>
<PublisherDisplayName>UnoWinUIQuickStart</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>

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

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="UnoWinUIQuickStart"
Description="UnoWinUIQuickStart"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

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

0 comments on commit 063f98e

Please sign in to comment.