diff --git a/src/Benchmarks/Benchmarks.Wasm/Benchmarks.Wasm.sln b/src/Benchmarks/Benchmarks.Wasm/Benchmarks.Wasm.sln new file mode 100644 index 0000000..98583ec --- /dev/null +++ b/src/Benchmarks/Benchmarks.Wasm/Benchmarks.Wasm.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks.Wasm", "Benchmarks.Wasm.csproj", "{C139918E-4E50-FEAE-94DB-E16E9D622EA5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C139918E-4E50-FEAE-94DB-E16E9D622EA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C139918E-4E50-FEAE-94DB-E16E9D622EA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C139918E-4E50-FEAE-94DB-E16E9D622EA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C139918E-4E50-FEAE-94DB-E16E9D622EA5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DB80F2C1-3FAF-489D-B214-5E86D1F3712D} + EndGlobalSection +EndGlobal diff --git a/src/dopes/Uno-dotnet6/DopeTestUno/DopeTestUno.Skia.Gtk/DopeTestUno.Skia.Gtk.csproj b/src/dopes/Uno-dotnet6/DopeTestUno/DopeTestUno.Skia.Gtk/DopeTestUno.Skia.Gtk.csproj index 04eb153..9d219be 100644 --- a/src/dopes/Uno-dotnet6/DopeTestUno/DopeTestUno.Skia.Gtk/DopeTestUno.Skia.Gtk.csproj +++ b/src/dopes/Uno-dotnet6/DopeTestUno/DopeTestUno.Skia.Gtk/DopeTestUno.Skia.Gtk.csproj @@ -12,7 +12,7 @@ - + are diff --git a/src/dopesbench/.editorconfig b/src/dopesbench/.editorconfig new file mode 100644 index 0000000..ee73562 --- /dev/null +++ b/src/dopesbench/.editorconfig @@ -0,0 +1,167 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +# This file is the top-most EditorConfig file +root = true + +########################################## +# Common Settings +########################################## + +[*] +indent_style = space +end_of_line = crlf +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 + +########################################## +# File Extension Settings +########################################## + +[*.{yml,yaml}] +indent_size = 2 + +[.vsconfig] +indent_size = 2 +end_of_line = lf + +[*.sln] +indent_style = tab +indent_size = 2 + +[*.{csproj,proj,projitems,shproj}] +indent_size = 4 + +[*.{json,slnf}] +indent_size = 2 +end_of_line = lf + +[*.{props,targets}] +indent_size = 4 + +[*.xaml] +indent_size = 4 +charset = utf-8-bom + +[*.xml] +indent_size = 4 +end_of_line = lf + +[*.plist] +indent_size = 4 +indent_style = tab +end_of_line = lf + +[*.manifest] +indent_size = 4 + +[*.appxmanifest] +indent_size = 4 + +[*.{json,css,webmanifest}] +indent_size = 2 +end_of_line = lf + +[web.config] +indent_size = 4 +end_of_line = lf + +[*.sh] +indent_size = 2 +end_of_line = lf + +[*.cs] +# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099 +end_of_line = unset + +# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926 +trim_trailing_whitespace = false + +tab_width = 4 +indent_size = 4 + +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true + +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion + +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = file_scoped:warning +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/src/dopesbench/.gitignore b/src/dopesbench/.gitignore new file mode 100644 index 0000000..3860b21 --- /dev/null +++ b/src/dopesbench/.gitignore @@ -0,0 +1,412 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +[Aa][Rr][Mm]64[Ee][Cc]/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Approval Tests result files +*.received.* + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.idb +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +# but not Directory.Build.rsp, as it configures directory-level build defaults +!Directory.Build.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# AWS SAM Build and Temporary Artifacts folder +.aws-sam + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# Single Target Config +solution-config.props +# Publish Profiles +!**/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/src/dopesbench/.run/Readme.md b/src/dopesbench/.run/Readme.md new file mode 100644 index 0000000..6e72638 --- /dev/null +++ b/src/dopesbench/.run/Readme.md @@ -0,0 +1,3 @@ +# About the `.run` folder + +This folder is present to add support for the [Rider IDE](https://aka.platform.uno/rider-getstarted). You can remove this folder safely if you're not using Rider. diff --git a/src/dopesbench/.run/dopesbench.run.xml b/src/dopesbench/.run/dopesbench.run.xml new file mode 100644 index 0000000..4241677 --- /dev/null +++ b/src/dopesbench/.run/dopesbench.run.xml @@ -0,0 +1,47 @@ + + + + + + + + diff --git a/src/dopesbench/.vscode/extensions.json b/src/dopesbench/.vscode/extensions.json new file mode 100644 index 0000000..a63ad40 --- /dev/null +++ b/src/dopesbench/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "unoplatform.vscode" + ], +} diff --git a/src/dopesbench/.vscode/launch.json b/src/dopesbench/.vscode/launch.json new file mode 100644 index 0000000..b8be34d --- /dev/null +++ b/src/dopesbench/.vscode/launch.json @@ -0,0 +1,77 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": "Uno Platform Mobile Debug", + "type": "Uno", + "request": "launch", + // any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present + "preLaunchTask": "Uno: android | Debug | android-x64" + }, + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": "Uno Platform WebAssembly Debug (Chrome)", + "type": "chrome", + "request": "launch", + "url": "http://localhost:5000", + "webRoot": "${workspaceFolder}/dopesbench", + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "timeout": 30000, + "preLaunchTask": "build-wasm", + "server": { + "runtimeExecutable": "dotnet", + "program": "run", + "args": ["--no-build","-f","net9.0-browserwasm","--launch-profile", "dopesbench (WebAssembly)"], + "outputCapture": "std", + "timeout": 30000, + "cwd": "${workspaceFolder}/dopesbench" + } + }, + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": "Uno Platform WebAssembly Debug (Edge)", + "type": "msedge", + "request": "launch", + "url": "http://localhost:5000", + "webRoot": "${workspaceFolder}/dopesbench", + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "timeout": 30000, + "preLaunchTask": "build-wasm", + "server": { + "runtimeExecutable": "dotnet", + "program": "run", + "args": ["--no-build","-f","net9.0-browserwasm","--launch-profile", "dopesbench (WebAssembly)"], + "outputCapture": "std", + "timeout": 30000, + "cwd": "${workspaceFolder}/dopesbench" + } + }, + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": "Uno Platform Desktop Debug", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-desktop", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/dopesbench/bin/Debug/net9.0-desktop/dopesbench.dll", + "args": [], + "launchSettingsProfile": "dopesbench (Desktop)", + "env": { + "DOTNET_MODIFIABLE_ASSEMBLIES": "debug" + }, + "cwd": "${workspaceFolder}/dopesbench", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + ] +} diff --git a/src/dopesbench/.vscode/settings.json b/src/dopesbench/.vscode/settings.json new file mode 100644 index 0000000..3405922 --- /dev/null +++ b/src/dopesbench/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.expand": false, + "explorer.fileNesting.patterns": { + "*.xaml": "$(capture).xaml.cs" + }, + "files.associations": { + "global.json": "jsonc" + } +} diff --git a/src/dopesbench/.vscode/tasks.json b/src/dopesbench/.vscode/tasks.json new file mode 100644 index 0000000..ae90e9f --- /dev/null +++ b/src/dopesbench/.vscode/tasks.json @@ -0,0 +1,57 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build-wasm", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/dopesbench/dopesbench.csproj", + "/property:GenerateFullPaths=true", + "/property:TargetFramework=net9.0-browserwasm", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish-wasm", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/dopesbench/dopesbench.csproj", + "/property:GenerateFullPaths=true", + "/property:TargetFramework=net9.0-browserwasm", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "build-desktop", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/dopesbench/dopesbench.csproj", + "/property:GenerateFullPaths=true", + "/property:TargetFramework=net9.0-desktop", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish-desktop", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/dopesbench/dopesbench.csproj", + "/property:GenerateFullPaths=true", + "/property:TargetFramework=net9.0-desktop", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] +} diff --git a/src/dopesbench/.vsconfig b/src/dopesbench/.vsconfig new file mode 100644 index 0000000..f6ff391 --- /dev/null +++ b/src/dopesbench/.vsconfig @@ -0,0 +1,30 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.NetCore.Component.SDK", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.NetCore.Component.Web", + "Microsoft.VisualStudio.Component.IISExpress", + "Component.Microsoft.Web.LibraryManager", + "Microsoft.VisualStudio.ComponentGroup.Web", + "Microsoft.VisualStudio.Component.Web", + "Microsoft.VisualStudio.ComponentGroup.Web.Client", + "Microsoft.VisualStudio.Workload.NetWeb", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Component.Xamarin.RemotedSimulator", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.OpenJDK", + "Microsoft.VisualStudio.Workload.NetCrossPlat", + "Microsoft.VisualStudio.Workload.NetCoreTools" + ] +} diff --git a/src/dopesbench/Directory.Build.props b/src/dopesbench/Directory.Build.props new file mode 100644 index 0000000..8daf569 --- /dev/null +++ b/src/dopesbench/Directory.Build.props @@ -0,0 +1,15 @@ + + + enable + enable + true + + + $(NoWarn);NU1507;NETSDK1201;PRI257 + + diff --git a/src/dopesbench/Directory.Build.targets b/src/dopesbench/Directory.Build.targets new file mode 100644 index 0000000..f75adf7 --- /dev/null +++ b/src/dopesbench/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/src/dopesbench/Directory.Packages.props b/src/dopesbench/Directory.Packages.props new file mode 100644 index 0000000..f366262 --- /dev/null +++ b/src/dopesbench/Directory.Packages.props @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/dopesbench/dopesbench.sln b/src/dopesbench/dopesbench.sln new file mode 100644 index 0000000..6775273 --- /dev/null +++ b/src/dopesbench/dopesbench.sln @@ -0,0 +1,90 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32210.308 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dopesbench", "dopesbench\dopesbench.csproj", "{F1EDEBA3-4A34-4935-8218-8230A27DCB72}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BADA71DC-7FFD-4EDC-9F28-FB74AEADC713}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + .vsconfig = .vsconfig + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + global.json = global.json + EndProjectSection +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Benchmarks.Shared", "dopesbench\Benchmarks.Shared\Benchmarks.Shared.shproj", "{6279C845-92F8-4333-AB99-3D213163593C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM64.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|ARM64.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhone.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhone.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x64.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x64.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x86.ActiveCfg = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x86.Build.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Debug|x86.Deploy.0 = Debug|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|Any CPU.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|Any CPU.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM64.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM64.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|ARM64.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhone.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhone.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhone.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x64.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x64.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x64.Deploy.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x86.ActiveCfg = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x86.Build.0 = Release|Any CPU + {F1EDEBA3-4A34-4935-8218-8230A27DCB72}.Release|x86.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {55CBD133-33C2-4412-9634-A5983D990F39} + EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + dopesbench\Benchmarks.Shared\Benchmarks.Shared.projitems*{6279c845-92f8-4333-ab99-3d213163593c}*SharedItemsImports = 13 + EndGlobalSection +EndGlobal diff --git a/src/dopesbench/dopesbench/App.xaml b/src/dopesbench/dopesbench/App.xaml new file mode 100644 index 0000000..daffb58 --- /dev/null +++ b/src/dopesbench/dopesbench/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/src/dopesbench/dopesbench/App.xaml.cs b/src/dopesbench/dopesbench/App.xaml.cs new file mode 100644 index 0000000..0963a5d --- /dev/null +++ b/src/dopesbench/dopesbench/App.xaml.cs @@ -0,0 +1,122 @@ +using System; +using Microsoft.Extensions.Logging; +using Uno.Resizetizer; + +namespace dopesbench; + +public partial class App : Application +{ + public static Window MainAppWindow { get; private set; } + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected Window? MainWindow { get; private set; } + + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + MainWindow = new Window(); + MainAppWindow = MainWindow; +#if DEBUG + MainWindow.UseStudio(); +#endif + + + if (MainWindow.Content is not Components.AppBar shell) + { + shell = new Components.AppBar(); + MainWindow.Content = shell; + } + + shell.Navigate(typeof(HomePage), args.Arguments); + + MainWindow.SetWindowIcon(); + // Ensure the current window is active + MainWindow.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); + } + + /// + /// Configures global Uno Platform logging + /// + public static void InitializeLogging() + { +#if DEBUG + // Logging is disabled by default for release builds, as it incurs a significant + // initialization cost from Microsoft.Extensions.Logging setup. If startup performance + // is a concern for your application, keep this disabled. If you're running on the web or + // desktop targets, you can use URL or command line parameters to enable it. + // + // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html + + var factory = LoggerFactory.Create(builder => + { +#if __WASM__ + builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider()); +#elif __IOS__ + builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider()); + + // Log to the Visual Studio Debug console + builder.AddConsole(); +#else + builder.AddConsole(); +#endif + + // Exclude logs below this level + builder.SetMinimumLevel(LogLevel.Information); + + // Default filters for Uno Platform namespaces + builder.AddFilter("Uno", LogLevel.Warning); + builder.AddFilter("Windows", LogLevel.Warning); + builder.AddFilter("Microsoft", LogLevel.Warning); + + // Generic Xaml events + // builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.UIElement", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.FrameworkElement", LogLevel.Trace ); + + // Layouter specific messages + // builder.AddFilter("Microsoft.UI.Xaml.Controls", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Layouter", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Panel", LogLevel.Debug ); + + // builder.AddFilter("Windows.Storage", LogLevel.Debug ); + + // Binding related messages + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + + // Binder memory references tracking + // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug ); + + // DevServer and HotReload related + // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information); + + // Debug JS interop + // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug ); + }); + + global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory; + +#if HAS_UNO + global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize(); +#endif +#endif + } +} diff --git a/src/dopesbench/dopesbench/Assets/Icons/icon.svg b/src/dopesbench/dopesbench/Assets/Icons/icon.svg new file mode 100644 index 0000000..a15af53 --- /dev/null +++ b/src/dopesbench/dopesbench/Assets/Icons/icon.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/src/dopesbench/dopesbench/Assets/Icons/icon_foreground.svg b/src/dopesbench/dopesbench/Assets/Icons/icon_foreground.svg new file mode 100644 index 0000000..8ffc41a --- /dev/null +++ b/src/dopesbench/dopesbench/Assets/Icons/icon_foreground.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dopesbench/dopesbench/Assets/SharedAssets.md b/src/dopesbench/dopesbench/Assets/SharedAssets.md new file mode 100644 index 0000000..b1cc4e7 --- /dev/null +++ b/src/dopesbench/dopesbench/Assets/SharedAssets.md @@ -0,0 +1,32 @@ +# Shared Assets + +See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +## Here is a cheat sheet + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +### Examples + +```text +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +### Table of scales + +| Scale | WinUI | iOS | Android | +|-------|:-----------:|:---------------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | diff --git a/src/dopesbench/dopesbench/Assets/Splash/splash_screen.svg b/src/dopesbench/dopesbench/Assets/Splash/splash_screen.svg new file mode 100644 index 0000000..8ffc41a --- /dev/null +++ b/src/dopesbench/dopesbench/Assets/Splash/splash_screen.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dopesbench/dopesbench/Assets/wallpaper_uno.jpg b/src/dopesbench/dopesbench/Assets/wallpaper_uno.jpg new file mode 100644 index 0000000..1c92f79 Binary files /dev/null and b/src/dopesbench/dopesbench/Assets/wallpaper_uno.jpg differ diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml b/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml new file mode 100644 index 0000000..13ea103 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml.cs b/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml.cs new file mode 100644 index 0000000..eaf0c58 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/App.xaml.cs @@ -0,0 +1,172 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Uno.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Uno.Foundation; +using Windows.Foundation.Collections; +using Uno.UI.Xaml; +using Uno.UI.Xaml.Controls; +using Uno.UI.Xaml.Input; +using Uno.UI.Xaml.Media; + +namespace Benchmarks +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public sealed partial class App : Application + { + private Window _window; + + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + InitializeLogging(); + + this.InitializeComponent(); + +#if HAS_UNO || NETFX_CORE + this.Suspending += OnSuspending; +#endif + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { +#if DEBUG + if (System.Diagnostics.Debugger.IsAttached) + { + // this.DebugSettings.EnableFrameRateCounter = true; + } +#endif + +#if NET5_0 && WINDOWS + _window = new Window(); + _window.Activate(); +#else + +#endif + + var rootFrame = _window.Content as Frame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + // Place the frame in the current Window + _window.Content = rootFrame; + } + + // Remove the problematic PrelaunchActivated check + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), args.Arguments); + } + // Ensure the current window is active + _window.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + // TODO: Save application state and stop any background activity + deferral.Complete(); + } + + /// + /// Configures global Uno Platform logging + /// + private static void InitializeLogging() + { + var factory = LoggerFactory.Create(builder => + { +#if __WASM__ + builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider()); +#elif __IOS__ + builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider()); +#elif NETFX_CORE + builder.AddDebug(); +#else + builder.AddConsole(); +#endif + + // Exclude logs below this level + builder.SetMinimumLevel(LogLevel.Information); + + // Default filters for Uno Platform namespaces + builder.AddFilter("Uno", LogLevel.Warning); + builder.AddFilter("Windows", LogLevel.Warning); + builder.AddFilter("Microsoft", LogLevel.Warning); + + // Generic Xaml events + // builder.AddFilter("Windows.UI.Xaml", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.VisualStateGroup", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.StateTriggerBase", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.UIElement", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.FrameworkElement", LogLevel.Trace ); + + // Layouter specific messages + // builder.AddFilter("Windows.UI.Xaml.Controls", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.Controls.Layouter", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.Controls.Panel", LogLevel.Debug ); + + // builder.AddFilter("Windows.Storage", LogLevel.Debug ); + + // Binding related messages + // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug ); + // builder.AddFilter("Windows.UI.Xaml.Data", LogLevel.Debug ); + + // Binder memory references tracking + // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug ); + + // RemoteControl and HotReload related + // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information); + + // Debug JS interop + // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug ); + }); + + global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory; + +#if HAS_UNO + global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize(); +#endif + } + } +} diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Assets/SharedAssets.md b/src/dopesbench/dopesbench/Benchmarks.Shared/Assets/SharedAssets.md new file mode 100644 index 0000000..6d84997 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Assets/SharedAssets.md @@ -0,0 +1,34 @@ +See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +# Here is a cheat sheet: + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +## Examples + +``` +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +## Table of scales + +| Scale | UWP | iOS | Android | +|-------|:-----------:|:--------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | + + + + diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmark.cs b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmark.cs new file mode 100644 index 0000000..5cca154 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmark.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace Benchmarks.Shared.Benchmarking +{ + internal interface IAsyncUIBenchmark + { + Task BenchmarkAsync(); + } +} diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmarkSetup.cs b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmarkSetup.cs new file mode 100644 index 0000000..f3b1ecd --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarking/IAsyncUIBenchmarkSetup.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace Benchmarks.Shared.Benchmarking +{ + internal interface IAsyncUIBenchmarkSetup + { + Task SetupAsync(); + Task TeardownAsync(); + } +} diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.projitems b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.projitems new file mode 100644 index 0000000..f0f0f2a --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.projitems @@ -0,0 +1,63 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 6279c845-92f8-4333-ab99-3d213163593c + + + Benchmarks + + + + Designer + MSBuild:Compile + + + + + App.xaml + + + MainPage.xaml + + + + + Designer + MSBuild:Compile + + + + + + + + + + + + <_Globbled_Page Include="$(MSBuildThisFileDirectory)**/*.xaml" Exclude="@(Page);@(ApplicationDefinition)"> + Designer + MSBuild:Compile + + + + <_Globbed_Compile Include="$(MSBuildThisFileDirectory)**/*.xaml.cs" Exclude="@(Compile)"> + %(Filename) + + <_Globbed_Compile Include="$(MSBuildThisFileDirectory)**/*.cs" Exclude="@(Compile);@(_Globbed_Compile)" /> + + + <_Globbed_PRIResource Include="$(MSBuildThisFileDirectory)**/*.resw" Exclude="@(PRIResource)" /> + + + <_Globbed_Content Include="$(MSBuildThisFileDirectory)Assets/**/*.*" Exclude="@(Content)" /> + + + + diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.shproj b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.shproj new file mode 100644 index 0000000..fbfc375 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Benchmarks.Shared.shproj @@ -0,0 +1,13 @@ + + + + 6279c845-92f8-4333-ab99-3d213163593c + 14.0 + + + + + + + + diff --git a/src/dopesbench/dopesbench/Benchmarks.Shared/Controls/AsyncUIBenchmarkControl.xaml b/src/dopesbench/dopesbench/Benchmarks.Shared/Controls/AsyncUIBenchmarkControl.xaml new file mode 100644 index 0000000..c4a1c04 --- /dev/null +++ b/src/dopesbench/dopesbench/Benchmarks.Shared/Controls/AsyncUIBenchmarkControl.xaml @@ -0,0 +1,34 @@ + + + + + + + + +