Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        private Task <bool> StartBuildAsync(ComponentConfigurationReference configurationReference, ProgressToken progressToken, CancellationTokenSource <CompileCancellationToken> cancellationTokenSource)
        {
            var buildableComponentSubtype = (IBuildableComponentSubtype)configurationReference.Configuration.ComponentSubtype;

            return(buildableComponentSubtype.BuildAsync(configurationReference, cancellationTokenSource.Token, progressToken));
        }