public static VersionHelper GetVersionHelper(this ICakeContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } return(new VersionHelper(context.Environment, context.Log, context.Arguments, context.AppVeyor(), context.TFBuild(), context.Globber, context.FileSystem, context.ProcessRunner, context.Tools)); }
public static VersionResult GetNextVersionInfo(this ICakeContext context, string branch, string defaultVersion) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var versionInfo = new VersionHelper(context.Environment, context.Log, context.Arguments, context.AppVeyor(), context.TFBuild(), context.Globber, context.FileSystem, context.ProcessRunner, context.Tools) { Branch = branch }; return(versionInfo.GetNextVersion(defaultVersion)); }
public static void ConfigureAppVeyorEnvironment(ICakeContext ctx, TaskConfig cfg) { IAppVeyorProvider appveyor = ctx.AppVeyor(); if (!appveyor.IsRunningOnAppVeyor) { throw new TaskConfigException("Not running in AppVeyor"); } EnvConfig env = cfg.Load <EnvConfig>(); env.IsCi = true; env.Version.BuildNumber = appveyor.Environment.Build.Number.ToString(); env.Version.Build = $"{env.Version.Primary}-build.{env.Version.BuildNumber}"; }