From 760ee53b5416d4743d3ee21290246b730853dfcb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 19:01:45 +0100 Subject: [PATCH 1/7] dependency update --- Contentless/Contentless.csproj | 4 ++-- Test/Content/Content.mgcb | 8 +------- Test/Content/Contentless.json | 3 ++- Test/Test.csproj | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Contentless/Contentless.csproj b/Contentless/Contentless.csproj index 22d2444..f62981a 100644 --- a/Contentless/Contentless.csproj +++ b/Contentless/Contentless.csproj @@ -11,10 +11,10 @@ - + All - + All diff --git a/Test/Content/Content.mgcb b/Test/Content/Content.mgcb index 39aade8..33470f6 100644 --- a/Test/Content/Content.mgcb +++ b/Test/Content/Content.mgcb @@ -10,7 +10,7 @@ #-------------------------------- References --------------------------------# -/reference:C:/Users/me/.nuget/packages/monogame.extended.content.pipeline/3.8.0/tools/MonoGame.Extended.Content.Pipeline.dll +/reference:C:/Users/me/.nuget/packages/monogame.extended.content.pipeline/3.9.0-alpha0093/tools/MonoGame.Extended.Content.Pipeline.dll #---------------------------------- Content ---------------------------------# @@ -42,12 +42,6 @@ /processor:TiledMapProcessor /build:Tiled/Map.tmx -#begin Tiled/Tiles.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:TextureFormat=NoChange -/build:Tiled/Tiles.png - #begin Tiled/Tileset.tsx /importer:TiledMapTilesetImporter /processor:TiledMapTilesetProcessor diff --git a/Test/Content/Contentless.json b/Test/Content/Contentless.json index ab32b6c..cc5e038 100644 --- a/Test/Content/Contentless.json +++ b/Test/Content/Contentless.json @@ -2,7 +2,8 @@ "exclude": [ "obj/", "bin/", - "Ex*.png" + "Ex*.png", + "Tiled/*.png" ], "logSkipped": true, "references": ["MonoGame.Extended.Content.Pipeline"], diff --git a/Test/Test.csproj b/Test/Test.csproj index 6e4e78a..eb33c17 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -6,7 +6,7 @@ - + From 18ce5e5863cf7b9cc5ad827d5d347c478746f8a8 Mon Sep 17 00:00:00 2001 From: Max Kopjev Date: Thu, 21 Dec 2023 19:09:18 +0100 Subject: [PATCH 2/7] Fix creating test/nuget.config. (#6) --- Contentless/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Contentless/Program.cs b/Contentless/Program.cs index d8a48e5..d560dd1 100644 --- a/Contentless/Program.cs +++ b/Contentless/Program.cs @@ -49,8 +49,9 @@ public static class Program { var referencesVersions = config.References.ToDictionary(x => x, _ => (string) null, StringComparer.OrdinalIgnoreCase); if (config.References.Length > 0) { if (args.Length > 1) { - Program.ExtractVersions(args[1], referencesVersions); - var settings = Settings.LoadDefaultSettings(Path.GetDirectoryName(args[1])); + var csprojFullPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, args[1])); + Program.ExtractVersions(csprojFullPath, referencesVersions); + var settings = Settings.LoadDefaultSettings(Path.GetDirectoryName(csprojFullPath)); packagesFolder = SettingsUtility.GetGlobalPackagesFolder(settings); } else { Console.Error.WriteLine("The config file contains references, but no project file was specified. Please specify the location of the content file you want to use for gathering references as the second argument."); From 5897609dd20a61e53981abb0803efae72640633d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 19:13:37 +0100 Subject: [PATCH 3/7] 3.1.0 --- Contentless/Contentless.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentless/Contentless.nuspec b/Contentless/Contentless.nuspec index a218f7c..25ef712 100644 --- a/Contentless/Contentless.nuspec +++ b/Contentless/Contentless.nuspec @@ -10,7 +10,7 @@ README.md Logo.png - 3.0.7 + 3.1.0 From 280d92edf3e84798774b5eb30f5c076880b7dd5c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 21:20:47 +0100 Subject: [PATCH 4/7] fixed argument oder being incorrect corrupting project files --- Contentless/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Contentless/Program.cs b/Contentless/Program.cs index d560dd1..6bafc98 100644 --- a/Contentless/Program.cs +++ b/Contentless/Program.cs @@ -20,8 +20,8 @@ public static class Program { } var contentFile = new FileInfo(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, args[0]))); - if (!contentFile.Exists) { - Console.Error.WriteLine($"Unable to find content file {contentFile}"); + if (!contentFile.Exists || contentFile.Extension != ".mgcb") { + Console.Error.WriteLine($"Unable to find valid content file at {contentFile}"); return; } @@ -50,6 +50,10 @@ public static class Program { if (config.References.Length > 0) { if (args.Length > 1) { var csprojFullPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, args[1])); + if (!File.Exists(csprojFullPath) || Path.GetExtension(csprojFullPath) != ".csproj") { + Console.Error.WriteLine($"Unable to find valid project file at {contentFile}"); + return; + } Program.ExtractVersions(csprojFullPath, referencesVersions); var settings = Settings.LoadDefaultSettings(Path.GetDirectoryName(csprojFullPath)); packagesFolder = SettingsUtility.GetGlobalPackagesFolder(settings); From 2b2a507050325f6b0a3e6213960f7fc7eed54333 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 21:23:02 +0100 Subject: [PATCH 5/7] 3.1.1 --- Contentless/Contentless.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentless/Contentless.nuspec b/Contentless/Contentless.nuspec index 25ef712..7a9ea67 100644 --- a/Contentless/Contentless.nuspec +++ b/Contentless/Contentless.nuspec @@ -10,7 +10,7 @@ README.md Logo.png - 3.1.0 + 3.1.1 From 01b43d887d4783a5c67861df56015d3e44259919 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 21:27:52 +0100 Subject: [PATCH 6/7] return an exit code when failing --- Contentless/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Contentless/Program.cs b/Contentless/Program.cs index 6bafc98..c548c18 100644 --- a/Contentless/Program.cs +++ b/Contentless/Program.cs @@ -13,16 +13,16 @@ namespace Contentless; public static class Program { - public static void Main(string[] args) { + public static int Main(string[] args) { if (args.Length < 1) { Console.Error.WriteLine("Please specify the location of the content file you want to use"); - return; + return 1; } var contentFile = new FileInfo(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, args[0]))); if (!contentFile.Exists || contentFile.Extension != ".mgcb") { Console.Error.WriteLine($"Unable to find valid content file at {contentFile}"); - return; + return 1; } Console.WriteLine($"Using content file {contentFile}"); @@ -38,6 +38,7 @@ public static class Program { Console.WriteLine($"Using config from {configFile}"); } catch (Exception e) { Console.Error.WriteLine($"Error loading config from {configFile}: {e}"); + return 1; } } else { Console.WriteLine("Using default config"); @@ -52,7 +53,7 @@ public static class Program { var csprojFullPath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, args[1])); if (!File.Exists(csprojFullPath) || Path.GetExtension(csprojFullPath) != ".csproj") { Console.Error.WriteLine($"Unable to find valid project file at {contentFile}"); - return; + return 1; } Program.ExtractVersions(csprojFullPath, referencesVersions); var settings = Settings.LoadDefaultSettings(Path.GetDirectoryName(csprojFullPath)); @@ -200,6 +201,7 @@ public static class Program { Console.WriteLine("Wrote changes to content file"); } Console.Write("Done"); + return 0; } private static void SafeAssemblyLoad(string refPath) { From bbb4b539cc40ab441b8bcfb6af6f8c75c7d15571 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 21 Dec 2023 21:28:42 +0100 Subject: [PATCH 7/7] 3.1.2 --- Contentless/Contentless.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentless/Contentless.nuspec b/Contentless/Contentless.nuspec index 7a9ea67..ac550a3 100644 --- a/Contentless/Contentless.nuspec +++ b/Contentless/Contentless.nuspec @@ -10,7 +10,7 @@ README.md Logo.png - 3.1.1 + 3.1.2