public bool BuildTargetGaugeProject() { var projectFullPath = GetProjectFullPath(); var projectConfig = GetProjectConfiguration(); var projectPlatform = GetProjectPlatform(); var gaugeBinDir = Utils.GetGaugeBinDir(); try { var properties = new FSharpList <Tuple <string, string> >(Tuple.Create("Configuration", projectConfig), FSharpList <Tuple <string, string> > .Empty); properties = new FSharpList <Tuple <string, string> >(Tuple.Create("Platform", projectPlatform), properties); properties = new FSharpList <Tuple <string, string> >(Tuple.Create("OutputPath", gaugeBinDir), properties); MSBuildHelper.build(FuncConvert.ToFSharpFunc(delegate(MSBuildHelper.MSBuildParams input) { input.Verbosity = FSharpOption <MSBuildHelper.MSBuildVerbosity> .Some(MSBuildHelper.MSBuildVerbosity.Quiet); input.Targets = new FSharpList <string>("Build", FSharpList <string> .Empty); input.Properties = properties; return(input); }), projectFullPath); } catch (Exception ex) { Logger.Error(ex, "C# Project build failed {0}", ex.Message); return(false); } return(true); }
private static string GetProjectPlatform() { var csprojEnvVariable = Utils.TryReadEnvValue("GAUGE_CSHARP_PROJECT_PLATFORM"); if (!string.IsNullOrEmpty(csprojEnvVariable)) { return(csprojEnvVariable); } return("Any CPU"); }
private static string GetProjectConfiguration() { var csprojEnvVariable = Utils.TryReadEnvValue("GAUGE_CSHARP_PROJECT_CONFIG"); if (!string.IsNullOrEmpty(csprojEnvVariable)) { return(csprojEnvVariable); } return("Debug"); }
private static string GetProjectFullPath() { var csprojEnvVariable = Utils.TryReadEnvValue("GAUGE_CSHARP_PROJECT_FILE"); if (!string.IsNullOrEmpty(csprojEnvVariable)) { return(csprojEnvVariable); } var projectFileList = Directory.GetFiles(Utils.GaugeProjectRoot, "*.csproj"); if (!projectFileList.Any()) { throw new NotAValidGaugeProjectException(); } var projectFullPath = projectFileList.First(); return(projectFullPath); }