/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Build/Tasks/PublishGeneralSettings.cs
42 строки
2 KB
Ivan Kozhin
Update changelog, update build props
31 дек 2023, 13:29
31 дек 2023, 13:29
f43028e
Код
Авторство
О чём код?
using Cake.Common.Tools.DotNet.Publish; using Cake.Core.IO.Arguments; namespace QueryCat.Build.Tasks; public class PublishGeneralSettings : DotNetPublishSettings { public PublishGeneralSettings(BuildContext context, bool publishAot = true) { OutputDirectory = context.OutputDirectory; Configuration = DotNetConstants.ConfigurationRelease; PublishTrimmed = publishAot; PublishSingleFile = publishAot ? null : true; NoLogo = true; IncludeAllContentForSelfExtract = publishAot ? null : true; EnableCompressionInSingleFile = publishAot ? null : true; SelfContained = publishAot ? null : true; ArgumentCustomization = pag => { if (publishAot) { pag.Append(new TextArgument("-p:PublishAot=true")); pag.Append(new TextArgument("-p:OptimizationPreference=Size")); pag.Append(new TextArgument("-p:StripSymbols=true")); } // https://docs.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options. pag.Append(new TextArgument("-p:AutoreleasePoolSupport=false")); pag.Append(new TextArgument("-p:DebuggerSupport=false")); pag.Append(new TextArgument("-p:EnableUnsafeBinaryFormatterSerialization=false")); pag.Append(new TextArgument("-p:EnableUnsafeUTF7Encoding=true")); pag.Append(new TextArgument("-p:EventSourceSupport=false")); pag.Append(new TextArgument("-p:HttpActivityPropagationSupport=false")); pag.Append(new TextArgument("-p:InvariantGlobalization=true")); pag.Append(new TextArgument("-p:MetadataUpdaterSupport=false")); pag.Append(new TextArgument("-p:UseNativeHttpHandler=true")); pag.Append(new TextArgument("-p:UseSystemResourceKeys=true")); // For reference: https://andrewlock.net/version-vs-versionsuffix-vs-packageversion-what-do-they-all-mean/. pag.Append(new TextArgument($"-p:InformationalVersion={context.Version}")); return pag; }; } }