Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions src/OpenSilver.CLI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
C#/**/OpenSilverApplication.*
F#/**/OpenSilverApplication.*
VB/**/OpenSilverApplication.*
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"mauiPlatforms": {
"longName": "mauiPlatforms",
"shortName": "mp",
"isHidden": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"exclude": [
"OpenSilverApplication.Simulator/**"
]
},
{
"condition": "(mauiPlatformsBasic == '' && windowsTarget == '')",
"exclude": [
"OpenSilverApplication.MauiHybrid/**"
]
}
]
}
Expand All @@ -41,6 +47,10 @@
{
"path": "./OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj",
"condition": "(operatingSystem == 'Windows_NT')"
},
{
"path": "./OpenSilverApplication.MauiHybrid/OpenSilverApplication.MauiHybrid.csproj",
"condition": "(mauiPlatformsBasic != '' || windowsTarget != '')"
}
],
"symbols": {
Expand Down Expand Up @@ -91,6 +101,44 @@
}
]
},
"mauiPlatforms": {
"type": "parameter",
"datatype": "choice",
"description": "Specifies which MAUI platforms to include.",
"allowMultipleValues": true,
"replaces": "$maui-platforms$",
"choices": [
{
"choice": "android",
"description": "Android"
},
{
"choice": "ios",
"description": "iOS"
},
{
"choice": "macos",
"description": "macOS"
},
{
"choice": "windows",
"description": "Windows"
},
{
"choice": "all",
"description": "All supported platforms"
}
]
},

"langShortCode": {
"type": "generated",
"generator": "constant",
"replaces": "$LangShortCode$",
"parameters": {
"value": "cs"
}
},
"openSilverPackageVersion": {
"type": "generated",
"generator": "constant",
Expand Down Expand Up @@ -123,6 +171,14 @@
"value": "3.1.*"
}
},
"openSilverMauiHybridPackageVersion": {
"type": "generated",
"generator": "constant",
"replaces": "$OpenSilverMauiHybridPackageVersion$",
"parameters": {
"value": "3.2.0-preview-2025-01-23-143554-64fb2e70"
}
},
"webAssemblyPackageVersion": {
"type": "generated",
"generator": "switch",
Expand Down Expand Up @@ -186,14 +242,113 @@
},
"operatingSystem": {
"type": "bind",
"binding": "env:OS"
"binding": "env:OS",
"defaultValue": ""
},
"androidTarget": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net8.0')",
"value": "net8.0-android"
},
{
"condition": "((mauiPlatforms == 'android' || mauiPlatforms == 'all') && targetFramework == 'net9.0')",
"value": "net9.0-android"
}
]
}
},
"iosTarget": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net8.0')",
"value": "net8.0-ios"
},
{
"condition": "((mauiPlatforms == 'ios' || mauiPlatforms == 'all') && targetFramework == 'net9.0')",
"value": "net9.0-ios"
}
]
}
},
"macosTarget": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net8.0')",
"value": "net8.0-maccatalyst"
},
{
"condition": "((mauiPlatforms == 'macos' || mauiPlatforms == 'all') && targetFramework == 'net9.0')",
"value": "net9.0-maccatalyst"
}
]
}
},
"windowsTarget": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"replaces": "$WindowsTarget$",
"parameters": {
"evaluator": "C++",
"cases": [
{
"condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net8.0')",
"value": "net8.0-windows10.0.19041.0"
},
{
"condition": "((mauiPlatforms == 'windows' || mauiPlatforms == 'all') && targetFramework == 'net9.0')",
"value": "net9.0-windows10.0.19041.0"
}
]
}
},
"mauiPlatformsBasic": {
"type": "generated",
"generator": "join",
"replaces": "$MauiPlatformsBasic$",
"parameters": {
"symbols": [
{
"type": "ref",
"value": "androidTarget"
},
{
"type": "ref",
"value": "iosTarget"
},
{
"type": "ref",
"value": "macosTarget"
}
],
"removeEmptyValues": true,
"separator": ";"
}
}

},
"guids": [
"79254849-EE14-42B2-82CB-07A7D4FA3205",
"052AA0E1-BF65-4EE4-B6D3-112AE3350154",
"E5006009-F128-4902-AD10-D55E7942946A",
"D59E1426-E892-4863-9C68-E437124A32F5"
"D59E1426-E892-4863-9C68-E437124A32F5",
"E98BBAFF-DE97-48FB-B99E-019727405EFE"
],
"postActions": [
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.Simulator", "OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.csproj", "{E5006009-F128-4902-AD10-D55E7942946A}"
EndProject
#endif
#if (mauiPlatformsBasic != '' || windowsTarget != '')
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSilverApplication.MauiHybrid", "OpenSilverApplication.MauiHybrid\OpenSilverApplication.MauiHybrid.csproj", "{E98BBAFF-DE97-48FB-B99E-019727405EFE}"
EndProject
#endif
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -31,6 +35,13 @@ Global
{E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5006009-F128-4902-AD10-D55E7942946A}.Release|Any CPU.Build.0 = Release|Any CPU
#endif
#if (mauiPlatformsBasic != '' || windowsTarget != '')
{E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E98BBAFF-DE97-48FB-B99E-019727405EFE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E98BBAFF-DE97-48FB-B99E-019727405EFE}.Release|Any CPU.Build.0 = Release|Any CPU
#endif
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\OpenSilverApplication\OpenSilverApplication.csproj" />
<ProjectReference Include="..\OpenSilverApplication\OpenSilverApplication.$LangShortCode$proj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:OpenSilverApplication.MauiHybrid"
x:Class="OpenSilverApplication.MauiHybrid.App">
<Application.Resources>
<ResourceDictionary>

<!--
For information about styling .NET MAUI pages
please refer to the documentation:
https://go.microsoft.com/fwlink/?linkid=2282329
-->

</ResourceDictionary>
</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace OpenSilverApplication.MauiHybrid;

public partial class App : Application
{
public App()
{
InitializeComponent();
}

protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new MainPage()) { Title = "OpenSilverApplication.MauiHybrid" };
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Components;
using OpenSilver.MauiHybrid.Runner;

namespace OpenSilverApplication.MauiHybrid.Components
{
[Route("/")]
public class Index : ComponentBase
{
[Inject]
private IMauiHybridRunner? Runner { get; set; }

protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();

ArgumentNullException.ThrowIfNull(Runner);
await Runner.RunApplicationAsync<OpenSilverApplication.App>();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Router AppAssembly="@typeof(MauiProgram).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" />
</Found>
</Router>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:OpenSilverApplication.MauiHybrid"
x:Class="OpenSilverApplication.MauiHybrid.MainPage">

<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Components.Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>

</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace OpenSilverApplication.MauiHybrid;

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
Loading