Skip to content

Commit 2881145

Browse files
committed
Add Uno.Sdk project head
1 parent 13b4ee2 commit 2881145

35 files changed

Lines changed: 611 additions & 2 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<Project Sdk="Uno.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFrameworks>net9.0-desktop;net9.0-browserwasm;net9.0-android;net9.0-ios</TargetFrameworks>
5+
6+
<UnoFeatures>
7+
SkiaRenderer;
8+
</UnoFeatures>
9+
10+
<IsPackable>false</IsPackable>
11+
<RootNamespace>CommunityToolkit.App.Uno</RootNamespace>
12+
13+
<!-- Platform flags for Generated/*.props project reference conditions -->
14+
<IsDeployableHead>true</IsDeployableHead>
15+
<IsUno>true</IsUno>
16+
<IsWasm>true</IsWasm>
17+
<HasWinUI>true</HasWinUI>
18+
<WinUIMajorVersion>3</WinUIMajorVersion>
19+
<IsAllExperimentHead>true</IsAllExperimentHead>
20+
<DependencyVariant>WinUI</DependencyVariant>
21+
22+
<DefineConstants>$(DefineConstants);WINUI3</DefineConstants>
23+
</PropertyGroup>
24+
25+
<Import Project="$(ToolingDirectory)\MultiTarget\DefinedConstants.props" />
26+
<Import Project="$(ToolingDirectory)\MultiTarget\GlobalUsings.props" />
27+
28+
<!-- Auto-generated project references -->
29+
<Import Project="$(ToolingDirectory)\MultiTarget\Generated\*.Samples.props" />
30+
<Import Project="$(ToolingDirectory)\MultiTarget\Generated\*.Source.props" />
31+
32+
<!-- Force component project references to resolve to net9.0 (not windows-specific) -->
33+
<ItemGroup>
34+
<ProjectReference Update="$(RepositoryDirectory)components\**\*.csproj" SetTargetFramework="TargetFramework=net9.0" />
35+
</ItemGroup>
36+
37+
<!-- Shared app code -->
38+
<Import Project="$(ToolingDirectory)\CommunityToolkit.App.Shared\CommunityToolkit.App.Shared.projitems" Label="Shared" />
39+
<Import Project="$(ToolingDirectory)\ProjectHeads\Targets\AddMultiTargetCompatibleSampleDocs.targets" />
40+
41+
<!-- Head dependencies (from App.Head.props) -->
42+
<ItemGroup>
43+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
44+
<PackageReference Include="Markdig" Version="0.38.0" />
45+
</ItemGroup>
46+
47+
<!-- Source generators -->
48+
<ItemGroup>
49+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
50+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="$(ToolingDirectory)\CommunityToolkit.Tooling.SampleGen\CommunityToolkit.Tooling.SampleGen.csproj"
54+
OutputItemType="Analyzer" ReferenceOutputAssembly="true" />
55+
</ItemGroup>
56+
57+
<!-- Gallery dependencies -->
58+
<ItemGroup>
59+
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
60+
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
61+
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
62+
<PackageReference Include="CommunityToolkit.WinUI.Triggers" Version="8.2.250402" />
63+
</ItemGroup>
64+
65+
<!-- Uno app dependencies -->
66+
<ItemGroup>
67+
<PackageReference Include="Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI" Version="3.0.3" />
68+
</ItemGroup>
69+
70+
<!-- Sample doc content inclusion -->
71+
<ItemGroup>
72+
<Content Include="$(RepositoryDirectory)components\**\samples\**\*.md"
73+
Exclude="$(RepositoryDirectory)**\**\samples\obj\**\*.md;$(RepositoryDirectory)**\**\samples\bin\**\*.md;$(RepositoryDirectory)**\SourceAssets\**\*.md">
74+
<Link>SourceAssets/%(RecursiveDir)%(FileName)%(Extension)</Link>
75+
</Content>
76+
<Content Include="$(RepositoryDirectory)components\**\samples\**\*.xaml"
77+
Exclude="$(RepositoryDirectory)**\**\samples\obj\**\*.xaml;$(RepositoryDirectory)**\**\samples\bin\**\*.xaml;$(RepositoryDirectory)**\SourceAssets\**\*.xaml">
78+
<Link>SourceAssets/%(RecursiveDir)%(FileName)%(Extension)</Link>
79+
</Content>
80+
<Content Include="$(RepositoryDirectory)components\**\samples\**\*.cs"
81+
Exclude="$(RepositoryDirectory)**\**\samples\obj\**\*.cs;$(RepositoryDirectory)**\**\samples\bin\**\*.cs">
82+
<Link>SourceAssets/%(RecursiveDir)%(FileName)%(Extension).dat</Link>
83+
</Content>
84+
<AdditionalFiles Include="$(RepositoryDirectory)components\**\src\**\*.csproj" />
85+
</ItemGroup>
86+
87+
<PropertyGroup>
88+
<NoWarn>$(NoWarn);IL2026;Uno0006</NoWarn>
89+
</PropertyGroup>
90+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35" />
4+
<application android:label="CommunityToolkit" />
5+
</manifest>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Any raw assets you want to be deployed with your application can be placed in this
2+
directory (and child directories). Deployment of the asset to your application is done
3+
using the IDE or by using the following MSBuild property in your .csproj:
4+
5+
<AndroidAsset Include="Assets\filename.ext" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Android.App;
2+
using Android.Runtime;
3+
4+
namespace CommunityToolkit.App.Uno;
5+
6+
[global::Android.App.ApplicationAttribute(
7+
Label = "@string/ApplicationName",
8+
Icon = "@mipmap/iconapp",
9+
LargeHeap = true,
10+
HardwareAccelerated = true,
11+
Theme = "@style/AppTheme"
12+
)]
13+
public class Application : Microsoft.UI.Xaml.NativeApplication
14+
{
15+
public Application(IntPtr javaReference, JniHandleOwnership transfer)
16+
: base(() => new CommunityToolkit.App.Shared.App(), javaReference, transfer)
17+
{
18+
}
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Android.OS;
4+
using Android.Views;
5+
using Android.Widget;
6+
7+
namespace CommunityToolkit.App.Uno;
8+
9+
[Activity(
10+
MainLauncher = true,
11+
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12+
WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
13+
)]
14+
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15+
{
16+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="ApplicationName">CommunityToolkit</string>
4+
</resources>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<resources>
3+
<style name="AppTheme" parent="Theme.AppCompat.Light">
4+
</style>
5+
6+
<style name="AppTheme.Starting" parent="Theme.SplashScreen">
7+
</style>
8+
</resources>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Mono GC tuning params
2+
MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Uno.UI.Hosting;
2+
using CommunityToolkit.App.Shared;
3+
4+
internal class Program
5+
{
6+
[STAThread]
7+
public static void Main(string[] args)
8+
{
9+
var host = UnoPlatformHostBuilder.Create()
10+
.App(() => new App())
11+
.UseX11()
12+
.UseLinuxFrameBuffer()
13+
.UseMacOS()
14+
.UseWin32()
15+
.Build();
16+
17+
host.Run();
18+
}
19+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<linker>
2+
<assembly fullname="CommunityToolkit.App.Uno" />
3+
</linker>

0 commit comments

Comments
 (0)