コード例 #1
0
		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);
		}
コード例 #2
0
		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;
		}
コード例 #3
0
		public FileInfo CreateThemePackage(ThemeManifest manifest)
		{
			var result = new PackagingResult
			{
				ExtensionType = "Theme",
				PackageName = manifest.ThemeName,
				PackageVersion = manifest.Version,
				PackageStream = _packageBuilder.BuildPackage(manifest)
			};

			return SavePackageFile(result);
		}