Ejemplo n.º 1
0
        public static void NuGetInstallFromConfig(this ICakeContext context, FilePath packageConfigPath, NuGetInstallSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var runner = new NuGetInstaller(context.FileSystem, context.Environment, context.ProcessRunner, context.Globber, context.GetToolResolver("NuGet"));

            runner.InstallFromConfig(packageConfigPath, settings);
        }
Ejemplo n.º 2
0
        public static void NuGetInstall(this ICakeContext context, string packageId, NuGetInstallSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var resolver = new NuGetToolResolver(context.FileSystem, context.Environment, context.Tools);
            var runner   = new NuGetInstaller(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, resolver);

            runner.Install(packageId, settings);
        }
        private void InstallPackage(string name, string version)
        {
            NuGetInstaller.InstallPackage(NuGetConstants.DefaultFeedUrl, Project, name, version, false);

            // record the telemetry for the nuget install
            TelemetryWrapper.RecordEvent("NuGet Install",
                                         properties: new Dictionary <string, string>()
            {
                { "Package", name },
                { "Version", version }
            });
        }
Ejemplo n.º 4
0
        public static DocumentModel Download(
            DirectoryPath appDataPath,
            NuGetConfiguration configuration,
            out string version)
        {
            var fileSystem  = new FileSystem();
            var environment = new CakeEnvironment();
            var globber     = new Globber(fileSystem, environment);
            var installer   = new NuGetInstaller(fileSystem, globber);

            var files = new Dictionary <string, IDocumentationMetadata>();

            foreach (var package in configuration.Packages)
            {
                var packageFiles = installer.Install(package, appDataPath);
                foreach (var packageFile in packageFiles)
                {
                    files.Add(packageFile.Path.FullPath, package.Metadata);
                }
            }

            // Find Cake.exe.
            version = "0.5.2"; // Default to this version if we could not find.
            var exe = files.Keys.FirstOrDefault(x => x.EndsWith("Cake.Core.dll"));

            if (exe != null)
            {
                var name = AssemblyName.GetAssemblyName(exe);
                if (name != null)
                {
                    version = string.Format("{0}.{1}.{2}",
                                            name.Version.Major, name.Version.Minor,
                                            name.Version.Build);
                }
            }

            // Build the model.
            return(new DocumentModelBuilder()
                   .BuildModel(files));
        }
        protected override void RunTool()
        {
            var tool = new NuGetInstaller(FileSystem, Environment, ProcessRunner, Tools, Resolver);

            tool.Install(PackageId, Settings);
        }
Ejemplo n.º 6
0
        public void InstallFromConfig()
        {
            var tool = new NuGetInstaller(FileSystem, Environment, ProcessRunner, Globber, NuGetToolResolver);

            tool.InstallFromConfig(PackageConfigPath, Settings);
        }
        protected override void RunTool()
        {
            var tool = new NuGetInstaller(FileSystem, Environment, ProcessRunner, Globber, Resolver);

            tool.InstallFromConfig(PackageConfigPath, Settings);
        }
Ejemplo n.º 8
0
        public void Install()
        {
            var tool = new NuGetInstaller(FileSystem, Environment, ProcessRunner, NuGetToolResolver);

            tool.Install(PackageId, Settings);
        }