コード例 #1
0
ファイル: NugetService.cs プロジェクト: henkhouwaard/choco
 /// <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;
 }
コード例 #2
0
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService, ChocolateyConfiguration config)
 {
     _fileSystem      = fileSystem;
     _registryService = registryService;
     _filesService    = filesService;
     _config          = config;
 }
コード例 #3
0
 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
ファイル: NugetPack.cs プロジェクト: secretGeek/choco
        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
ファイル: NugetService.cs プロジェクト: chucker/choco
 /// <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
ファイル: PowershellService.cs プロジェクト: torhovland/choco
 /// <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
ファイル: PowershellService.cs プロジェクト: torhovland/choco
 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
ファイル: PowershellService.cs プロジェクト: Prolucid/choco
 /// <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
ファイル: PowershellService.cs プロジェクト: Prolucid/choco
 public PowershellService(IFileSystem fileSystem)
     : this(fileSystem, new CustomString(string.Empty))
 {
 }
コード例 #15
0
 public NuGetService(IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
 }
コード例 #16
0
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService)
 {
     _fileSystem = fileSystem;
     _registryService = registryService;
     _filesService = filesService;
 }