godot-manager icon indicating copy to clipboard operation
godot-manager copied to clipboard

Add Initialize Git CheckBox button to Create Project dialogue

Open Salvakiya opened this issue 4 years ago • 6 comments

This add LibGit2Sharp dependency to the project (which I plan to implement a git submodule frontend for managing addons using Godot-Manager)

There is a caveat. I had to copy the resulting git2-xxxxxxx.dll file from the ".mono\temp\bin\Debug\lib\win32\x64" folder and place it alongside the project for it to run properly. This file is a dependency of LibGit2Sharp. I did not want to commit the dll file itself. I am relatively new to C# and am unsure how to fix that issue. On export Godot and C# should include this dependency somehow.

Salvakiya avatar Mar 28 '22 08:03 Salvakiya

The reason why you need to manually copy of the DLL file is because you do not have a reference to LibGit2Sharp.NativeBinaries in the csproj file. This would ensure that when building the project, the C native library that is needed for the specified platform that the project is being built for, has the correct Shared library. Windows is a DLL, Linux is a SO, and Mac is a DYNLIB. Adding the reference to the NativeBinaries project, will ensure these binaries are properly copied when compiling the project.

eumario avatar Mar 29 '22 06:03 eumario

The reason why you need to manually copy of the DLL file is because you do not have a reference to LibGit2Sharp.NativeBinaries in the csproj file. This would ensure that when building the project, the C native library that is needed for the specified platform that the project is being built for, has the correct Shared library. Windows is a DLL, Linux is a SO, and Mac is a DYNLIB. Adding the reference to the NativeBinaries project, will ensure these binaries are properly copied when compiling the project.

ahh okay. I thought it must have been something simple like that.

Salvakiya avatar Mar 29 '22 09:03 Salvakiya

I could not figure out the LibGit2Sharp and LibGit2Sharp.NativeBinary issue. Even after adding it as a separate line to the csproj file. when testing and on export it still failed to include the appropriate dll file.

I looked up another way to run git commands using C# and am currently doing that for now. Also it copy's over a gitingore if you initialize a git repo on a new project.

ALSO: I added an ErrorWindow which is a child of SceneManager. This is an easy way to display error messages to the user which should help with debugging. Please let me know if you would like this placed somewhere else?

Edit: also ran into some funny merge issues with VSCode... dont mind the two merge commits on my fork =P

Salvakiya avatar Mar 29 '22 13:03 Salvakiya

The second method in which to use Git, will require you to know where Git is, as sometimes it may not be found correctly. The best test for that, would be to look at how I do chmod and xattr for Linux and Mac OS respectively. This will need to be done on Windows as well, which can be done with the where command, EG: "where git" will return the location of where Git is installed.

It's always best to ensure you have the full path to the Executable, when running commands, as it leaves nothing for chance of not being there.

And there should be error handlers for when the command is not found. chmod is installed on all Linux systems, same with xattr is installed on all Mac OS systems, so there's no worry about them not being there. But git is not installed by default, so it would be best to get the full location to Git, and error out if it can't find it, offer an option to the user to define where their git install is, or instruct them on how to install git.

As for the ErrorWindow. I am guessing your wanting a window dialog that just allows for multi-line text in it? If not, there is AppDialog.MessageDialog, AppDialog.YesNo and AppDialog.YesNoCancel which can be used to display a message to the user, as well as ask questions.

EDIT: Also, the structure of the scenes is kinda specific, to organize things into their proper desgination. Scenes are meant to handle the main 3 scenes as of current. The Main Window Scene with the Project Listing, Asset Library, Godot Installations and Settings panels, the Second scene is the Update Scene, which handles updating Godot Manager when there is an update, and the last, is the Scene Manager which handles which scene is displayed to the end user.

Dialogs, and such, should be placed under components folder, with Dialogs and Panels placed inside their respective folders, and controls used within the Application stored just under components. Same with the Scripts folder structure, which you have setup when you placed the ErrorWindow in the Scene's folder, you placed the C# script inside the Scripts/Scenes folder, but with the move, the scene should be placed under components/Dialogs folder, and C# Script placed inside Scripts/Components/Dialogs folder.

It helps to keep track of where things are, and doesn't deviate from the established folder structure.

eumario avatar Mar 30 '22 00:03 eumario

still not near done but I want to make sure I am working on this a little every week. Love the tool!

Salvakiya avatar Apr 06 '22 02:04 Salvakiya

Take your time, it's not something that you absolutely have to do right this moment. As you can see from my own commits, I take my time getting stuff correct. ;-) Or at least try to.

eumario avatar Apr 10 '22 01:04 eumario

Since no progress has been made on this Pull request since April, I am closing the PR, as a Major Re-write will be coming soon, that will re-work a lot of things, and may provide an easier path to working with Git in the future.

eumario avatar Nov 30 '22 04:11 eumario