mirror of
https://github.com/Ellpeck/GameBundle.git
synced 2024-11-22 16:48:34 +01:00
Compare commits
4 commits
d7282c256b
...
cfae3353e8
Author | SHA1 | Date | |
---|---|---|---|
cfae3353e8 | |||
87646e8051 | |||
6c9b179752 | |||
a6600a1c84 |
7 changed files with 20 additions and 42 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<RollForward>Major</RollForward>
|
<RollForward>Major</RollForward>
|
||||||
|
|
||||||
<Authors>Ellpeck</Authors>
|
<Authors>Ellpeck</Authors>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<PackageIcon>Logo.png</PackageIcon>
|
<PackageIcon>Logo.png</PackageIcon>
|
||||||
<PackAsTool>true</PackAsTool>
|
<PackAsTool>true</PackAsTool>
|
||||||
<ToolCommandName>gamebundle</ToolCommandName>
|
<ToolCommandName>gamebundle</ToolCommandName>
|
||||||
<VersionPrefix>1.5.4</VersionPrefix>
|
<VersionPrefix>1.6.0</VersionPrefix>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -52,6 +52,8 @@ public class Options {
|
||||||
public bool SkipLib { get; set; }
|
public bool SkipLib { get; set; }
|
||||||
[Option('e', "exclude", HelpText = "Files that should not be moved to the library folder")]
|
[Option('e', "exclude", HelpText = "Files that should not be moved to the library folder")]
|
||||||
public IEnumerable<string> ExcludedFiles { get; set; }
|
public IEnumerable<string> ExcludedFiles { get; set; }
|
||||||
|
[Option("mg", HelpText = "Exclude MonoGame's native libraries from being moved to the library folder, which is a requirement for DesktopGL version 3.8.2.1105 or later. This has the same behavior as supplying the --exclude arguments soft_oal.dll, SDL2.dll, libopenal.so.1, libSDL2-2.0.so.0, libopenal.1.dylib and libSDL2.dylib")]
|
||||||
|
public bool MonoGameExclusions { get; set; }
|
||||||
[Option("lib-name", Default = "Lib", HelpText = "The name of the library folder that is created")]
|
[Option("lib-name", Default = "Lib", HelpText = "The name of the library folder that is created")]
|
||||||
public string LibFolder { get; set; }
|
public string LibFolder { get; set; }
|
||||||
|
|
||||||
|
@ -68,4 +70,4 @@ public class Options {
|
||||||
[Option('V', "include-version", HelpText = "Include the project's version in the names of the output directories")]
|
[Option('V', "include-version", HelpText = "Include the project's version in the names of the output directories")]
|
||||||
public bool IncludeVersion { get; set; }
|
public bool IncludeVersion { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.IO.Enumeration;
|
using System.IO.Enumeration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using CommandLine;
|
using CommandLine;
|
||||||
|
|
||||||
namespace GameBundle;
|
namespace GameBundle;
|
||||||
|
@ -68,9 +67,12 @@ internal static class Program {
|
||||||
|
|
||||||
// Run beauty
|
// Run beauty
|
||||||
if (!options.SkipLib && !config.SkipLib) {
|
if (!options.SkipLib && !config.SkipLib) {
|
||||||
var excludes = $"\"{string.Join(";", options.ExcludedFiles)}\"";
|
var exclude = options.ExcludedFiles.ToList();
|
||||||
|
if (options.MonoGameExclusions)
|
||||||
|
exclude.AddRange(["soft_oal.dll", "SDL2.dll", "libopenal.so.1", "libSDL2-2.0.so.0", "libopenal.1.dylib", "libSDL2.dylib"]);
|
||||||
|
var excludeString = exclude.Count > 0 ? $"\"{string.Join(";", exclude)}\"" : "";
|
||||||
var log = options.Verbose ? "Detail" : "Error";
|
var log = options.Verbose ? "Detail" : "Error";
|
||||||
var beautyResult = Program.RunProcess(options, "dotnet", $"ncbeauty --loglevel={log} --force=True --noflag=True \"{buildDir.FullName}\" \"{options.LibFolder}\" {excludes}", AppDomain.CurrentDomain.BaseDirectory);
|
var beautyResult = Program.RunProcess(options, "dotnet", $"ncbeauty --loglevel={log} --force=True --noflag=True \"{buildDir.FullName}\" \"{options.LibFolder}\" {excludeString}", AppDomain.CurrentDomain.BaseDirectory);
|
||||||
if (beautyResult != 0)
|
if (beautyResult != 0)
|
||||||
return beautyResult;
|
return beautyResult;
|
||||||
}
|
}
|
||||||
|
@ -237,4 +239,4 @@ internal static class Program {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
|
@ -1,30 +0,0 @@
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
stages {
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
sh 'dotnet build **/GameBundle.csproj'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Pack') {
|
|
||||||
steps {
|
|
||||||
sh 'find . -type f -name "*.nupkg" -delete'
|
|
||||||
sh 'dotnet pack **/GameBundle.csproj --version-suffix ${BUILD_NUMBER}'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'dotnet nuget push -s http://localhost:5000/v3/index.json **/*.nupkg -k $BAGET -n'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676')
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,6 +17,9 @@ gamebundle -wlm
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
## Building a MonoGame Project
|
||||||
|
If you're building a MonoGame project using MonoGame's DesktopGL version 3.8.2.1105 or later, you can additionally supply the `--mg` argument to automatically exclude MonoGame's native libraries from being moved into the `Lib` subdirectory, which is a requirement for your game to run.
|
||||||
|
|
||||||
# Configuring
|
# Configuring
|
||||||
GameBundle takes several optional arguments to modify the way it works. To see a list of all possible arguments, simply run
|
GameBundle takes several optional arguments to modify the way it works. To see a list of all possible arguments, simply run
|
||||||
```
|
```
|
||||||
|
@ -27,4 +30,4 @@ gamebundle --help
|
||||||
In the future, GameBundle plans to include the following features:
|
In the future, GameBundle plans to include the following features:
|
||||||
- ~~An option to create a `.app` folder for Mac~~ Implemented in `1.1.1`
|
- ~~An option to create a `.app` folder for Mac~~ Implemented in `1.1.1`
|
||||||
- An option to create an installer for Windows
|
- An option to create an installer for Windows
|
||||||
- An option to create a flatpak (or similar) installer for Linux
|
- An option to create a flatpak (or similar) installer for Linux
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
dotnet build ../GameBundle/GameBundle.csproj
|
||||||
rmdir /S /Q "bin/Bundled"
|
rmdir /S /Q "bin/Bundled"
|
||||||
"../GameBundle/bin/Debug/net6.0/GameBundle.exe" -wlmWL -bznV -s Test.csproj -o bin/Bundled -v --mac-bundle-ignore macmain.txt -N beta
|
"../GameBundle/bin/Debug/net8.0/GameBundle.exe" -wlmWL -bnV --mg -s Test.csproj -o bin/Bundled -v --mac-bundle-ignore macmain.txt -N beta
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<PublishReadyToRun>false</PublishReadyToRun>
|
<PublishReadyToRun>false</PublishReadyToRun>
|
||||||
<TieredCompilation>false</TieredCompilation>
|
<TieredCompilation>false</TieredCompilation>
|
||||||
<AssemblyName>Test Project</AssemblyName>
|
<AssemblyName>Test Project</AssemblyName>
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
<PackageReference Include="Contentless" Version="2.0.*" />
|
<PackageReference Include="Contentless" Version="2.0.*" />
|
||||||
<PackageReference Include="MLEM.Startup" Version="3.2.*" />
|
<PackageReference Include="MLEM.Startup" Version="3.2.*" />
|
||||||
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.*" />
|
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.*" />
|
||||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
|
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.2.1105" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -21,4 +21,4 @@
|
||||||
<Content Include="Content\*\**" />
|
<Content Include="Content\*\**" />
|
||||||
<Content Include="macmain.txt" CopyToOutputDirectory="Always" />
|
<Content Include="macmain.txt" CopyToOutputDirectory="Always" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in a new issue