Compare commits

..

4 commits

Author SHA1 Message Date
Ell
cfae3353e8 1.6.0 2024-08-31 13:20:27 +02:00
Ell
87646e8051 get rid of old jenkinsfile 2024-08-31 13:19:49 +02:00
Ell
6c9b179752 added monogame mode for excluding native libraries 2024-08-31 13:19:11 +02:00
Ell
a6600a1c84 updated to .net 8 2024-08-31 13:18:09 +02:00
7 changed files with 20 additions and 42 deletions

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RollForward>Major</RollForward>
<Authors>Ellpeck</Authors>
@ -15,7 +15,7 @@
<PackageIcon>Logo.png</PackageIcon>
<PackAsTool>true</PackAsTool>
<ToolCommandName>gamebundle</ToolCommandName>
<VersionPrefix>1.5.4</VersionPrefix>
<VersionPrefix>1.6.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>

View file

@ -52,6 +52,8 @@ public class Options {
public bool SkipLib { get; set; }
[Option('e', "exclude", HelpText = "Files that should not be moved to the library folder")]
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")]
public string LibFolder { get; set; }

View file

@ -5,7 +5,6 @@ using System.IO;
using System.IO.Compression;
using System.IO.Enumeration;
using System.Linq;
using System.Text.RegularExpressions;
using CommandLine;
namespace GameBundle;
@ -68,9 +67,12 @@ internal static class Program {
// Run beauty
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 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)
return beautyResult;
}

30
Jenkinsfile vendored
View file

@ -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')
}
}

View file

@ -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.
## 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
GameBundle takes several optional arguments to modify the way it works. To see a list of all possible arguments, simply run
```

View file

@ -1,2 +1,3 @@
dotnet build ../GameBundle/GameBundle.csproj
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

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishReadyToRun>false</PublishReadyToRun>
<TieredCompilation>false</TieredCompilation>
<AssemblyName>Test Project</AssemblyName>
@ -13,7 +13,7 @@
<PackageReference Include="Contentless" Version="2.0.*" />
<PackageReference Include="MLEM.Startup" Version="3.2.*" />
<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>