From bab7836c05ccd38009f84c0a8b458fd7fb34e81c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 18 Oct 2021 17:37:38 +0200 Subject: [PATCH] allow using custom rids for builds --- GameBundle/Options.cs | 12 ++++++++---- GameBundle/Program.cs | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/GameBundle/Options.cs b/GameBundle/Options.cs index bc616b8..c784045 100644 --- a/GameBundle/Options.cs +++ b/GameBundle/Options.cs @@ -9,7 +9,7 @@ namespace GameBundle { public string SourceFile { get; set; } [Option('o', "output", Default = "bin/Bundled", HelpText = "The location of the directory that the bundles should be stored in")] public string OutputDirectory { get; set; } - [Option('v', "verbose")] + [Option('v', "verbose", HelpText = "Display verbose output while building")] public bool Verbose { get; set; } [Option('w', "win", HelpText = "Bundle for windows")] @@ -18,6 +18,12 @@ namespace GameBundle { public bool BuildLinux { get; set; } [Option('m', "mac", HelpText = "Bundle for mac")] public bool BuildMac { get; set; } + [Option("win-rid", Default = "win-x64", HelpText = "The RID to use for windows builds")] + public string WindowsRid { get; set; } + [Option("linux-rid", Default = "linux-x64", HelpText = "The RID to use for linux builds")] + public string LinuxRid { get; set; } + [Option("mac-rid", Default = "osx-x64", HelpText = "The RID to use for mac builds")] + public string MacRid { get; set; } [Option('z', "zip", HelpText = "Store the build results in zip files instead of folders")] public bool Zip { get; set; } @@ -25,7 +31,7 @@ namespace GameBundle { public bool MacBundle { get; set; } [Option("mac-bundle-resources", Default = new[] {"Content", "*.icns"}, HelpText = "When creating an app bundle for mac, things that should go into the Resources folder rather than the MacOS folder")] public IEnumerable MacBundleResources { get; set; } - [Option("mac-bundle-ignore", Default = new string[0], HelpText = "When creating an app bundle for mac, things that should be left out of the mac bundle and stay in the output folder")] + [Option("mac-bundle-ignore", HelpText = "When creating an app bundle for mac, things that should be left out of the mac bundle and stay in the output folder")] public IEnumerable MacBundleIgnore { get; set; } [Option("skip-lib", HelpText = "When bundling, skip beautifying the output by moving files to the library folder")] @@ -35,8 +41,6 @@ namespace GameBundle { [Option("lib-name", Default = "Lib", HelpText = "The name of the library folder that is created")] public string LibFolder { get; set; } - [Option("32-bit", HelpText = "Publish for 32 bit instead of 64 bit. Note that this is only possible on Windows")] - public bool Publish32Bit { get; set; } [Option('t', "trim", HelpText = "Trim the application when publishing")] public bool Trim { get; set; } [Option('c', "config", Default = "Release", HelpText = "The build configuration to use")] diff --git a/GameBundle/Program.cs b/GameBundle/Program.cs index bcb0cf6..36ad3e6 100644 --- a/GameBundle/Program.cs +++ b/GameBundle/Program.cs @@ -34,14 +34,14 @@ namespace GameBundle { var builtAnything = false; if (options.BuildWindows) { Console.WriteLine("Bundling for windows"); - var res = Publish(options, proj, GetBuildDir(options, "win"), options.Publish32Bit ? "win-x86" : "win-x64"); + var res = Publish(options, proj, GetBuildDir(options, "win"), options.WindowsRid); if (res != 0) return res; builtAnything = true; } if (options.BuildLinux) { Console.WriteLine("Bundling for linux"); - var res = Publish(options, proj, GetBuildDir(options, "linux"), "linux-x64"); + var res = Publish(options, proj, GetBuildDir(options, "linux"), options.LinuxRid); if (res != 0) return res; builtAnything = true; @@ -49,7 +49,7 @@ namespace GameBundle { if (options.BuildMac) { Console.WriteLine("Bundling for mac"); var dir = GetBuildDir(options, "mac"); - var res = Publish(options, proj, dir, "osx-x64", + var res = Publish(options, proj, dir, options.MacRid, () => options.MacBundle ? CreateMacBundle(options, dir, proj) : 0); if (res != 0) return res;