Closed AdamNorberg closed 3 years ago
I currently see no reason not to merge this. If any conflicts arise with my current branch, it'd be up to me to fix that I suppose. :P There should be no conflicts, though, so I'll just merge it.
Wait, don't merge this, something weird is going on. It was working fine last weekend, now this doesn't build, it can't find the Godot SDK.
Okay, this fixes it - I added the GodotSharp NuGet project as a requirement for AnatomyProject. I don't know why this apparently worked before without it.
Oh, I think I know what happened! Building inside Godot correctly pulls in the GodotSharp assembly, without actually referencing it in the .csproj file but leaving it around in some "Assemblies" directory somewhere so the build picks it up without ever noticing that nothing properly declared that this assembly should be made available. So building in Godot first hides that the project cannot build as-is.
Anyway, the dependency is fixed.
Merging on Lathreas' go-ahead.
Godot requires its project.godot file to be in the same directory as the .sln and .csproj file it loads as its primary assembly. .sln files would rather be somewhere other than in the same place as a .csproj file (a directory or five up, specifically), but Godot doesn't allow this.
I had to move the .csproj out of the top level so I had room for multiple side-by-side projects without them fighting over who owns files in nested directories. (Unit tests work best in a separate project.) Since that means moving the .sln along with it, the top level .sln file is now in gui and that's going to annoy everyone who had an IDE ready to open it up in its old position but I don't see a practical alternative.
Then I created an engine.csproj, which creates a Microsoft.NET.Sdk assembly rather than a Godot SDK assembly, so xUnit will be happier to work with it. Starting on unit tests will come next, now that the project structure allows it.
I've confirmed that "Build Solution" works in JetBrains Rider, and the entire project can be loaded and run in Godot by loading up project.Godot.
I wish the .sln was at the top level (and the project.godot file with it) with no csproj files adjacent to it (all of them should be under it instead), but I can't have everything I wish for. Once Godot supports a more flexible layout, we should revisit this.