-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infra: Multi-platform support #36
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you guys can use Directory.Build.props to remove duplicated properties among projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, it looks ok!
This is one of the reasons that UWP is better 😭
I remember multi-platform support was so easy...
WinAppSdk is more desktop app like. I feel you pain as we’ve used it in FluentHub.
Signed-off-by: Lamparter <notlamparter@outlook.com>
Signed-off-by: Lamparter <notlamparter@outlook.com>
Signed-off-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
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 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. BTW what do you guys think should I use for emerald cross platform?
@RiversideValley/emerald what do you think? |
Okay..... |
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.
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)
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)
well Minecraft JAVA Edition is cross-platform, so why not emerald?
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 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)
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 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
Also, I just remembered, MAUI doesn't support Linux so it wouldn't work that way anyway |
so, a one solution is gone lol |
This comment was marked as off-topic.
This comment was marked as off-topic.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, yeah the CoreX
project does establish a difference between winui core library and multi platform library but I don't really see it's point
Co-authored-by: codefactor-io <support@codefactor.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently this does not support continuing from interrupted download or pausing, but it should be implemented soon.
I read online that apparently if you do this command: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Reviewer's Guide by SourceryThis pull request implements multi-platform support for the Emerald project. The changes include updates to issue templates, modifications to existing code for cross-platform compatibility, and the addition of new files and directories to support multiple platforms. The most significant changes involve switching from Newtonsoft.Json to System.Text.Json, updating the project structure to support Uno Platform, and adding new components for different platforms. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @NoobNotFound - I've reviewed your changes and found some issues that need to be addressed.
This review was edited by @Lamparter as it contained some very "wrong" information.
Overall Comments:
- Consider breaking large changes like this into smaller, more focused pull requests in the future. This would make the changes easier to review and less risky to merge.
- The new code, especially in complex methods like those in FileDownloader, could benefit from more detailed comments explaining the logic.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 2 blocking issues
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟡 Documentation: 1 issue found
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
using CmlLib.Core; | ||
namespace Emerald.CoreX.Store.Modrinth; | ||
|
||
public class ModStore : ModrinthStore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider consolidating multiple store classes into a single class with an enum for store types.
The current implementation with multiple store classes (ModStore, PluginStore, etc.) introduces unnecessary complexity and violates the DRY principle. Consider simplifying this structure by using a single store class with an enum to specify the type. This approach would reduce code duplication and improve maintainability while preserving the flexibility to handle different content types.
Here's a suggested refactoring:
public enum StoreType
{
Mod,
Plugin,
ResourcePack,
Shader,
Modpack
}
public class ModrinthStore
{
private readonly StoreType _storeType;
public ModrinthStore(MinecraftPath path, ILogger logger, StoreType storeType) : base(path, logger)
{
_storeType = storeType;
}
public ModrinthStore(ILogger logger, StoreType storeType)
: this(new MinecraftPath(MinecraftPath.GetOSDefaultPath()), logger, storeType)
{
}
// Implement GetItemAsync and GetVersionsAsync as before
public override async Task DownloadItemAsync(ItemFile file, IProgress<double>? progress = null, CancellationToken cancellationToken = default)
{
string projectType = _storeType switch
{
StoreType.Mod => "mods",
StoreType.Plugin => "mods",
StoreType.ResourcePack => "resourcepacks",
StoreType.Shader => "shaderpacks",
StoreType.Modpack => "modpacks",
_ => throw new ArgumentOutOfRangeException(nameof(_storeType))
};
await base.DownloadItemAsync(file, projectType, progress, cancellationToken);
}
}
This approach consolidates the functionality into a single class, eliminating the need for multiple nearly identical classes. It uses an enum to differentiate between store types, which is more maintainable and allows for easy addition of new types in the future. The DownloadItemAsync
method uses a switch expression to determine the correct project type based on the store type.
This refactoring significantly reduces code duplication while maintaining the ability to handle different content types. It's more flexible and easier to maintain in the long run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, is this free? also thanks for pointing out Ill take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the feedback and suggestions provided by Sourcery are indeed free! I'm glad you found the feedback helpful. If you have any questions or need further clarification on how to implement the suggested refactoring, feel free to ask. We're here to help!
66e92d7
to
44018f3
Compare
We should do this 👀 |
6adbaef
to
f151c66
Compare
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:
CoreX
module to support different Minecraft installation profiles and mods.ModrinthStore
class for handling mod, plugin, resource pack, shader, and modpack downloads from the Modrinth API.Enhancements:
Newtonsoft.Json
toSystem.Text.Json
across multiple files for improved performance and consistency.FileDownloader
class to handle file downloads with integrity checks using SHA-1 and SHA-512 hashes.Build:
global.json
file to manage SDK versions and dependencies.CI:
Documentation:
ReadMe.md
file in theEmerald
directory to guide users on getting started with the Uno Platform.