Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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}";
        }