🏗️ Multi-platform support
add multi platform support (wip)
Summary by Sourcery
Add multi-platform support by introducing platform-specific configurations and assets, refactor JSON serialization to use System.Text.Json, and enhance the build and CI processes with new scripts and workflows. Implement a new CoreX module for handling Minecraft mods and profiles, and update issue templates for better bug reporting and feature requests.
New Features:
- Introduce multi-platform support by adding new platform-specific configurations and assets for MacCatalyst and other platforms.
- Add a new
CoreXmodule to support different Minecraft installation profiles and mods. - Implement a new
ModrinthStoreclass for handling mod, plugin, resource pack, shader, and modpack downloads from the Modrinth API.
Enhancements:
- Refactor JSON serialization from
Newtonsoft.JsontoSystem.Text.Jsonacross multiple files for improved performance and consistency. - Update issue templates for bug reports and feature requests to include more detailed fields and platform-specific options.
- Add a new
FileDownloaderclass to handle file downloads with integrity checks using SHA-1 and SHA-512 hashes.
Build:
- Add a PowerShell script to automate the installation of the Windows SDK ISO for build environments.
- Introduce a
global.jsonfile to manage SDK versions and dependencies.
CI:
- Create a new GitHub Actions workflow for continuous integration, including steps for dependency installation and project build.
- Add a custom action to install platform-specific dependencies using Uno.Check.
Documentation:
- Add a
ReadMe.mdfile in theEmeralddirectory to guide users on getting started with the Uno Platform.
This is one of the reasons that UWP is better 😭 I remember multi-platform support was so easy...
This is one of the reasons that UWP is better 😭 I remember multi-platform support was so easy...
yeah I agree to @0x5bfa this was UWP at the first (SD Launcher) but it was so difficult to even a run a single Minecraft version because accessing resources is limited. This originally created the option 'Run Minecraft As Admin' because it would solve it at some kind of security risk
btw I planned to rewrite the Emerald.Core to Emerald.CoreX with a well (i'll try my best) organized code pattern so it would be easy to maintain.
I was away from the dev for kind of a time so I don't even understand somethings I have written before lol.
And I'll mostly focused on bringing Emerald for MacOS but emerald for Linux will be also created since I hope to use single framework for all.
Emerald for Windows works with no problem at all so I think it'll be a mess to replace Core with CoreX in Emerald.WinUI
BTW what do you guys think should I use for emerald cross platform? would it be
- MAUI
- MAUI Hybrid (Blazor based MAUI app)
- Blazor with Something like PWA or electron to create a desktop like (idk even this is possible at all lol)
- Uno Platform
- Or something else (Because I think all of these are not just perfect as native WinUI and apple UI (idk whatever they call it)
@RiversideValley/emerald what do you think?
@RiversideValley/emerald what do you think?
Okay..... So first things first. In terms of cross-platform, Uno seems like the best way to go as it is the most mature multi platform runtime engine. Blazor/Electron/ASP.NET apps are literally terrible and I wouldn't recommend them in a billion years as they are slow and buggy and the codebase is just messy - desktop apps shouldn't programmed in the same way as websites in my opinion. Plus, ASP.Net Core/Blazor/Electron apps are limited to most OS permission scopes as a website and may be able to open it but wouldn't function as a launcher in the same way that the Minecraft Launcher/Natsurainko.FluentLauncher/Lunar/Badlion/(whatever launchers are being used nowawadays) in terms of being actually able to manage the game on demand - you might as well be developing Emerald as a website that just launches Minecraft via protocols which betrays the true meaning behind what a Minecraft Launcher really is. Emerald for macOS, on the other hand, will be difficult. I'm not sure whether .NET desktop apps designed and managed by Uno are even supported on macOS. Then again, this leads me to question, why do we want Emerald to work as a cross-platform app? It's fine to make it universally available across different Windows versions (AMD64, Arm, Arm64, WinRT, etc.) but why do we really want it to function on different platforms? Minecraft on macOS is the only comparable version of the game to that of Windows and I am to suppose that we will have very little userbase who are interested in a Cupertino UI (what Apple's design system is called) Minecraft Launcher that lacks the features or core contributors of other major competitors or even the default Launcher itself? On top of that, Minecraft for Linux is incredibly underdeveloped and resembles Classic Minecraft in its entirety - not a proper game as Minecraft on Windows and macOS appears to be. Another thing - codebase unifier platforms like Uno and MAUI generally lean towards having a single codebase as that is literally the meaning of the word Uno - it makes no sense to have a separate project for each version as all the apps being able to be built from a singular codebase is the very nature of Uno and MAUI in the first place. All in all, this is merely speculative but it really does make me question what Emerald really is.
Okay..... So first things first. In terms of cross-platform, Uno seems like the best way to go as it is the most mature multi platform runtime engine. Blazor/Electron/ASP.NET apps are literally terrible and I wouldn't recommend them in a billion years as they are slow and buggy and the codebase is just messy - desktop apps shouldn't programmed in the same way as websites in my opinion.
Yeah I do also prefer Uno over the others, Just listed down the possible ways of doing this. And also, I have never tried either Uno or Blazor with electron(ized) before. So I may need time to get these thing well.
Plus, ASP.Net Core/Blazor/Electron apps are limited to most OS permission scopes as a website and may be able to open it but wouldn't function as a launcher in the same way that the Minecraft Launcher/Natsurainko.FluentLauncher/Lunar/Badlion/(whatever launchers are being used nowawadays) in terms of being actually able to manage the game on demand - you might as well be developing Emerald as a website that just launches Minecraft via protocols which betrays the true meaning behind what a Minecraft Launcher really is.
Just to mention, ig some of the popular (legal or cracked) minecraft launchers like TLauncher, Lunarclient uses HTML UI with Java (I'm not sure since I haven't observed any Java based app before, but I think it works like that)
I don't like Electron\Blazor UI based apps because of the performance. The only thing I like about it is we can craft whatever unique UI we want with HTML and CSS (although I'm not a web designer lol)
Emerald for macOS, on the other hand, will be difficult. I'm not sure whether .NET desktop apps designed and managed by Uno are even supported on macOS.
There is some built with Uno for macOS, like Devtoys, Ryujinx (An amazing project I found when searching for emulators, not so sure whether it is poweren by Uno)
Then again, this leads me to question, why do we want Emerald to work as a cross-platform app? It's fine to make it universally available across different Windows versions (AMD64, Arm, Arm64, WinRT, etc.) but why do we really want it to function on different platforms?
well Minecraft JAVA Edition is cross-platform, so why not emerald? Actually I like to bring emerald for macOS since I have a mac tbh.
Minecraft on macOS is the only comparable version of the game to that of Windows and I am to suppose that we will have very little userbase who are interested in a Cupertino UI (what Apple's design system is called)
Yeah I agree, but I have experienced that annoying user experience when I try to install 3rd party MC launcher on my new mac. I had to manually install Java runtime, finding the correct runtime could be challenging not to me but to other normal non-dev peoples like my younger brother who only knows to open emerald and launch minecraft. Since CMLLib automatically installs required java rumtime which is very easy for normal users.
Minecraft Launcher that lacks the features or core contributors of other major competitors or even the default Launcher itself? On top of that, Minecraft for Linux is incredibly underdeveloped and resembles Classic Minecraft in its entirety - not a proper game as Minecraft on Windows and macOS appears to be.
I had only a linux based device before (Which actually came with windows but had to install a linux because it was too old for Windows). I played Minecraft on that device using Tlauncher, I was happy with it. (even though the performence was not so great) I think Emerald would easily work if it was cross platform thanks to the well-written CMLLib.
Another thing - codebase unifier platforms like Uno and MAUI generally lean towards having a single codebase as that is literally the meaning of the word Uno - it makes no sense to have a separate project for each version as all the apps being able to be built from a singular codebase is the very nature of Uno and MAUI in the first place. All in all, this is merely speculative but it really does make me question what Emerald really is.
yeah, so do I 😀. Emerald is just a UI for some "custom minecraft launcher" Libraires. made for easy of use, easily download mods using Modrinth API and install and run moded MC version just like TLauncher.
btw what would be the final decision? what about. MAUI? actually I really don't love any of these, I would rather build a native mac app if I knew SwiftUI
wow Ive written a whole essay lol
Ryujinx isn't powered by Uno afaik
I love ryujinx too 💀
well Minecraft JAVA Edition is cross-platform, so why not emerald? Actually I like to bring emerald for macOS since I have a mac tbh.
Yeah me too but don't really use it much since I recently got like a £5000 PC
btw what would be the final decision? what about. MAUI? actually I really don't love any of these, I would rather build a native mac app if I knew SwiftUI
I know a tiny bit of Swift because it was the second language I learnt after getting into programming but I haven't done any programming with it in over 3 years and I'm probably going to be terrible at it. Also, using an app like Xcode is very unintuitive. Objective-C is also just terrible and I personally think refactoring Emerald via MAUI or Uno is preferable
Also, I just remembered, MAUI doesn't support Linux so it wouldn't work that way anyway
Also, I just remembered, MAUI doesn't support Linux so it wouldn't work that way anyway
so, a one solution is gone lol
Ryujinx isn't powered by Uno afaik
But this feels like WinUI in Uno
https://github.com/user-attachments/assets/b287a5c6-7094-41a8-9bed-543ff97afeda
(don't mind about that time btw)
Yeah it's a shame since MAUI is very much supported by Microsoft and it would be very nice to get to use it while its new because I imagine that in the near future Microsoft will standardise it as the core universal multi-platform framework for .NET
But this feels like WinUI in Uno
Yes it looks like it because they recently replaced the UI with a custom built fluentUI framework for .NET called Avalonia It's actually just a .NET desktop app.
Yes it looks like it because they recently replaced the UI with a custom built fluentUI framework for .NET called Avalonia
ahh I know that, how about using it?
Cross platform WPF
💀 never knew that
ahh I know that, how about using it?
In Emerald? That would require rewriting the app from scratch.
If you think about it Uno has loads of potential. For example, if you ported an app like FluentHub to Uno you would be able to have a FluentHub mobile, and even a web interface. It's very cool to think about.
In Emerald? That would require rewriting the app from scratch.
It seems like that. if so, that would be challenging. I can be never done because we don't have that much time. So It should be Emerald.Uno
What do you mean "we don't have much time"?
What do you mean "we don't have much time"?
I mean I would try to do that if I had more time to spend on this
Yes. It seems like Uno is the way to go for now though.
I give up 😭😭😭 This is practically impossible...
guys I've recreated the store! now it has mods, shaders, plugins, modpacks and resourcepacks support
now it's kind of well organized lol
I read online that apparently if you do this command: @sourcery-ai review
It's meant to do some kind of AI-based PR review?
Reviewer's Guide by Sourcery
This pull request adds multi-platform support to the Emerald application by migrating from WinUI-specific implementation to Uno Platform. The changes include refactoring JSON serialization to use System.Text.Json, introducing new platform-specific configurations and assets, and implementing a new CoreX module for handling Minecraft mods and profiles.
No diagrams generated as the changes look simple and do not need a visual representation.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Migrate from Newtonsoft.Json to System.Text.Json for improved performance |
|
Emerald.App/Emerald.App/Helpers/Settings/JSON.csEmerald.App/Emerald.App/Helpers/Settings/SettingsSystem.csEmerald.Core/Store/Labrinth.csEmerald.Core/News/NewsHelper.cs |
| Add new CoreX module for Minecraft mod management |
|
Emerald.CoreX/Store/Modrinth/ModrinthStore.csEmerald.CoreX/Store/Modrinth/Stores.csEmerald.CoreX/Helpers/FileDownloader.csEmerald.CoreX/Installers/Fabric.csEmerald.CoreX/Installers/Forge.cs |
| Implement multi-platform UI support using Uno Platform |
|
Emerald/Platforms/MacCatalyst/Info.plistEmerald/Platforms/Desktop/Program.csEmerald/Helpers/WindowManager.csEmerald/App.xaml.cs |
| Update build and CI infrastructure |
|
.github/workflows/ci.yml.github/Install-WindowsSdkISO.ps1global.json.github/dependabot.yml |
| Enhance issue templates and documentation |
|
.github/ISSUE_TEMPLATE/bug_report.yml.github/ISSUE_TEMPLATE/feature_request.ymlREADME.md |
Possibly linked issues
- #45: The PR refactors JSON serialization from Newtonsoft.Json to System.Text.Json, addressing the issue directly.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it.
- Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted.
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Maybe you guys can use Directory.Build.props to remove duplicated properties among projects?
We should do this 👀
We already did Directory.Packages.props in #42
@NoobNotFound let's merge, what do you think? I'll need to review this first but it'll be easier to just commit to main rather than an insanely large PR.