mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-21 01:39:32 +00:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Cake.Common.IO;
|
|
using Cake.Common.Tools.DotNet;
|
|
using Cake.Common.Tools.DotNet.MSBuild;
|
|
using Cake.Common.Tools.DotNet.Pack;
|
|
using Cake.Core.IO;
|
|
using Cake.Frosting;
|
|
|
|
namespace BuildScripts;
|
|
|
|
[TaskName(nameof(PackageTask))]
|
|
public sealed class PackageTask : FrostingTask<BuildContext>
|
|
{
|
|
public override void Run(BuildContext context)
|
|
{
|
|
context.CleanDirectories(context.ArtifactsDirectory);
|
|
context.CreateDirectory(context.ArtifactsDirectory);
|
|
|
|
DotNetMSBuildSettings msBuildSettings = new DotNetMSBuildSettings();
|
|
msBuildSettings.WithProperty("Version", context.Version);
|
|
|
|
DotNetPackSettings packSettings = new DotNetPackSettings()
|
|
{
|
|
MSBuildSettings = msBuildSettings,
|
|
Configuration = "Release",
|
|
OutputDirectory = context.ArtifactsDirectory,
|
|
};
|
|
|
|
FilePathCollection files = context.GetFiles("./src/cs/MonoGame.Extended*/**/*.csproj");
|
|
foreach(FilePath file in files)
|
|
{
|
|
context.DotNetPack(file.FullPath, packSettings);
|
|
}
|
|
}
|
|
}
|