dotnet / Microsoft.Maui.Graphics

An experimental cross-platform native graphics library.
MIT License
682 stars 62 forks source link

remove native* out of Microsoft.Maui.Graphics.csproj and provide native projects for each platform #70

Closed lytico closed 3 years ago

lytico commented 3 years ago

currently, all the native implementations are mangled into one project

it is impossible to compile on environments there not all workloads are available

i tried to split in a first (common) native project here:

https://github.com/lytico/Microsoft.Maui.Graphics/tree/lytico/natives_splitted

in a further step, Microsoft.Maui.Graphics.Native could be splitted

Purpose

make it easier to implement more platforms

eg. Microsoft.Maui.Graphics.Native.Gtk

without harming / having all dependencies to resolve

jonlipsky commented 3 years ago

@lytico I need to setup a Linux vm to reproduce your environment; however, can't you use an MSBuild command line switch to build for only one target framework and ignore the others?

Part of the reason for putting everything in one project like this is that it will reduce the number of resulting assemblies, and allows us to avoid using shared projects where there is shared code between two platforms (Mac and iOS).

lytico commented 3 years ago

@jonlipsky thanks for clearance!

i use an ide (rider), so it decides from proj-files how the build is done.

i'm currently working on linux-gtk-implementation of https://github.com/jsuarezruiz/maui-linux/tree/init-linux

there i've the same problem, but with magnitudes higher amount of projects. i did some changes in the build-files there, so at least i can work with the ide on linux without splitting into subprojects. the whole stuf is WIP, so maybe i have a solution fitting for Maui.Graphics too.

but, my concerns stay in the long run. i'm gathering pros & cons here: https://github.com/lytico/maui/issues/2 i noticed your arguments under pros, as i didn't know until now why this decision was made.

lytico commented 3 years ago

shared code between two platforms (Mac and iOS).

consider that there are move platforms to come (linux-gtk, tizen, windows at least)

what painful proj-files are resulting, you can see in https://github.com/jsuarezruiz/maui-linux/blob/init-linux/src/Essentials/src/Essentials.csproj and files named like https://github.com/jsuarezruiz/maui-linux/blob/init-linux/src/Essentials/src/Clipboard/Clipboard.netstandard.tvos.watchos.tizen.cs

that would be in future

Clipboard.netstandard.tvos.watchos.tizen.windows.linux.cs

and with every platform growing ...

but i know, Maui.Graphics solution is much cleaner with separation in directorys.