mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Nuke.Common;
|
||
using Nuke.Common.Tooling;
|
||
using Nuke.Common.Tools.MSBuild;
|
||
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
|
||
|
||
namespace MaaBuilder;
|
||
|
||
public partial class Build
|
||
{
|
||
Target WithCompileCoreRelease => _ => _
|
||
.DependsOn(UseClean)
|
||
.After(SetVersion)
|
||
.Executes(() =>
|
||
{
|
||
var versionEnv = $"/DMAA_VERSION=\\\"{Version}\\\"";
|
||
Information($"MaaCore 编译环境变量:ExternalCompilerOptions = {versionEnv}");
|
||
MSBuild(c => c
|
||
.SetProcessToolPath(Parameters.MsBuildPath)
|
||
.SetProjectFile(Parameters.MaaCoreProject)
|
||
.SetTargets("ReBuild")
|
||
.SetConfiguration(BuildConfiguration.Release)
|
||
.SetTargetPlatform(MSBuildTargetPlatform.x64)
|
||
.SetProcessEnvironmentVariable("ExternalCompilerOptions", versionEnv)
|
||
);
|
||
});
|
||
|
||
// TODO 在 MaaElectronUI 发布后移除
|
||
Target WithCompileWpfRelease => _ => _
|
||
.DependsOn(UseClean)
|
||
.After(SetVersion)
|
||
.Executes(() =>
|
||
{
|
||
MSBuild(c => c
|
||
.SetProcessToolPath(Parameters.MsBuildPath)
|
||
.SetProjectFile(Parameters.MaaWpfProject)
|
||
.SetTargets("ReBuild")
|
||
.SetConfiguration(BuildConfiguration.Release)
|
||
.SetTargetPlatform(MSBuildTargetPlatform.x64)
|
||
.EnableRestore()
|
||
);
|
||
});
|
||
}
|