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/Contentless/Contentless.nuspec b/Contentless/Contentless.nuspec index a218f7c..ac550a3 100644 --- a/Contentless/Contentless.nuspec +++ b/Contentless/Contentless.nuspec @@ -10,7 +10,7 @@ README.md Logo.png - 3.0.7 + 3.1.2 diff --git a/Contentless/Program.cs b/Contentless/Program.cs index d560dd1..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) { - Console.Error.WriteLine($"Unable to find content file {contentFile}"); - return; + if (!contentFile.Exists || contentFile.Extension != ".mgcb") { + Console.Error.WriteLine($"Unable to find valid content file at {contentFile}"); + 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"); @@ -50,6 +51,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 1; + } Program.ExtractVersions(csprojFullPath, referencesVersions); var settings = Settings.LoadDefaultSettings(Path.GetDirectoryName(csprojFullPath)); packagesFolder = SettingsUtility.GetGlobalPackagesFolder(settings); @@ -196,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) { 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 @@ - +