Exemple #1
0
        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);
        }
Exemple #2
0
 public static VSSolution GetVsSolution(this IBuildPropertiesSession context)
 {
     return(context.TryGet <VSSolution>(BuildProps.Solution));
 }
Exemple #3
0
 public static string GetProfileFolder(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(BuildProps.UserHomeFolder));
 }
Exemple #4
0
 public static string GetNpmPath(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(BuildProps.NpmPath));
 }
Exemple #5
0
 public static DefaultTargets GetDefaultTargets(this IBuildPropertiesSession context)
 {
     return(context.TryGet <DefaultTargets>(BuildProps.DefaultTargets));
 }
Exemple #6
0
 /// <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));
 }
Exemple #7
0
 public static string GetOutputDir(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(BuildProps.OutputDir));
 }
Exemple #8
0
 public static string GetProductRootDir(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(BuildProps.ProductRootDir));
 }
Exemple #9
0
 public static string GetDotnetExecutable(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(BuildProps.DotNetExecutable));
 }
Exemple #10
0
 public static OSPlatform GetOSPlatform(this IBuildPropertiesSession context)
 {
     return(context.TryGet <OSPlatform>(BuildProps.OSPlatform));
 }
Exemple #11
0
 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));
 }
Exemple #15
0
 public static string GetBuildDir(this IBuildPropertiesSession context)
 {
     return(context.TryGet <string>(DotNetBuildProps.BuildDir));
 }