Exemple #1
0
        static void Main(string[] args)
        {
            executionWatch.Start();
            Console.CancelKeyPress += CancelKeyPressed;

            var fileProxy = new FileSystemProxy();
            var optionsBeforeDependenciesFile = ArgumentParser.ParseArgumentsAndConfigurations(args, ConfigurationManager.AppSettings,
                                                                                               Environment.GetEnvironmentVariables(), fileProxy, Enumerable.Empty <string>());

            ConsoleImpl.Verbosity = optionsBeforeDependenciesFile.Verbosity;

            var argumentsFromDependenciesFile =
                WindowsProcessArguments.Parse(
                    PaketDependencies.GetBootstrapperArgsForFolder(fileProxy));
            var options = ArgumentParser.ParseArgumentsAndConfigurations(args, ConfigurationManager.AppSettings,
                                                                         Environment.GetEnvironmentVariables(), fileProxy, argumentsFromDependenciesFile);

            if (options.ShowHelp)
            {
                ConsoleImpl.WriteAlways(BootstrapperHelper.HelpText);
                return;
            }

            ConsoleImpl.Verbosity = options.Verbosity;
            if (options.UnprocessedCommandArgs.Any())
            {
                ConsoleImpl.WriteWarning("Ignoring the following unknown argument(s): {0}", String.Join(", ", options.UnprocessedCommandArgs));
            }

            var effectiveStrategy = GetEffectiveDownloadStrategy(options.DownloadArguments, options.PreferNuget, options.ForceNuget);

            ConsoleImpl.WriteTrace("Using strategy: " + effectiveStrategy.Name);

            StartPaketBootstrapping(effectiveStrategy, options.DownloadArguments, fileProxy, () => OnSuccessfulDownload(options));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.CancelKeyPress += CancelKeyPressed;

            var fileProxy = new FileSystemProxy();
            var argumentsFromDependenciesFile =
                WindowsProcessArguments.Parse(
                    PaketDependencies.GetBootstrapperArgsForFolder(Environment.CurrentDirectory));
            var options = ArgumentParser.ParseArgumentsAndConfigurations(args, ConfigurationManager.AppSettings,
                                                                         Environment.GetEnvironmentVariables(), fileProxy, argumentsFromDependenciesFile);

            if (options.ShowHelp)
            {
                ConsoleImpl.WriteDebug(BootstrapperHelper.HelpText);
                return;
            }

            ConsoleImpl.Silent = options.Silent;
            if (options.UnprocessedCommandArgs.Any())
            {
                ConsoleImpl.WriteInfo("Ignoring the following unknown argument(s): {0}", String.Join(", ", options.UnprocessedCommandArgs));
            }

            var effectiveStrategy = GetEffectiveDownloadStrategy(options.DownloadArguments, options.PreferNuget, options.ForceNuget);

            StartPaketBootstrapping(effectiveStrategy, options.DownloadArguments, fileProxy, () => OnSuccessfulDownload(options));
        }
Exemple #3
0
        static void Main(string[] args)
        {
            AppContext.SetSwitch("Switch.System.Net.DontEnableSystemDefaultTlsVersions", false);
            executionWatch.Start();
            Console.CancelKeyPress += CancelKeyPressed;

            IProxyProvider proxyProvider = new DefaultProxyProvider();

            var appSettings = ConfigurationManager.AppSettings;

            var appConfigInWorkingDir = Path.Combine(Environment.CurrentDirectory, "paket.bootstrapper.exe.config");

            if (File.Exists(appConfigInWorkingDir))
            {
                var exeInWorkingDir = Path.Combine(Environment.CurrentDirectory, "paket.bootstrapper.exe");
                var exeConf         = ConfigurationManager.OpenExeConfiguration(null);
                if (exeConf != null)
                {
                    var nv = new System.Collections.Specialized.NameValueCollection();
                    foreach (KeyValueConfigurationElement kv in exeConf.AppSettings.Settings)
                    {
                        nv.Add(kv.Key, kv.Value);
                    }
                    appSettings = nv;
                }
            }

            var optionsBeforeDependenciesFile = ArgumentParser.ParseArgumentsAndConfigurations(args, appSettings,
                                                                                               Environment.GetEnvironmentVariables(), proxyProvider.FileSystemProxy, Enumerable.Empty <string>());

            ConsoleImpl.Verbosity = optionsBeforeDependenciesFile.Verbosity;

            var argumentsFromDependenciesFile =
                WindowsProcessArguments.Parse(
                    PaketDependencies.GetBootstrapperArgsForFolder(proxyProvider.FileSystemProxy));
            var options = ArgumentParser.ParseArgumentsAndConfigurations(args, appSettings,
                                                                         Environment.GetEnvironmentVariables(), proxyProvider.FileSystemProxy, argumentsFromDependenciesFile);

            if (options.ShowHelp)
            {
                ConsoleImpl.WriteAlways(BootstrapperHelper.HelpText);
                return;
            }

            ConsoleImpl.Verbosity = options.Verbosity;
            if (options.UnprocessedCommandArgs.Any())
            {
                ConsoleImpl.WriteWarning("Ignoring the following unknown argument(s): {0}", String.Join(", ", options.UnprocessedCommandArgs));
            }

#if PAKET_BOOTSTRAP_NO_CACHE
            ConsoleImpl.WriteTrace("Force ignore cache, because not implemented.");
            options.DownloadArguments.IgnoreCache = true;
#endif

            var effectiveStrategy = GetEffectiveDownloadStrategy(options.DownloadArguments, options.PreferNuget, options.ForceNuget, proxyProvider);
            ConsoleImpl.WriteTrace("Using strategy: " + effectiveStrategy.Name);
            ConsoleImpl.WriteTrace("Using install kind: " + (options.DownloadArguments.AsTool? "tool": "exe"));

            StartPaketBootstrapping(effectiveStrategy, options.DownloadArguments, proxyProvider.FileSystemProxy, () => OnSuccessfulDownload(options));
        }