public FileInfo CreatePluginPackage(PluginDescriptor descriptor) { var result = new PackagingResult { ExtensionType = "Plugin", PackageName = descriptor.FolderName, PackageVersion = descriptor.Version.ToString(), PackageStream = _packageBuilder.BuildPackage(descriptor) }; return SavePackageFile(result); }
private FileInfo SavePackageFile(PackagingResult result) { var fileName = string.Format("{0}{1}.{2}.nupkg", PackagingUtils.GetExtensionPrefix(result.ExtensionType), result.PackageName, result.PackageVersion); if (!Directory.Exists(_outputPath)) { Directory.CreateDirectory(_outputPath); } fileName = Path.Combine(_outputPath, fileName); using (var stream = File.Create(fileName)) { result.PackageStream.CopyTo(stream); } var fileInfo = new FileInfo(fileName); return fileInfo; }
public FileInfo CreateThemePackage(ThemeManifest manifest) { var result = new PackagingResult { ExtensionType = "Theme", PackageName = manifest.ThemeName, PackageVersion = manifest.Version, PackageStream = _packageBuilder.BuildPackage(manifest) }; return SavePackageFile(result); }