Files
octokit.net/build/Tasks/Build.cs
Clemens Lieb 5e751a6c38 Enable building on linux without project file changes (#1930)
* Introduce 'NoFramework' switch

This enables building via cake on linux without requiring adjustments on
other platforms, fixes #1745

* Revert hardcoding NoFramework in build.sh

* Skip GitVersion query for NoFramework build

This implies that NoFramework is intended for local use only
Accordingly a warning message has been set up in the Lifetime of the Build

* Rename NoFramework switch to CoreOnly

* Skip tool installation and formatting step for CoreOnly builds

* Default CoreOnly to false on windows and true otherwise

* Add CoreOnly switch to build variable output

* Fix 'native' msbuild on windows for both platforms

'native' msbuild invocations do not automatically set CoreOnly according to the platform
they are running on. As such we set CoreOnly to False on Windows, unless CoreOnly has been
specified already.
2019-01-31 15:36:30 +10:00

20 lines
685 B
C#

using Cake.Common.Tools.DotNetCore;
using Cake.Common.Tools.DotNetCore.Build;
using Cake.Core;
using Cake.Frosting;
[Dependency(typeof(Restore))]
public class Build : FrostingTask<Context>
{
public override void Run(Context context)
{
context.DotNetCoreBuild("./Octokit.sln", new DotNetCoreBuildSettings
{
Configuration = context.Configuration,
ArgumentCustomization = args => args
.Append("/p:Version={0}", context.Version.GetSemanticVersion())
.Append("/p:SourceLinkCreate={0}", context.LinkSources.ToString().ToLower())
.Append("/p:CoreOnly={0}", context.CoreOnly),
});
}
}