41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
use assembly="System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
use assembly="System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
use namespace="System.IO"
|
|
use namespace="System.IO.Compression"
|
|
use namespace="System.Net"
|
|
|
|
#add-files target="compile"
|
|
var each='var nupkgFile in Files.Include("artifacts\\build\\Microsoft.AspNet.Server.Kestrel.*.nupkg").Where(x=>!x.EndsWith("symbols.nupkg"))'
|
|
log info='Adding content to ${nupkgFile}'
|
|
var archive='${ZipFile.Open(nupkgFile, ZipArchiveMode.Update)}'
|
|
@{
|
|
archive.CreateEntryFromFile(
|
|
"src/Microsoft.AspNet.Server.Kestrel/native/windows/amd64/libuv.dll",
|
|
"native/windows/amd64/libuv.dll");
|
|
archive.CreateEntryFromFile(
|
|
"src/Microsoft.AspNet.Server.Kestrel/native/windows/x86/libuv.dll",
|
|
"native/windows/x86/libuv.dll");
|
|
archive.CreateEntryFromFile(
|
|
"src/Microsoft.AspNet.Server.Kestrel/native/darwin/universal/libuv.dylib",
|
|
"native/darwin/universal/libuv.dylib");
|
|
|
|
XDocument doc;
|
|
var entry = archive.GetEntry("[Content_Types].xml");
|
|
using (var stream = entry.Open())
|
|
{
|
|
doc = XDocument.Load(stream);
|
|
}
|
|
doc.Root.Add(
|
|
new XElement(
|
|
XName.Get("Default", "http://schemas.openxmlformats.org/package/2006/content-types"),
|
|
new XAttribute("Extension", "dylib"),
|
|
new XAttribute("ContentType", "application/octet")
|
|
));
|
|
using (var stream = entry.Open())
|
|
{
|
|
doc.Save(stream);
|
|
}
|
|
|
|
archive.Dispose();
|
|
}
|