Freedom-of-Form-Foundation / anatomy3d

A CAD tool for humanoid anatomy alterations. See the anatomy3d-blender repository for more recent work.
https://freedomofform.org/1856/3d-anatomy-project-scope-phase-1-focus-on-a-limb-joint/
GNU General Public License v2.0
7 stars 5 forks source link

.csproj shouldn't be at the top level of the repository #23

Closed AdamNorberg closed 3 years ago

AdamNorberg commented 3 years ago

In modern C#, every file adjacent to or under a .csproj file is assumed to be part of that project. The upshot to this is that a "one-project solution" layout like the current one doesn't allow other projects to be easily added. On the branch where I'm trying to get unit tests working, for example, to make the unit test examples not be part of the core binary, I've had to explicitly exclude the "examples" directory: https://github.com/AdamNorberg/anatomy3d/blob/wait_maybe_it_is_easier_than_i_thought/AnatomyProject.csproj

This will only get worse as the project gets more complicated.

Currently, "engine" is library-flavored while "gui" is intended to be a Godot frontend. I think the correct thing to do is:

  1. get rid of AnatomyProject.csproj
  2. Create gui.csproj and engine.csproj
  3. Update AnatomyProject.sln to match

...and I have no idea how badly that will interfere with Godot's configuration, or how to fix it if it breaks it.

The first thing that occurred to me was to just add another AnatomyProject folder and move everything except the .sln file into it, and update the .sln file to check for the extra layer of directory, but I don't think that's the best layout and such a move would be extremely disruptive. Creating "engine" and "gui" projects, and refining from there, is probably the best approach with the current layout.

Microsoft's full, heavy-duty layout is https://gist.github.com/davidfowl/ed7564297c61fe9ab814 . I prefer to put tests much closer to the code they test, rather than splitting the hierarchy at the very top level, but that's a matter of personal opinion.

Lathreas commented 3 years ago

I am all in favor of this idea! I think even though we have some unpushed branches still, this is a good refactor to make regardless, as it ensures keeping the engine and gui strictly separate.

The .csproj files were auto-generated by Godot as we set up the project, and not much thought has been put into them until now. I think now that the project has attained this size it's a good idea to go forth and properly separate the engine and gui also at the .csproj level.

We might even divide up the project into even smaller bits as it grows larger.

AdamNorberg commented 3 years ago

Turns out Godot requires this: https://github.com/godotengine/godot-proposals/issues/1575

That's a problem. We can't add a unit test project, or separate our engine from Godot's engine, without being able to do multiple projects. The right answer is probably to go further and divide this into multiple solutions, but that makes the build more complex. That's not avoidable as long as Godot requires there be a project at the top level.