public static T TryGet <T>(this IBuildPropertiesSession context, string propName, T defaultValue = default(T)) { var ret = context.TryGet <T>(propName); if (EqualityComparer <T> .Default.Equals(ret, default(T))) { ret = defaultValue; } return(ret); }
public static VSSolution GetVsSolution(this IBuildPropertiesSession context) { return(context.TryGet <VSSolution>(BuildProps.Solution)); }
public static string GetProfileFolder(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.UserHomeFolder)); }
public static string GetNpmPath(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.NpmPath)); }
public static DefaultTargets GetDefaultTargets(this IBuildPropertiesSession context) { return(context.TryGet <DefaultTargets>(BuildProps.DefaultTargets)); }
/// <summary> /// Get the context variable for SqlCmd executable /// </summary> /// <param name="context"></param> /// <returns></returns> public static string GetSqlCmdExecutable(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.SqlCmdExecutable)); }
public static string GetOutputDir(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.OutputDir)); }
public static string GetProductRootDir(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.ProductRootDir)); }
public static string GetDotnetExecutable(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.DotNetExecutable)); }
public static OSPlatform GetOSPlatform(this IBuildPropertiesSession context) { return(context.TryGet <OSPlatform>(BuildProps.OSPlatform)); }
public static string GetFlubuWebApiBaseUrl(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.FlubuWebApiBaseUrl)); }
public void TryGet_CaseInsensitiveTryGet_Succesfull() { _session.Set("SomeKey", "Value"); Assert.Equal("Value", _session.TryGet <string>("SoMEKEY")); }
/// <summary> /// Get's the build version quality (e.g. version suffix) /// </summary> /// <param name="context"></param> /// <returns></returns> public static string GetBuildVersionQuality(this IBuildPropertiesSession context) { return(context.TryGet <string>(BuildProps.BuildVersionQuality)); }
public static Version GetBuildVersion(this IBuildPropertiesSession context) { return(context.TryGet <Version>(BuildProps.BuildVersion)); }
public static string GetBuildDir(this IBuildPropertiesSession context) { return(context.TryGet <string>(DotNetBuildProps.BuildDir)); }