/// <summary> /// Initializes a new instance of the <see cref="NugetService" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="nugetLogger">The nuget logger</param> /// <param name="packageInfoService">Package information service</param> /// <param name="filesService">The files service</param> public NugetService(IFileSystem fileSystem, ILogger nugetLogger, IChocolateyPackageInformationService packageInfoService, IFilesService filesService) { _fileSystem = fileSystem; _nugetLogger = nugetLogger; _packageInfoService = packageInfoService; _filesService = filesService; }
public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService, ChocolateyConfiguration config) { _fileSystem = fileSystem; _registryService = registryService; _filesService = filesService; _config = config; }
public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService) { _fileSystem = fileSystem; _registryService = registryService; _filesService = filesService; _config = Config.get_configuration_settings(); }
public static IPackage BuildPackage(PackageBuilder builder, IFileSystem fileSystem, string outputPath = null) { ExcludeFiles(builder.Files); // Track if the package file was already present on disk bool isExistingPackage = fileSystem.file_exists(outputPath); try { using (Stream stream = fileSystem.create_file(outputPath)) { // Truncate if needed, as Mono fails to truncate if (stream.Length > 0) { stream.SetLength(0); } builder.Save(stream); } } catch { if (!isExistingPackage && fileSystem.file_exists(outputPath)) { fileSystem.delete_file(outputPath); } throw; } return(new OptimizedZipPackage(outputPath)); }
public ChocolateyPackageService(INugetService nugetService, IPowershellService powershellService, IEnumerable <ISourceRunner> sourceRunners, IShimGenerationService shimgenService, IFileSystem fileSystem, IRegistryService registryService, IChocolateyPackageInformationService packageInfoService, IFilesService filesService, IAutomaticUninstallerService autoUninstallerService, IXmlService xmlService, IConfigTransformService configTransformService) { _nugetService = nugetService; _powershellService = powershellService; _sourceRunners = sourceRunners; _shimgenService = shimgenService; _fileSystem = fileSystem; _registryService = registryService; _packageInfoService = packageInfoService; _filesService = filesService; _autoUninstallerService = autoUninstallerService; _xmlService = xmlService; _configTransformService = configTransformService; }
public static IPackage BuildPackage(PackageBuilder builder, IFileSystem fileSystem, string outputPath = null) { ExcludeFiles(builder.Files); // Track if the package file was already present on disk bool isExistingPackage = fileSystem.file_exists(outputPath); try { using (Stream stream = fileSystem.create_file(outputPath)) { builder.Save(stream); } } catch { if (!isExistingPackage && fileSystem.file_exists(outputPath)) { fileSystem.delete_file(outputPath); } throw; } return new OptimizedZipPackage(outputPath); }
/// <summary> /// Initializes a new instance of the <see cref="NugetService" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="nugetLogger">The nuget logger</param> /// <param name="packageInfoService">Package information service</param> public NugetService(IFileSystem fileSystem, ILogger nugetLogger, IChocolateyPackageInformationService packageInfoService) { _fileSystem = fileSystem; _nugetLogger = nugetLogger; _packageInfoService = packageInfoService; }
public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService) { _fileSystem = fileSystem; _registryService = registryService; _filesService = filesService; }
/// <summary> /// Initializes a new instance of the <see cref="PowershellService" /> class. /// </summary> /// <param name="fileSystem">The file system.</param> /// <param name="customImports">The custom imports. This should be everything you need minus the & to start and the ending semi-colon.</param> public PowershellService(IFileSystem fileSystem, CustomString customImports) { _fileSystem = fileSystem; _customImports = customImports; }
public PowershellService(IFileSystem fileSystem) : this(fileSystem, new CustomString(string.Empty)) { }
public NuGetService(IFileSystem fileSystem) { _fileSystem = fileSystem; }
public TemplateService(IFileSystem fileSystem) { _fileSystem = fileSystem; }