From d950cc3c66677c8344757415e823e815311536b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Thu, 31 Aug 2023 02:29:59 +0200 Subject: [PATCH 1/3] Fix mods with "-" in ID breaking Roslyn SpaceWarpPaths compilation --- Directory.Build.props | 2 +- SpaceWarpPatcher/Patcher.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 332767cf..abe159c5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.4.2 + 1.4.3 netstandard2.0 11 true diff --git a/SpaceWarpPatcher/Patcher.cs b/SpaceWarpPatcher/Patcher.cs index a397cdc8..a8b58f5e 100644 --- a/SpaceWarpPatcher/Patcher.cs +++ b/SpaceWarpPatcher/Patcher.cs @@ -96,7 +96,9 @@ private static (string name, string path) GetNameAndPath(FileInfo jsonFile) var path = '"' + jsonFile.Directory.FullName.Replace("\"","\\\"").Replace("\\","\\\\") + '"'; var obj = JObject.Parse(File.ReadAllText(jsonFile.FullName)); var id = obj["mod_id"].Value(); - var replaced = id.Replace(".", "_").Replace(" ", "_"); + var replaced = id.Replace(".", "_") + .Replace(" ", "_") + .Replace("-", "_"); return (replaced, path); } @@ -134,7 +136,7 @@ private static void GenerateSpaceWarpPathsDLL(bool changed, ManualLogSource true var allSwinfos = new DirectoryInfo(Path.Combine(Paths.BepInExRootPath, "plugins")) .EnumerateFiles("swinfo.json", SearchOption.AllDirectories).Where(x => IsDisabled(x, allDisabled)) - .Select(x => GetNameAndPath(x)); + .Select(GetNameAndPath); // Now we build the dll var dll = "public static class SpaceWarpPaths {\n"; foreach (var swinfo in allSwinfos) From 7460496c9a23d675db4971a0afb53a5bfd1889e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bure=C5=A1?= Date: Thu, 31 Aug 2023 02:32:02 +0200 Subject: [PATCH 2/3] Update swinfo.json version --- SpaceWarpBuildTemplate/swinfo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpaceWarpBuildTemplate/swinfo.json b/SpaceWarpBuildTemplate/swinfo.json index d0613137..010136db 100644 --- a/SpaceWarpBuildTemplate/swinfo.json +++ b/SpaceWarpBuildTemplate/swinfo.json @@ -6,7 +6,7 @@ "description": "Space-Warp is an API for KSP2 mod developers.", "source": "https://github.com/SpaceWarpDev/SpaceWarp", "version_check": "https://raw.githubusercontent.com/SpaceWarpDev/SpaceWarp/main/SpaceWarpBuildTemplate/swinfo.json", - "version": "1.4.2", + "version": "1.4.3", "dependencies": [ { "id": "UitkForKsp2", From 102ce9da78dd2ecdfe06326d227be5167993d094 Mon Sep 17 00:00:00 2001 From: cheese3660 Date: Wed, 30 Aug 2023 20:36:01 -0400 Subject: [PATCH 3/3] Update swinfo.json --- SpaceWarpBuildTemplate/swinfo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpaceWarpBuildTemplate/swinfo.json b/SpaceWarpBuildTemplate/swinfo.json index 010136db..f5153c21 100644 --- a/SpaceWarpBuildTemplate/swinfo.json +++ b/SpaceWarpBuildTemplate/swinfo.json @@ -24,7 +24,7 @@ } ], "ksp2_version": { - "min": "0", + "min": "0.1.4.0", "max": "*" } }