public void BuildPackage_ToFile()
 {
     var packageBuilder = new ClientNugetPackageBuilder(TypeMapper);
     using (var fileStream = File.Create(packageBuilder.PackageFileName))
     {
         packageBuilder.BuildPackage(fileStream);
     }
 }
        public void BuildPackage_ToFile()
        {
            var packageBuilder = new ClientNugetPackageBuilder(TypeMapper);

            using (var fileStream = File.Create(packageBuilder.PackageFileName))
            {
                packageBuilder.BuildPackage(fileStream);
            }
        }
Ejemplo n.º 3
0
        private void RegisterClientNugetPackageRoute()
        {
            var packageBuilder  = new ClientNugetPackageBuilder(TypeMapper);
            var packageFileName = packageBuilder.PackageFileName;

            Get[PomonaRouteMetadataProvider.ClientNugetPackage, "/Client.nupkg"] =
                x => Response.AsRedirect(packageFileName);
            Get[PomonaRouteMetadataProvider.ClientNugetPackageVersioned, "/" + packageFileName] =
                x => GetClientNugetPackage();
        }
 public void BuildPackage_DoesNotThrowAnyExceptions()
 {
     var packageBuilder = new ClientNugetPackageBuilder(TypeMapper);
     byte[] fileData;
     using (var fileStream = new MemoryStream())
     {
         packageBuilder.BuildPackage(fileStream);
         fileData = fileStream.ToArray();
     }
     Console.WriteLine("Package size is " + fileData.Length/1024.0 + " KiB");
 }
        public void BuildPackage_DoesNotThrowAnyExceptions()
        {
            var packageBuilder = new ClientNugetPackageBuilder(TypeMapper);

            byte[] fileData;
            using (var fileStream = new MemoryStream())
            {
                packageBuilder.BuildPackage(fileStream);
                fileData = fileStream.ToArray();
            }
            Console.WriteLine("Package size is " + fileData.Length / 1024.0 + " KiB");
        }
Ejemplo n.º 6
0
        private Response GetClientNugetPackage()
        {
            var packageBuilder = new ClientNugetPackageBuilder(TypeMapper);

            byte[] bytes;
            using (var memstream = new MemoryStream())
            {
                packageBuilder.BuildPackage(memstream);
                bytes = memstream.ToArray();
            }

            var response = new Response
            {
                Contents    = stream => stream.Write(bytes, 0, bytes.Length),
                ContentType = "application/zip",
            };

            return(response);
        }
Ejemplo n.º 7
0
 private void RegisterClientNugetPackageRoute()
 {
     var packageBuilder = new ClientNugetPackageBuilder(this.typeMapper);
     Get["/client.nupkg"] = x => Response.AsRedirect(packageBuilder.PackageFileName);
     Get["/" + packageBuilder.PackageFileName] = x => GetClientNugetPackage();
 }
Ejemplo n.º 8
0
        private Response GetClientNugetPackage()
        {
            var response = new Response();

            var packageBuilder = new ClientNugetPackageBuilder(this.typeMapper);
            response.Contents = stream =>
            {
                using (var memstream = new MemoryStream())
                {
                    packageBuilder.BuildPackage(memstream);
                    var bytes = memstream.ToArray();
                    stream.Write(bytes, 0, bytes.Length);
                }
            };
            response.ContentType = "binary/octet-stream";

            return response;
        }