/// <summary> /// Constructor /// </summary> /// <param name="deploymentContext">Deployment context to use</param> /// <param name="deploymentStrategyProvider">Deployment strategy to use</param> /// <param name="transactionSource">Transactions factory</param> /// <param name="packagesFolderPath">Path to cache packages</param> /// <param name="remotePackagesSources">Remote package sources</param> /// <param name="packageDiscoverer">Package version resolver</param> /// <param name="packageDeployer">Package installer</param> /// <param name="localPackagesSources">Local package sources</param> internal DeploymentEngine(DeploymentContext deploymentContext, IDeploymentStrategyProvider deploymentStrategyProvider, IPackageDiscoverer packageDiscoverer, IPackageDeployer packageDeployer, IDeploymentTransactionSource transactionSource, string packagesFolderPath, ICollection <string> remotePackagesSources, ICollection <string> localPackagesSources) { DeploymentContext = deploymentContext; DeploymentStrategyProvider = deploymentStrategyProvider; var extendedLocalPackageSources = localPackagesSources; if (string.IsNullOrWhiteSpace(packagesFolderPath)) { PackagesFolderPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); DontCachePackages = true; } else { PackagesFolderPath = packagesFolderPath; extendedLocalPackageSources = localPackagesSources.Union(new[] { PackagesFolderPath }).ToList(); } NuGetEngine = new NuGetEngine(deploymentContext, PackagesFolderPath, remotePackagesSources, extendedLocalPackageSources); PackageDiscoverer = packageDiscoverer; PackageDiscoverer.NuGetEngine = NuGetEngine; PackageDeployer = packageDeployer; PackageDeployer.NuGetEngine = NuGetEngine; PackageDeployer.DeploymentContext = DeploymentContext; PackageDeployer.DeploymentStrategyProvider = DeploymentStrategyProvider; PackageDeployer.PackagesFolderPath = PackagesFolderPath; TransactionSource = transactionSource; }
/// <summary> /// Allows to define custom package discoverer /// </summary> /// <param name="packageDiscoverer">Package discoverer</param> /// <returns>Configuration object</returns> public DeploymentConfiguration UsePackageDiscoverer(IPackageDiscoverer packageDiscoverer) { _configuration.PackageDiscoverer = packageDiscoverer; return(_configuration); }