Skip to content
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

Devops Part 1 #25

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Devops Part 1 #25

wants to merge 9 commits into from

Conversation

harveyt
Copy link
Collaborator

@harveyt harveyt commented Feb 18, 2024

Just tidying up. I think this makes sense given what you recently changed?

  • Update README with build instructions now its just Visual Studio
  • Visual Studio calls out to tools/postbuild.bat
  • postbuild.bat copies just the dll to GameData/Reviva
  • postbuild.bat also deletes and recopies all of GameData/Reviva to the ReferencePath
  • Remove Makefile junk
  • Add csproj user example
  • Add editorconfig and change horrible tabs to spaces

@harveyt harveyt requested a review from JonnyOThan February 18, 2024 01:20
@harveyt
Copy link
Collaborator Author

harveyt commented Feb 18, 2024

Oh, I was not quite sure what to do with Reviva.pdb - I think it shouldn't get copied into the repo GameData/Reviva because that's usually how I zip things up (or intend to).

Also it seemed useful to update the game's copy of Reviva so you can do Build and rerun of KSP.

The real CI/CD wouldn't / couldn't do this - so... meh... a problem for another day.

@JonnyOThan
Copy link
Collaborator

It's critical to have the pdb in GameData for debugging. I usually manually remove them when packaging up a release, but perhaps the "make release" step can just do that.

Why do you prefer spaces over tabs? I feel the exact opposite.

I'm also not really sure about deploying the GameData folder to the game directory. The way I usually work, I make a junction from the KSP GameData to the mod repo's GameData folder. This way I can have several instances of KSP pointing to the same development repo. I recently started working with KSPCF and it deploys to GameData, and I've found that I can just point other instances of KSP at the mod folder in the KSP reference install. That's good enough. But also I'd be wary of spending extra time copying stuff on each build, and the risk of possibly having stuff get out of sync if things fail to copy or something.

@harveyt
Copy link
Collaborator Author

harveyt commented Feb 18, 2024

Huh, I prefer tabs over spaces too, but I thought that was unusual, most places I work at or mods are "tabs bad".

Do you have tabs as 8 spaces, or 4? I use Emacs so it doesn't make a difference, but I thought having an editorconfig would at least mean anyone contributing would match.

Yeah, I wasn't a big fan of the "installing to game", especially if this is used on a build machine, since that wouldn't make sense.

I'll add the pdb, and the release automation will make sure it's not there, when I get round to that.

@JonnyOThan
Copy link
Collaborator

I use a tab width of 4, but I’m also not sure that this needs to be specified because one of the main advantages of tabs is that people can set their own widths.

I think I’m fine with the deployment step, because even though it’s not my typical workflow it’s certainly one less step for any new contributor to have to worry about. It’s also easy enough for me to work around. The junction approach is also sometimes annoying when dealing with ckan, if you accidentally update or uninstall the mod while the junction is in place.

@JonnyOThan
Copy link
Collaborator

JonnyOThan commented Feb 20, 2024

This seems to work: https://github.com/KSPModStewards/Singularity/blob/977ad678924d952ab82cf0606e29ae0ef46880c6/Singularity/Singularity/Singularity.csproj#L74

However I thought of one thing that the copy method might not do so well - If there are settings files etc. that live in GameData they will be deleted by the /MIR switch. That's good for mimicking a fresh install, but not great if you actually need to keep those. I'm not sure what a good solution would look like.

It would also, of course, be possible to automate creating the junction...maybe that's the right move?

I'm also not sure how these would interact with github actions. I think maybe we pass the current build configuration into the postbuild script and have it do different things?

Another thing I'm interested in figuring out is how to have one source of truth for the version information. Maybe that's a text file that generates the .version and AssemblyInfo.cs files; maybe the .version file should be the source of truth and other things parse it?

@JonnyOThan
Copy link
Collaborator

maybe this stuff is maybe even a better path? more cross-platform? https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-extend-the-visual-studio-build-process?view=vs-2022

@JonnyOThan
Copy link
Collaborator

I've been working on some stuff here that we should probably integrate: https://github.com/kspmoddingLibs/kspbuildTools/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants