예제 #1
0
 /// <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();
 }
예제 #4
0
        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));
        }
예제 #5
0
 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;
 }
예제 #6
0
        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);
        }
예제 #7
0
 /// <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;
 }
예제 #8
0
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService)
 {
     _fileSystem      = fileSystem;
     _registryService = registryService;
     _filesService    = filesService;
 }
예제 #9
0
 /// <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 &amp; to start and the ending semi-colon.</param>
 public PowershellService(IFileSystem fileSystem, CustomString customImports)
 {
     _fileSystem    = fileSystem;
     _customImports = customImports;
 }
예제 #10
0
 public PowershellService(IFileSystem fileSystem)
     : this(fileSystem, new CustomString(string.Empty))
 {
 }
예제 #11
0
 public NuGetService(IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }
예제 #12
0
 public TemplateService(IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }
예제 #13
0
 /// <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 &amp; to start and the ending semi-colon.</param>
 public PowershellService(IFileSystem fileSystem, CustomString customImports)
 {
     _fileSystem = fileSystem;
     _customImports = customImports;
 }
예제 #14
0
 public PowershellService(IFileSystem fileSystem)
     : this(fileSystem, new CustomString(string.Empty))
 {
 }
예제 #15
0
 public NuGetService(IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService)
 {
     _fileSystem = fileSystem;
     _registryService = registryService;
     _filesService = filesService;
 }