Moving native resources, updating loading code
This commit is contained in:
parent
63637be073
commit
08a3685f53
|
|
@ -9,7 +9,14 @@ use namespace="System.Net"
|
|||
log info='Adding content to ${nupkgFile}'
|
||||
var archive='${ZipFile.Open(nupkgFile, ZipArchiveMode.Update)}'
|
||||
@{
|
||||
archive.CreateEntryFromFile("src/Microsoft.AspNet.Server.Kestrel/amd64/libuv.dll", "amd64/libuv.dll");
|
||||
archive.CreateEntryFromFile("src/Microsoft.AspNet.Server.Kestrel/x86/libuv.dll", "x86/libuv.dll");
|
||||
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");
|
||||
archive.Dispose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,17 +21,39 @@ namespace Microsoft.AspNet.Server.Kestrel
|
|||
Memory = new MemoryPool();
|
||||
Libuv = new Libuv();
|
||||
|
||||
var library = libraryManager.GetLibraryInformation("Microsoft.AspNet.Server.Kestrel");
|
||||
var libraryPath = library.Path;
|
||||
if (library.Type == "Project")
|
||||
{
|
||||
libraryPath = Path.GetDirectoryName(libraryPath);
|
||||
}
|
||||
var architecture = IntPtr.Size == 4
|
||||
? "x86"
|
||||
: "amd64";
|
||||
libraryPath = Path.Combine(libraryPath, architecture, "libuv.dll");
|
||||
var libraryPath = default(string);
|
||||
|
||||
if (libraryManager != null)
|
||||
{
|
||||
var library = libraryManager.GetLibraryInformation("Microsoft.AspNet.Server.Kestrel");
|
||||
libraryPath = library.Path;
|
||||
if (library.Type == "Project")
|
||||
{
|
||||
libraryPath = Path.GetDirectoryName(libraryPath);
|
||||
}
|
||||
if (Libuv.IsWindows)
|
||||
{
|
||||
var architecture = IntPtr.Size == 4
|
||||
? "x86"
|
||||
: "amd64";
|
||||
|
||||
libraryPath = Path.Combine(
|
||||
libraryPath,
|
||||
"native",
|
||||
"windows",
|
||||
architecture,
|
||||
"libuv.dll");
|
||||
}
|
||||
else
|
||||
{
|
||||
libraryPath = Path.Combine(
|
||||
libraryPath,
|
||||
"native",
|
||||
"darwin",
|
||||
"universal",
|
||||
"libuv.dylib");
|
||||
}
|
||||
}
|
||||
Libuv.Load(libraryPath);
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue