private async Task <bool> BuildComponentAsync(ComponentConfigurationReference configurationReference) { var progressToken = new ProgressToken(); CancellationTokenSource <CompileCancellationToken> cancellationTokenSource = CompileCancellationToken.CreateNewSource(); using (var buildMonitor = new CommandLineBuildJobMonitor(configurationReference.Configuration, progressToken, cancellationTokenSource)) { bool result = await StartBuildAsync(configurationReference, progressToken, cancellationTokenSource); return(result && await buildMonitor.WaitForBuildToFinishAsync()); } }
private bool ShowErrorIfSubTypeNotSupported(ComponentConfigurationReference configurationReference) { var componentSubtype = configurationReference.Configuration.ComponentSubtype; if (!CanBuildSubtype(componentSubtype)) { string message = string.Format( CultureInfo.CurrentCulture, LocalizedStrings.BuildComponentTool_ComponentSubTypeNotSupported, configurationReference.ComponentName.Last, configurationReference.Configuration.ComponentSubtype.DisplayName); CommandLineInterfaceApplication.WriteError(message); return(true); } return(false); }
private Task <bool> StartBuildAsync(ComponentConfigurationReference configurationReference, ProgressToken progressToken, CancellationTokenSource <CompileCancellationToken> cancellationTokenSource) { var buildableComponentSubtype = (IBuildableComponentSubtype)configurationReference.Configuration.ComponentSubtype; return(buildableComponentSubtype.BuildAsync(configurationReference, cancellationTokenSource.Token, progressToken)); }