Compare commits

..

No commits in common. "cfae3353e8c5e62aca2b7e618df5af7691b5d8b7" and "d7282c256b5acd78ff3e778f50f0f1977e0c2aa9" have entirely different histories.

7 changed files with 42 additions and 20 deletions

View file

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

View file

@ -52,8 +52,6 @@ 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,6 +5,7 @@ using System.IO;
using System.IO.Compression;
using System.IO.Enumeration;
using System.Linq;
using System.Text.RegularExpressions;
using CommandLine;
namespace GameBundle;
@ -67,12 +68,9 @@ internal static class Program {
// Run beauty
if (!options.SkipLib && !config.SkipLib) {
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 excludes = $"\"{string.Join(";", options.ExcludedFiles)}\"";
var log = options.Verbose ? "Detail" : "Error";
var beautyResult = Program.RunProcess(options, "dotnet", $"ncbeauty --loglevel={log} --force=True --noflag=True \"{buildDir.FullName}\" \"{options.LibFolder}\" {excludeString}", AppDomain.CurrentDomain.BaseDirectory);
var beautyResult = Program.RunProcess(options, "dotnet", $"ncbeauty --loglevel={log} --force=True --noflag=True \"{buildDir.FullName}\" \"{options.LibFolder}\" {excludes}", AppDomain.CurrentDomain.BaseDirectory);
if (beautyResult != 0)
return beautyResult;
}

30
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,30 @@
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,9 +17,6 @@ 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,3 +1,2 @@
dotnet build ../GameBundle/GameBundle.csproj
rmdir /S /Q "bin/Bundled"
"../GameBundle/bin/Debug/net8.0/GameBundle.exe" -wlmWL -bnV --mg -s Test.csproj -o bin/Bundled -v --mac-bundle-ignore macmain.txt -N beta
"../GameBundle/bin/Debug/net6.0/GameBundle.exe" -wlmWL -bznV -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>net8.0</TargetFramework>
<TargetFramework>net6.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.2.1105" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
</ItemGroup>
<ItemGroup>