generated from unoplatform/template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Always run generation on build (#112)
* chore: Add net6 winui template validation * fix: Always run generation on build Avoids skipped generation on forced targetframework, which can happen when a build is performed through VS's Debug button on multi-targeted projects, or using `-f` on the CLI. * ci: adjust samples tests to remove window target * ci: Adjust build options
- Loading branch information
1 parent
c86c94b
commit 981a35b
Showing
127 changed files
with
2,902 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"solution": { | ||
"path": "..\\src\\Uno.XamlMerge.Task.sln", | ||
"projects": [ | ||
"UWP\\TestLibrarySingleFile\\TestLibrarySingleFile.csproj", | ||
"UWP\\TestLibrary\\TestLibrary.csproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.Droid\\XamlMergeUWPTest.Droid.csproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.Shared\\XamlMergeUWPTest.Shared.shproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.Skia.Gtk\\XamlMergeUWPTest.Skia.Gtk.csproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.UWP\\XamlMergeUWPTest.UWP.csproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.Wasm\\XamlMergeUWPTest.Wasm.csproj", | ||
"UWP\\XamlMergeUWPTest\\XamlMergeUWPTest.iOS\\XamlMergeUWPTest.iOS.csproj", | ||
"Uno.XamlMerge.Task\\Uno.XamlMerge.Task.csproj", | ||
"Uno.XamlMerge.Tests\\Uno.XamlMerge.Tests.csproj", | ||
"WinUI\\TestLibraryWinUI\\TestLibraryWinUI.csproj", | ||
"WinUI\\XamlMergeWinUITest.Mobile\\XamlMergeWinUITest.Mobile.csproj", | ||
"WinUI\\XamlMergeWinUITest.Shared\\XamlMergeWinUITest.Shared.shproj", | ||
"WinUI\\XamlMergeWinUITest.Skia.Gtk\\XamlMergeWinUITest.Skia.Gtk.csproj", | ||
"WinUI\\XamlMergeWinUITest.Wasm\\XamlMergeWinUITest.Wasm.csproj" | ||
] | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace TestLibraryWinUI | ||
{ | ||
public class Class1 | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary"> | ||
|
||
<x:String x:Key="TestLibrary_String02">TestLibrary String 02</x:String> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary"> | ||
|
||
<Style x:Key="Button" | ||
TargetType="TextBlock"> | ||
<Setter Property="FontSize" | ||
Value="12" /> | ||
</Style> | ||
<Style TargetType="Button"> | ||
<Setter Property="FontSize" | ||
Value="24" /> | ||
</Style> | ||
|
||
</ResourceDictionary> |
42 changes: 42 additions & 0 deletions
42
src/WinUI/TestLibraryWinUI/Inner1/ResourceDictionary2.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:xamarin="http://uno.ui/xamarin" | ||
xmlns:android="http://uno.ui/android" | ||
xmlns:ios="http://uno.ui/ios" | ||
xmlns:wasm="http://uno.ui/wasm" | ||
xmlns:macos="http://uno.ui/macos" | ||
xmlns:skia="http://uno.ui/skia" | ||
mc:Ignorable="d xamarin ios android macos wasm skia xamarin"> | ||
|
||
<ResourceDictionary.ThemeDictionaries> | ||
<ResourceDictionary x:Key="Default"> | ||
<!-- Added manually (not part of UWP's SystemResources.xaml) --> | ||
<Color x:Key="SystemColorHighlightColor">#FF3399FF</Color> | ||
|
||
<ios:FontFamily x:Key="SymbolThemeFontFamily">Symbols</ios:FontFamily> | ||
<macos:FontFamily x:Key="SymbolThemeFontFamily">Symbols</macos:FontFamily> | ||
<wasm:FontFamily x:Key="SymbolThemeFontFamily">Symbols</wasm:FontFamily> | ||
<skia:FontFamily x:Key="SymbolThemeFontFamily">ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols</skia:FontFamily> | ||
<android:FontFamily x:Key="SymbolThemeFontFamily">ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols</android:FontFamily> | ||
</ResourceDictionary> | ||
</ResourceDictionary.ThemeDictionaries> | ||
|
||
<x:String x:Key="TestLibrary_String02">TestLibrary String 02</x:String> | ||
|
||
<!-- TODO: ItemsControl should inject ItemsPresenter directly if no template is found. (Change this once template is materialized on Measure) --> | ||
<xamarin:Style TargetType="ItemsControl"> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="ItemsControl"> | ||
<ItemsPresenter Padding="{TemplateBinding Padding}" /> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</xamarin:Style> | ||
|
||
<x:String x:Key="TestLibrary_String03">TestLibrary String 02</x:String> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary"> | ||
|
||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="ms-appx:///TestLibrary/Colors.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary"> | ||
|
||
<x:String x:Key="TestLibrary_String">TestLibrary String</x:String> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0-windows10.0.18362;netstandard2.0;net6.0-ios;net6.0-macos;net6.0-maccatalyst;net6.0-android</TargetFrameworks> | ||
<!-- Ensures the .xr.xml files are generated in a proper layout folder --> | ||
<GenerateLibraryLayout>true</GenerateLibraryLayout> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'=='net6.0-windows10.0.18362'"> | ||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.3" /> | ||
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.22000.24" /> | ||
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.22000.24" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'!='net6.0-windows10.0.18362'"> | ||
<PackageReference Include="Uno.WinUI" Version="4.6.19" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'!='net6.0-windows10.0.18362'"> | ||
<Content Include="Assets\**" /> | ||
<Page Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
<Compile Update="**\*.xaml.cs"> | ||
<DependentUpon>%(Filename)</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<UpToDateCheckInput Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<XamlMergeOutputFiles Include="$(BaseIntermediateOutputPath)\Generated\mergedpages01.xaml" /> | ||
<XamlMergeOutputFiles Include="$(BaseIntermediateOutputPath)\Generated\mergedpages02.xaml" /> | ||
<XamlMergeInput Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml;Themes\Generic.xaml" MergeFile="mergedpages01.xaml" /> | ||
</ItemGroup> | ||
|
||
<Import Project="..\..\Uno.XamlMerge.Task\build\Uno.XamlMerge.Task.targets" /> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Uno.XamlMerge.Task\Uno.XamlMerge.Task.csproj"> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> | ||
<UndefineProperties>TargetFramework</UndefineProperties> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestLibrary"> | ||
|
||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="ms-appx:///TestLibrary/Generated/mergedpages.xaml" /> | ||
|
||
</ResourceDictionary.MergedDictionaries> | ||
|
||
<x:String x:Key="test01">test01</x:String> | ||
</ResourceDictionary> |
5 changes: 5 additions & 0 deletions
5
src/WinUI/XamlMergeWinUITest.Mobile/Android/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.XamlMergeWinUITest" android:versionCode="1" android:versionName="1.0"> | ||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" /> | ||
<application android:label="XamlMergeWinUITest"></application> | ||
</manifest> |
22 changes: 22 additions & 0 deletions
22
src/WinUI/XamlMergeWinUITest.Mobile/Android/Assets/AboutAssets.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
To add cross-platform image assets for your Uno Platform app, use the Assets folder | ||
in the shared project instead. Assets in this folder are Android-only assets. | ||
|
||
Any raw assets you want to be deployed with your application can be placed in | ||
this directory (and child directories) and given a Build Action of "AndroidAsset". | ||
|
||
These files will be deployed with you package and will be accessible using Android's | ||
AssetManager, like this: | ||
|
||
public class ReadAsset : Activity | ||
{ | ||
protected override void OnCreate (Bundle bundle) | ||
{ | ||
base.OnCreate (bundle); | ||
|
||
InputStream input = Assets.Open ("my_asset.txt"); | ||
} | ||
} | ||
|
||
Additionally, some Android functions will automatically load asset files: | ||
|
||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
Binary file added
BIN
+431 KB
src/WinUI/XamlMergeWinUITest.Mobile/Android/Assets/Fonts/uno-fluentui-assets.ttf
Binary file not shown.
43 changes: 43 additions & 0 deletions
43
src/WinUI/XamlMergeWinUITest.Mobile/Android/Main.Android.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Android.App; | ||
using Android.Content; | ||
using Android.OS; | ||
using Android.Runtime; | ||
using Android.Views; | ||
using Android.Widget; | ||
using Com.Nostra13.Universalimageloader.Core; | ||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace XamlMergeWinUITest.Droid | ||
{ | ||
[global::Android.App.ApplicationAttribute( | ||
Label = "@string/ApplicationName", | ||
Icon = "@mipmap/icon", | ||
LargeHeap = true, | ||
HardwareAccelerated = true, | ||
Theme = "@style/AppTheme" | ||
)] | ||
public class Application : Microsoft.UI.Xaml.NativeApplication | ||
{ | ||
public Application(IntPtr javaReference, JniHandleOwnership transfer) | ||
: base(() => new App(), javaReference, transfer) | ||
{ | ||
ConfigureUniversalImageLoader(); | ||
} | ||
|
||
private static void ConfigureUniversalImageLoader() | ||
{ | ||
// Create global configuration and initialize ImageLoader with this config | ||
ImageLoaderConfiguration config = new ImageLoaderConfiguration | ||
.Builder(Context) | ||
.Build(); | ||
|
||
ImageLoader.Instance.Init(config); | ||
|
||
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/WinUI/XamlMergeWinUITest.Mobile/Android/MainActivity.Android.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Android.App; | ||
using Android.Widget; | ||
using Android.OS; | ||
using Android.Content.PM; | ||
using Android.Views; | ||
|
||
namespace XamlMergeWinUITest | ||
{ | ||
[Activity( | ||
MainLauncher = true, | ||
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, | ||
WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden | ||
)] | ||
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity | ||
{ | ||
} | ||
} | ||
|
Oops, something went wrong.