private static IBootstrapperSettings CreatePreProcessorSettings(IList <string> childArgs, IAnalysisPropertyProvider properties, IAnalysisPropertyProvider globalFileProperties, ILogger logger)
        {
            string hostUrl = TryGetHostUrl(properties, logger);

            if (hostUrl == null)
            {
                return(null); // URL is a required parameter in the pre-process phase
            }

            // If we're using the default properties file then we need to pass it
            // explicitly to the pre-processor (it's in a different folder and won't
            // be able to find it otherwise).
            FilePropertyProvider fileProvider = globalFileProperties as FilePropertyProvider;

            if (fileProvider != null && fileProvider.IsDefaultSettingsFile)
            {
                Debug.Assert(fileProvider.PropertiesFile != null);
                Debug.Assert(!string.IsNullOrEmpty(fileProvider.PropertiesFile.FilePath), "Expecting the properties file path to be set");
                childArgs.Add(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}{1}", FilePropertyProvider.Prefix, fileProvider.PropertiesFile.FilePath));
            }

            IBootstrapperSettings settings = new BootstrapperSettings(
                AnalysisPhase.PreProcessing,
                childArgs,
                hostUrl,
                VerbosityCalculator.ComputeVerbosity(properties, logger),
                logger);

            return(settings);
        }
        private static IBootstrapperSettings CreatePostProcessorSettings(IList <string> childArgs, IAnalysisPropertyProvider properties, ILogger logger)
        {
            IBootstrapperSettings settings = new BootstrapperSettings(
                AnalysisPhase.PostProcessing,
                childArgs,
                string.Empty,
                VerbosityCalculator.ComputeVerbosity(properties, logger),
                logger);

            return(settings);
        }
예제 #3
0
        private static int Main(string[] args)
        {
            var logger = new ConsoleLogger();

            IBootstrapperSettings settings = new BootstrapperSettings(logger);

            int exitCode;

            if (args.Any())
            {
                logger.LogMessage(Resources.INFO_PreProcessing, args.Length);
                exitCode = preprocess(logger, settings, args);
            }
            else
            {
                logger.LogMessage(Resources.INFO_PostProcessing);
                exitCode = postprocess(logger, settings);
            }

            return(exitCode);
        }
        private static IBootstrapperSettings CreatePreProcessorSettings(IList<string> childArgs, IAnalysisPropertyProvider properties, IAnalysisPropertyProvider globalFileProperties, ILogger logger)
        {
            string hostUrl = TryGetHostUrl(properties, logger);
            if (hostUrl == null)
            {
                return null; // URL is a required parameter in the pre-process phase
            }

            // If we're using the default properties file then we need to pass it
            // explicitly to the pre-processor (it's in a different folder and won't
            // be able to find it otherwise).
            FilePropertyProvider fileProvider = globalFileProperties as FilePropertyProvider;
            if (fileProvider != null && fileProvider.IsDefaultSettingsFile)
            {
                Debug.Assert(fileProvider.PropertiesFile != null);
                Debug.Assert(!string.IsNullOrEmpty(fileProvider.PropertiesFile.FilePath), "Expecting the properties file path to be set");
                childArgs.Add(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}\"{1}\"", FilePropertyProvider.Prefix, fileProvider.PropertiesFile.FilePath));
            }

            IBootstrapperSettings settings = new BootstrapperSettings(
                AnalysisPhase.PreProcessing,
                childArgs,
                hostUrl,
                VerbosityCalculator.ComputeVerbosity(properties, logger),
                logger);

            return settings;
        }
        private static IBootstrapperSettings CreatePostProcessorSettings(IList<string> childArgs, IAnalysisPropertyProvider properties, ILogger logger)
        {
            IBootstrapperSettings settings = new BootstrapperSettings(
                AnalysisPhase.PostProcessing,
                childArgs,
                string.Empty,
                VerbosityCalculator.ComputeVerbosity(properties, logger),
                logger);

            return settings;
        }