本文整理汇总了C#中NuGet.OptimizedZipPackage.GetLibFiles方法的典型用法代码示例。如果您正苦于以下问题:C# OptimizedZipPackage.GetLibFiles方法的具体用法?C# OptimizedZipPackage.GetLibFiles怎么用?C# OptimizedZipPackage.GetLibFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NuGet.OptimizedZipPackage
的用法示例。
在下文中一共展示了OptimizedZipPackage.GetLibFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: installPackageToAppDir
async Task<string> installPackageToAppDir(UpdateInfo updateInfo, ReleaseEntry release)
{
string tmpDir = default(string);
bool shouldDeleteTmpDir = findShortTemporaryDir(out tmpDir);
var fs = new PhysicalFileSystem(tmpDir);
var pkg = new OptimizedZipPackage(fs, Path.Combine(updateInfo.PackageDirectory, release.Filename));
var target = getDirectoryForRelease(release.Version);
// NB: This might happen if we got killed partially through applying the release
if (target.Exists) {
this.Log().Warn("Found partially applied release folder, killing it: " + target.FullName);
await Utility.DeleteDirectory(target.FullName);
}
target.Create();
// Copy all of the files out of the lib/ dirs in the NuGet package
// into our target App directory.
//
// NB: We sort this list in order to guarantee that if a Net20
// and a Net40 version of a DLL get shipped, we always end up
// with the 4.0 version.
this.Log().Info("Writing files to app directory: {0}", target.FullName);
var toWrite = pkg.GetLibFiles().Where(x => pathIsInFrameworkProfile(x, appFrameworkVersion))
.OrderBy(x => x.Path)
.ToList();
// NB: Because of the above NB, we cannot use ForEachAsync here, we
// have to copy these files in-order. Once we fix assembly resolution,
// we can kill both of these NBs.
await Task.Run(() => toWrite.ForEach(x => copyFileToLocation(target, x)));
await pkg.GetContentFiles().ForEachAsync(x => copyFileToLocation(target, x));
if (shouldDeleteTmpDir) {
await Utility.DeleteDirectory(tmpDir);
}
return target.FullName;
}