From cc84aea7a720de7566075322794bfa18d6bac412 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 9 Apr 2020 20:31:43 +0200 Subject: [PATCH] some updates, including readme and logo --- GameBundle/GameBundle.csproj | 1 + GameBundle/Options.cs | 22 ++++++++++++---------- GameBundle/Program.cs | 8 ++++---- Logo.png | Bin 0 -> 7540 bytes README.md | 26 ++++++++++++++++++++++++-- 5 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 Logo.png diff --git a/GameBundle/GameBundle.csproj b/GameBundle/GameBundle.csproj index efe86b2..2054a07 100644 --- a/GameBundle/GameBundle.csproj +++ b/GameBundle/GameBundle.csproj @@ -10,6 +10,7 @@ https://github.com/Ellpeck/GameBundle https://github.com/Ellpeck/GameBundle https://github.com/Ellpeck/GameBundle/blob/master/LICENSE + https://raw.githubusercontent.com/Ellpeck/GameBundle/master/Logo.png true gamebundle 0.0.1 diff --git a/GameBundle/Options.cs b/GameBundle/Options.cs index 8889ed7..33475b4 100644 --- a/GameBundle/Options.cs +++ b/GameBundle/Options.cs @@ -8,22 +8,24 @@ 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", Default = false)] + [Option('v', "verbose")] public bool Verbose { get; set; } - [Option('w', "win", Default = true, HelpText = "Bundle for windows")] - public bool BundleWindows { get; set; } - [Option('l', "linux", Default = true, HelpText = "Bundle for linux")] - public bool BundleLinux { get; set; } - [Option('m', "mac", Default = true, HelpText = "Bundle for mac")] - public bool BundleMac { get; set; } + [Option('w', "no-win", HelpText = "Skip bundling for windows")] + public bool NoWindows { get; set; } + [Option('l', "no-linux", HelpText = "Skip bundling for linux")] + public bool NoLinux { get; set; } + [Option('m', "no-mac", HelpText = "Skip bundling for mac")] + public bool NoMac { get; set; } [Option('e', "exclude", Default = new[] {"openal", "oal", "sdl2", "SDL2"}, HelpText = "Files like unmanaged libraries that should not be moved to the /Lib folder")] public string[] ExcludedFiles { get; set; } - [Option("32bit", Default = false, HelpText = "Publish for 32 bit instead of 64 bit. Note that this is only possible on Windows")] + [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("trim", Default = true, HelpText = "Trim the application when publishing")] - public bool Trim { get; set; } + [Option('t', "no-trim", HelpText = "Skip trimming the application when publishing")] + public bool NoTrim { get; set; } + [Option('c', "config", Default = "Release", HelpText = "The build configuration to use")] + public string BuildConfig { get; set; } } } \ No newline at end of file diff --git a/GameBundle/Program.cs b/GameBundle/Program.cs index 4ce13fb..c3bbd15 100644 --- a/GameBundle/Program.cs +++ b/GameBundle/Program.cs @@ -26,15 +26,15 @@ namespace GameBundle { if (!bundleDir.Exists) bundleDir.Create(); - if (options.BundleWindows) { + if (!options.NoWindows) { Console.WriteLine("Bundling for windows"); Publish(options, proj, $"{bundleDir}/win", options.Publish32Bit ? "win-x86" : "win-x64"); } - if (options.BundleLinux) { + if (!options.NoLinux) { Console.WriteLine("Bundling for linux"); Publish(options, proj, $"{bundleDir}/linux", "linux-x64"); } - if (options.BundleMac) { + if (!options.NoMac) { Console.WriteLine("Bundling for mac"); Publish(options, proj, $"{bundleDir}/mac", "osx-x64"); } @@ -44,7 +44,7 @@ namespace GameBundle { } private static void Publish(Options options, FileInfo proj, string path, string rid) { - RunProcess(options, "dotnet", $"publish {proj.FullName} -o {path} -r {rid} /p:PublishTrimmed={options.Trim}"); + RunProcess(options, "dotnet", $"publish {proj.FullName} -o {path} -r {rid} -c {options.BuildConfig} /p:PublishTrimmed={!options.NoTrim}"); // Run beauty var excludes = string.Empty; diff --git a/Logo.png b/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a2b08cd9feccf178703a218055a90e20fee62109 GIT binary patch literal 7540 zcmbVRbx@R1wEuQlqy!d_6oI8tLTOZBDPchxM7m3tF3F`!iKRn21e8{~q(eXvWC3ZE zknULEtpQs@cR$@P7Jsc3Jj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I2*b+>eIau0Z3i<5 z$80M5+4a|6;-RAeaT&-J+#NQXdPh8pFHt=d8bZ;8U6r??wfcosD@zQ-qu?a)m#9YF z#C=W=B&{E&cRn37KRUKIIR*te8$k$d@{r4z(#p8Ml{P524@KkDLN{OXr+UuEJ`Ff5 z8e_YEL5TOZ3kog=c!^13uc0QVRE&FlG49w;H(vuEtQ{&@VwZ<4@2N)d29N|-x$Kuh z%L&NZn~>jz9W?!DGu17-nl_HAh~cOo#KC>*FeJjJHC&ES!OxP+ovPF5P9?PRMsiY_ zp?>~Lk#D-fFXAXsf_@*Yx5NI2g5%#JB%0Xfnj9WZo#1rx^$xC53Lq5J + +**GameBundle** is a tool to package MonoGame and other .NET Core applications into several distributable formats. + +# Installing +GameBundle is a `dotnet` tool, meaning you can install it very easily like so: +``` +dotnet tool install --global GameBundle +``` +# Using +By default, GameBundle builds the `.csproj` file that it finds in the directory that it is run from. The bundled outputs go into `bin/Bundled` by default. + +To build and bundle your app for Linux, Windows and Mac, all you have to do is run the following command from the directory that contains your project file: +``` +gamebundle +``` + +GameBundle will then build a self-contained release of your application for each system using `dotnet publish` and clean up the output directory using [NetCoreBeauty](https://github.com/nulastudio/NetCoreBeauty) by moving most of the libraries into a `Lib` subdirectory. + +# Configuring +GameBundle takes several optional arguments to modify the way it works. To see a list of all possible arguments, simply run +``` +gamebundle --help +``` \ No newline at end of file