mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Move fixtures directory and clean up locator
This commit is contained in:
@@ -35,7 +35,6 @@ fn test_patch_apply() {
|
|||||||
path.pop();
|
path.pop();
|
||||||
path.pop();
|
path.pop();
|
||||||
path.push("test");
|
path.push("test");
|
||||||
path.push("Squirrel.Tests");
|
|
||||||
path.push("fixtures");
|
path.push("fixtures");
|
||||||
info!("Path: {}", path.to_string_lossy());
|
info!("Path: {}", path.to_string_lossy());
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
<AssemblyOriginatorKeyFile>..\..\Squirrel.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>..\..\Squirrel.snk</AssemblyOriginatorKeyFile>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Coverage -->
|
<PropertyGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) and $(CI) != '' ">
|
||||||
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
|
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
|
||||||
<CoverletOutput>..\coverage.$(CurrentOsName).$(MSBuildProjectName).xml</CoverletOutput>
|
<CoverletOutput>..\coverage.$(CurrentOsName).$(MSBuildProjectName).xml</CoverletOutput>
|
||||||
<Include>[Squirrel*]*</Include>
|
<Include>[Squirrel*]*</Include>
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
|
|
||||||
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
|
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
|
||||||
<Compile Include="..\GlobalUsings.cs" Link="GlobalUsings.cs" />
|
<Compile Include="..\GlobalUsings.cs" Link="GlobalUsings.cs" />
|
||||||
|
<Compile Include="..\PathHelper.cs" Link="PathHelper.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
|
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
|
||||||
|
|||||||
22
test/PathHelper.cs
Normal file
22
test/PathHelper.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
public static class PathHelper
|
||||||
|
{
|
||||||
|
public static string GetFixturesDir()
|
||||||
|
=> Path.Combine(GetTestRoot(), "fixtures");
|
||||||
|
|
||||||
|
public static string GetFixture(params string[] names)
|
||||||
|
=> Path.Combine(new string[] { GetTestRoot(), "fixtures" }.Concat(names).ToArray());
|
||||||
|
|
||||||
|
public static string GetTestRoot()
|
||||||
|
{
|
||||||
|
// XXX: This is an evil hack, but it's okay for a unit test
|
||||||
|
// We can't use Assembly.Location because unit test runners love
|
||||||
|
// to move stuff to temp directories
|
||||||
|
var st = new StackFrame(true);
|
||||||
|
#pragma warning disable CS8604 // Possible null reference argument.
|
||||||
|
var di = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(st.GetFileName())));
|
||||||
|
#pragma warning restore CS8604 // Possible null reference argument.
|
||||||
|
return di.FullName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,8 +18,8 @@ namespace Squirrel.Tests
|
|||||||
[InlineData("complex.xml", "complex-merged.xml")]
|
[InlineData("complex.xml", "complex-merged.xml")]
|
||||||
public void MergeContentTypes(string inputFileName, string expectedFileName)
|
public void MergeContentTypes(string inputFileName, string expectedFileName)
|
||||||
{
|
{
|
||||||
var inputFile = IntegrationTestHelper.GetPath("fixtures", "content-types", inputFileName);
|
var inputFile = PathHelper.GetFixture("content-types", inputFileName);
|
||||||
var expectedFile = IntegrationTestHelper.GetPath("fixtures", "content-types", expectedFileName);
|
var expectedFile = PathHelper.GetFixture("content-types", expectedFileName);
|
||||||
var tempFile = Path.GetTempFileName() + ".xml";
|
var tempFile = Path.GetTempFileName() + ".xml";
|
||||||
|
|
||||||
var expected = new XmlDocument();
|
var expected = new XmlDocument();
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace Squirrel.Tests
|
|||||||
[InlineData("Squirrel.Core.1.1.0.0.nupkg", 15830, "9baf1dbacb09940086c8c62d9a9dbe69fe1f7593")]
|
[InlineData("Squirrel.Core.1.1.0.0.nupkg", 15830, "9baf1dbacb09940086c8c62d9a9dbe69fe1f7593")]
|
||||||
public void GenerateFromFileTest(string name, long size, string sha1)
|
public void GenerateFromFileTest(string name, long size, string sha1)
|
||||||
{
|
{
|
||||||
var path = IntegrationTestHelper.GetPath("fixtures", name);
|
var path = PathHelper.GetFixture(name);
|
||||||
|
|
||||||
using (var f = File.OpenRead(path)) {
|
using (var f = File.OpenRead(path)) {
|
||||||
var fixture = ReleaseEntry.GenerateFromFile(f, "dontcare");
|
var fixture = ReleaseEntry.GenerateFromFile(f, "dontcare");
|
||||||
@@ -254,7 +254,7 @@ namespace Squirrel.Tests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void CanParseGeneratedReleaseEntryAsString()
|
public void CanParseGeneratedReleaseEntryAsString()
|
||||||
{
|
{
|
||||||
var path = IntegrationTestHelper.GetPath("fixtures", "Squirrel.Core.1.1.0.0.nupkg");
|
var path = PathHelper.GetFixture("Squirrel.Core.1.1.0.0.nupkg");
|
||||||
var entryAsString = ReleaseEntry.GenerateFromFile(path).EntryAsString;
|
var entryAsString = ReleaseEntry.GenerateFromFile(path).EntryAsString;
|
||||||
ReleaseEntry.ParseReleaseEntry(entryAsString);
|
ReleaseEntry.ParseReleaseEntry(entryAsString);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Squirrel.Tests.TestHelpers
|
|||||||
public FakeFixtureRepository(string pkgId, bool mockLatestFullVer)
|
public FakeFixtureRepository(string pkgId, bool mockLatestFullVer)
|
||||||
{
|
{
|
||||||
_pkgId = pkgId;
|
_pkgId = pkgId;
|
||||||
var releases = ReleaseEntry.BuildReleasesFile(IntegrationTestHelper.GetFixturesPath(), false)
|
var releases = ReleaseEntry.BuildReleasesFile(PathHelper.GetFixturesDir(), false)
|
||||||
.Where(r => r.OriginalFilename.StartsWith(_pkgId))
|
.Where(r => r.OriginalFilename.StartsWith(_pkgId))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ namespace Squirrel.Tests.TestHelpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
|
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
|
||||||
var filePath = IntegrationTestHelper.GetPath("fixtures", rel.OriginalFilename);
|
var filePath = PathHelper.GetFixture(rel.OriginalFilename);
|
||||||
if (!File.Exists(filePath)) {
|
if (!File.Exists(filePath)) {
|
||||||
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + rel.OriginalFilename);
|
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + rel.OriginalFilename);
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ namespace Squirrel.Tests.TestHelpers
|
|||||||
public Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization = null, string accept = null)
|
public Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization = null, string accept = null)
|
||||||
{
|
{
|
||||||
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
|
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
|
||||||
var filePath = IntegrationTestHelper.GetPath("fixtures", rel.OriginalFilename);
|
var filePath = PathHelper.GetFixture(rel.OriginalFilename);
|
||||||
if (!File.Exists(filePath)) {
|
if (!File.Exists(filePath)) {
|
||||||
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + rel.OriginalFilename);
|
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + rel.OriginalFilename);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using Squirrel;
|
|
||||||
using Xunit;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO.Compression;
|
|
||||||
|
|
||||||
namespace Squirrel.Tests.TestHelpers
|
|
||||||
{
|
|
||||||
public static class IntegrationTestHelper
|
|
||||||
{
|
|
||||||
public static string GetPath(params string[] paths)
|
|
||||||
{
|
|
||||||
var ret = GetIntegrationTestRootDirectory();
|
|
||||||
return (new FileInfo(paths.Aggregate(ret, Path.Combine))).FullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetIntegrationTestRootDirectory()
|
|
||||||
{
|
|
||||||
// XXX: This is an evil hack, but it's okay for a unit test
|
|
||||||
// We can't use Assembly.Location because unit test runners love
|
|
||||||
// to move stuff to temp directories
|
|
||||||
var st = new StackFrame(true);
|
|
||||||
var di = new DirectoryInfo(Path.Combine(Path.GetDirectoryName(st.GetFileName()), ".."));
|
|
||||||
|
|
||||||
return di.FullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetFixturesPath() => GetPath("fixtures");
|
|
||||||
|
|
||||||
public static bool SkipTestOnXPAndVista()
|
|
||||||
{
|
|
||||||
int osVersion = Environment.OSVersion.Version.Major * 100 + Environment.OSVersion.Version.Minor;
|
|
||||||
return (osVersion < 601);
|
|
||||||
}
|
|
||||||
|
|
||||||
//public static void RunBlockAsSTA(Action block)
|
|
||||||
//{
|
|
||||||
// Exception ex = null;
|
|
||||||
// var t = new Thread(() => {
|
|
||||||
// try {
|
|
||||||
// block();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// ex = e;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// t.SetApartmentState(ApartmentState.STA);
|
|
||||||
// t.Start();
|
|
||||||
// t.Join();
|
|
||||||
|
|
||||||
// if (ex != null) {
|
|
||||||
// // NB: If we don't do this, the test silently passes
|
|
||||||
// throw new Exception("", ex);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
public static IDisposable WithFakeInstallDirectory(string packageFileName, out string path)
|
|
||||||
{
|
|
||||||
var ret = Utility.GetTempDirectory(out path);
|
|
||||||
|
|
||||||
File.Copy(GetPath("fixtures", packageFileName), Path.Combine(path, packageFileName));
|
|
||||||
var rp = ReleaseEntry.GenerateFromFile(Path.Combine(path, packageFileName));
|
|
||||||
ReleaseEntry.WriteReleaseFile(new[] { rp }, Path.Combine(path, "RELEASES"));
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
//public static string CreateFakeInstalledApp(string version, string outputDir, string nuspecFile = null)
|
|
||||||
//{
|
|
||||||
// string targetDir;
|
|
||||||
|
|
||||||
// nuspecFile = nuspecFile ?? "SquirrelInstalledApp.nuspec";
|
|
||||||
|
|
||||||
// using (var clearTemp = Utility.GetTempDirectory(out targetDir)) {
|
|
||||||
// var nuspec = File.ReadAllText(IntegrationTestHelper.GetPath("fixtures", nuspecFile), Encoding.UTF8);
|
|
||||||
// var nuspecPath = Path.Combine(targetDir, nuspecFile);
|
|
||||||
|
|
||||||
// File.WriteAllText(nuspecPath, nuspec.Replace("0.1.0", version), Encoding.UTF8);
|
|
||||||
|
|
||||||
// File.Copy(
|
|
||||||
// IntegrationTestHelper.GetPath("fixtures", "PublishSingleFileAwareApp.exe"),
|
|
||||||
// Path.Combine(targetDir, "SquirrelAwareApp.exe"));
|
|
||||||
// File.Copy(
|
|
||||||
// IntegrationTestHelper.GetPath("fixtures", "NotSquirrelAwareApp.exe"),
|
|
||||||
// Path.Combine(targetDir, "NotSquirrelAwareApp.exe"));
|
|
||||||
|
|
||||||
// new NugetConsole().Pack(nuspecPath, targetDir, targetDir);
|
|
||||||
|
|
||||||
// var di = new DirectoryInfo(targetDir);
|
|
||||||
// var pkg = di.EnumerateFiles("*.nupkg").First();
|
|
||||||
|
|
||||||
// var targetPkgFile = Path.Combine(outputDir, pkg.Name);
|
|
||||||
// File.Copy(pkg.FullName, targetPkgFile);
|
|
||||||
// return targetPkgFile;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public static void CreateNewVersionInPackageDir(string version, string outputDir, string nuspecFile = null)
|
|
||||||
//{
|
|
||||||
// var pkgFile = CreateFakeInstalledApp(version, outputDir, nuspecFile);
|
|
||||||
// var pkgs = ReleaseEntry.BuildReleasesFile(outputDir);
|
|
||||||
// ReleaseEntry.WriteReleaseFile(pkgs, Path.Combine(outputDir, "RELEASES"));
|
|
||||||
//}
|
|
||||||
|
|
||||||
public static IDisposable WithFakeInstallDirectory(out string path)
|
|
||||||
{
|
|
||||||
return WithFakeInstallDirectory("SampleUpdatingApp.1.1.0.0.nupkg", out path);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IDisposable WithFakeAlreadyInstalledApp(out string path)
|
|
||||||
{
|
|
||||||
return WithFakeAlreadyInstalledApp("InstalledSampleUpdatingApp-1.1.0.0.zip", out path);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IDisposable WithFakeAlreadyInstalledApp(string zipFile, out string path)
|
|
||||||
{
|
|
||||||
var ret = Utility.GetTempDirectory(out path);
|
|
||||||
|
|
||||||
// NB: Apparently Ionic.Zip is perfectly content to extract a Zip
|
|
||||||
// file that doesn't actually exist, without failing.
|
|
||||||
var zipPath = GetPath("fixtures", zipFile);
|
|
||||||
Assert.True(File.Exists(zipPath));
|
|
||||||
|
|
||||||
ZipFile.ExtractToDirectory(zipPath, path);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -186,7 +186,7 @@ namespace Squirrel.Tests
|
|||||||
var source = new SimpleWebSource("http://any.com", null, repo, logger);
|
var source = new SimpleWebSource("http://any.com", null, repo, logger);
|
||||||
|
|
||||||
var basePkg = (await source.GetReleaseFeed()).Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
var basePkg = (await source.GetReleaseFeed()).Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
||||||
var basePkgFixturePath = IntegrationTestHelper.GetPath("fixtures", basePkg.OriginalFilename);
|
var basePkgFixturePath = PathHelper.GetFixture(basePkg.OriginalFilename);
|
||||||
var basePkgPath = Path.Combine(packagesDir, basePkg.OriginalFilename);
|
var basePkgPath = Path.Combine(packagesDir, basePkg.OriginalFilename);
|
||||||
File.Copy(basePkgFixturePath, basePkgPath);
|
File.Copy(basePkgFixturePath, basePkgPath);
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace Squirrel.Tests
|
|||||||
public void ShaCheckShouldBeCaseInsensitive()
|
public void ShaCheckShouldBeCaseInsensitive()
|
||||||
{
|
{
|
||||||
var sha1FromExternalTool = "75255cfd229a1ed1447abe1104f5635e69975d30";
|
var sha1FromExternalTool = "75255cfd229a1ed1447abe1104f5635e69975d30";
|
||||||
var inputPackage = IntegrationTestHelper.GetPath("fixtures", "Squirrel.Core.1.0.0.0.nupkg");
|
var inputPackage = PathHelper.GetFixture("Squirrel.Core.1.0.0.0.nupkg");
|
||||||
var stream = File.OpenRead(inputPackage);
|
var stream = File.OpenRead(inputPackage);
|
||||||
var sha1 = Utility.CalculateStreamSHA1(stream);
|
var sha1 = Utility.CalculateStreamSHA1(stream);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Squirrel.Tests
|
|||||||
public void HasSameFilesAndDependenciesAsPackaging()
|
public void HasSameFilesAndDependenciesAsPackaging()
|
||||||
{
|
{
|
||||||
using var _1 = Utility.GetTempDirectory(out var tempDir);
|
using var _1 = Utility.GetTempDirectory(out var tempDir);
|
||||||
var inputPackage = IntegrationTestHelper.GetPath("fixtures", "slack-1.1.8-full.nupkg");
|
var inputPackage = PathHelper.GetFixture("slack-1.1.8-full.nupkg");
|
||||||
var copyPackage = Path.Combine(tempDir, "slack-1.1.8-full.nupkg");
|
var copyPackage = Path.Combine(tempDir, "slack-1.1.8-full.nupkg");
|
||||||
File.Copy(inputPackage, copyPackage);
|
File.Copy(inputPackage, copyPackage);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ namespace Squirrel.Tests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void ParsesNuspecCorrectly()
|
public void ParsesNuspecCorrectly()
|
||||||
{
|
{
|
||||||
var inputPackage = IntegrationTestHelper.GetPath("fixtures", "FullNuspec.1.0.0.nupkg");
|
var inputPackage = PathHelper.GetFixture("FullNuspec.1.0.0.nupkg");
|
||||||
var zp = new ZipPackage(inputPackage);
|
var zp = new ZipPackage(inputPackage);
|
||||||
|
|
||||||
var dyn = ExposedObject.From(zp);
|
var dyn = ExposedObject.From(zp);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,57 +0,0 @@
|
|||||||
Apache License, Version 2.0
|
|
||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
||||||
|
|
||||||
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
||||||
|
|
||||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
||||||
|
|
||||||
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
=== version 3.0
|
|
||||||
================================================================================================
|
|
||||||
change - Removed overloads of logging methods that were taking format string from ILogger and
|
|
||||||
ILogger and IExtendedLogger and didn't have word Format in their name.
|
|
||||||
For example:
|
|
||||||
void Error(string format, params object[] args); // was removed
|
|
||||||
void ErrorFormat(string format, params object[] args); //use this one instead
|
|
||||||
|
|
||||||
|
|
||||||
impact - low
|
|
||||||
fixability - medium
|
|
||||||
revision -
|
|
||||||
|
|
||||||
description - To minimize confusion and duplication those methods were removed.
|
|
||||||
|
|
||||||
fix - Use methods that have explicit "Format" word in their name and same signature.
|
|
||||||
================================================================================================
|
|
||||||
change - Removed WebLogger and WebLoggerFactory
|
|
||||||
|
|
||||||
impact - low
|
|
||||||
fixability - medium
|
|
||||||
revision -
|
|
||||||
|
|
||||||
description - To minimize management overhead the classes were removed so that only single
|
|
||||||
Client Profile version of Castle.Core can be distributed.
|
|
||||||
|
|
||||||
fix - You can use NLog or Log4Net web logger integration, or reuse implementation of existing
|
|
||||||
web logger and use it as a custom logger.
|
|
||||||
|
|
||||||
================================================================================================
|
|
||||||
change - Removed obsolete overload of ProxyGenerator.CreateClassProxy
|
|
||||||
|
|
||||||
impact - low
|
|
||||||
fixability - trivial
|
|
||||||
revision -
|
|
||||||
|
|
||||||
description - Deprecated overload of ProxyGenerator.CreateClassProxy was removed to keep the
|
|
||||||
method consistent with other methods and to remove confusion
|
|
||||||
|
|
||||||
fix - whenever removed overload was used, use one of the other overloads.
|
|
||||||
|
|
||||||
================================================================================================
|
|
||||||
change - IProxyGenerationHook.NonVirtualMemberNotification method was renamed
|
|
||||||
|
|
||||||
impact - high
|
|
||||||
fixability - easy
|
|
||||||
revision -
|
|
||||||
|
|
||||||
description - to accommodate class proxies with target method NonVirtualMemberNotification on
|
|
||||||
IProxyGenerationHook type was renamed to more accurate NonProxyableMemberNotification
|
|
||||||
since for class proxies with target not just methods but also fields and other member that
|
|
||||||
break the abstraction will be passed to this method.
|
|
||||||
|
|
||||||
fix - whenever NonVirtualMemberNotification is used/implemented change the method name to
|
|
||||||
NonProxyableMemberNotification. Implementors should also accommodate possibility that not
|
|
||||||
only MethodInfos will be passed as method's second parameter.
|
|
||||||
|
|
||||||
================================================================================================
|
|
||||||
change - DynamicProxy will now allow to intercept members of System.Object
|
|
||||||
|
|
||||||
impact - very low
|
|
||||||
fixability - easy
|
|
||||||
revision -
|
|
||||||
|
|
||||||
description - to allow scenarios like mocking of System.Object members, DynamicProxy will not
|
|
||||||
disallow proxying of these methods anymore. AllMethodsHook (default IProxyGenerationHook)
|
|
||||||
will still filter them out though.
|
|
||||||
|
|
||||||
fix - whenever custom IProxyGenerationHook is used, user should account for System.Object's
|
|
||||||
members being now passed to ShouldInterceptMethod and NonVirtualMemberNotification methods
|
|
||||||
and if neccessary update the code to handle them appropriately.
|
|
||||||
Binary file not shown.
@@ -1,196 +0,0 @@
|
|||||||
3.2.0 (2013-02-16)
|
|
||||||
==================
|
|
||||||
- fixed DYNPROXY-179 - Exception when creating a generic proxy (from cache)
|
|
||||||
- fixed DYNPROXY-175 - invalid CompositionInvocation type used when code uses interface proxies with and without InterceptorSelector
|
|
||||||
|
|
||||||
3.1.0 (2012-08-05)
|
|
||||||
==================
|
|
||||||
- fixed DYNPROXY-174 - Unable to cast object of type 'System.Collections.ObjectModel.ReadOnlyCollection`1[System.Reflection.CustomAttributeTypedArgument]' to type 'System.Array'
|
|
||||||
|
|
||||||
3.1.0 RC (2012-07-08)
|
|
||||||
==================
|
|
||||||
- support multiple inheritance of DA attributes on interfaces.
|
|
||||||
- BREAKING CHANGE: removed propogate child notifications as it violated INotifyPropertyChanged contract
|
|
||||||
- improved DictionaryAdapter performance
|
|
||||||
- generalized IBindingList support for DictionaryAdapters
|
|
||||||
- added reference support to XmlAdapter
|
|
||||||
- BRAKING CHANGE: refactored XPathAdapter into XmlAdapter with much more flexibility to support other input like XLinq
|
|
||||||
|
|
||||||
- implemented CORE-43 - Add option to skip configuring log4net/nlog
|
|
||||||
|
|
||||||
- fixed CORE-44 - NLog logger does not preserver call site info
|
|
||||||
- fixed DYNPROXY-171 - PEVerify error on generic method definition
|
|
||||||
- fixed DYNPROXY-170 - Calls to properties inside non-intercepted methods are not forwarded to target object (regression from v2.5)
|
|
||||||
- fixed DYNPROXY-169 - Support IChangeProxyTarget on additional interfaces and mixins when using CreateInterfaceProxyWithTargetInterface
|
|
||||||
|
|
||||||
3.0.0 (2011-12-13)
|
|
||||||
==================
|
|
||||||
no major changes since RC
|
|
||||||
|
|
||||||
3.0.0 RC 1 (2011-11-20)
|
|
||||||
==================
|
|
||||||
- Applied Jeff Sharps patch that refactored Xml DictionaryAdapter to improve maintainability and enable more complete functionality
|
|
||||||
|
|
||||||
- fixed DYNPROXY-165 - Object.GetType() and Object.MemberwiseClone() should be ignored and not reported as non-interceptable to IProxyGenerationHook
|
|
||||||
- fixed DYNPROXY-164 - Invalid Proxy type generated when there are more than one base class generic constraints
|
|
||||||
- fixed DYNPROXY-162 - ref or out parameters can not be passed back if proxied method throw an exception
|
|
||||||
|
|
||||||
3.0.0 beta 1 (2011-08-14)
|
|
||||||
==================
|
|
||||||
- fixed CORE-37 - TAB characters in the XML Configuration of a component parameter is read as String.Empty
|
|
||||||
- fixed DYNPROXY-161 - Strong Named DynamicProxy Assembly Not Available in Silverligh
|
|
||||||
- fixed DYNPROXY-159 - Sorting MemberInfo array for serialization has side effects
|
|
||||||
- fixed DYNPROXY-158 - Can't create class proxy with target and without target in same ProxyGenerator
|
|
||||||
- fixed DYNPROXY-153 - When proxying a generic interface which has an interface as GenericType . No proxy can be created
|
|
||||||
- fixed DYNPROXY-151 - Cast error when using attributes
|
|
||||||
|
|
||||||
- implemented CORE-33 - Add lazy logging
|
|
||||||
- implemented DYNPROXY-156 - Provide mechanism for interceptors to implement retry logic
|
|
||||||
|
|
||||||
- removed obsolete members from ILogger and its implementations
|
|
||||||
|
|
||||||
2.5.2 (2010-11-15)
|
|
||||||
==================
|
|
||||||
- fixed DYNPROXY-150 - Finalizer should not be proxied
|
|
||||||
- implemented DYNPROXY-149 - Make AllMethodsHook members virtual so it can be used as a base class
|
|
||||||
- fixed DYNPROXY-147 - Can't crete class proxies with two non-public methods having same argument types but different return type
|
|
||||||
- fixed DYNPROXY-145 Unable to proxy System.Threading.SynchronizationContext (.NET 4.0)
|
|
||||||
- fixed DYNPROXY-144 - params argument not supported in constructor
|
|
||||||
- fixed DYNPROXY-143 - Permit call to reach "non-proxied" methods of inherited interfaces
|
|
||||||
- implemented DYNPROXY-139 - Better error message
|
|
||||||
- fixed DYNPROXY-133 - Debug assertion in ClassProxyInstanceContributor fails when proxying ISerializable with an explicit implementation of GetObjectData
|
|
||||||
- fixed CORE-32 - Determining if permission is granted via PermissionUtil does not work in .NET 4
|
|
||||||
- applied patch by Alwin Meijs - ExtendedLog4netFactory can be configured with a stream from for example an embedded log4net xml config
|
|
||||||
- Upgraded NLog to 2.0 Beta 1
|
|
||||||
- Added DefaultXmlSerializer to bridge XPathAdapter with standard Xml Serialization.
|
|
||||||
- XPathAdapter for DictionaryAdapter added IXPathSerializer to provide hooks for custom serialization.
|
|
||||||
|
|
||||||
2.5.1 (2010-09-21)
|
|
||||||
==================
|
|
||||||
- Interface proxy with target Interface now accepts null as a valid target value (which can be replaced at a later stage).
|
|
||||||
- DictionaryAdapter behavior overrides are now ordered with all other behaviors
|
|
||||||
- BREAKING CHANGE: removed web logger so that by default Castle.Core works in .NET 4 client profile
|
|
||||||
- added paramter to ModuleScope disabling usage of signed modules. This is to workaround issue DYNPROXY-134. Also a descriptive exception message is being thrown now when the issue is detected.
|
|
||||||
- Added IDictionaryBehaviorBuilder to allow grouping behaviors
|
|
||||||
- Added GenericDictionaryAdapter to simplify generic value sources
|
|
||||||
- fixed issue DYNPROXY-138 - Error message missing space
|
|
||||||
- fixed false positive where DynamicProxy would not let you proxy interface with target interface when target object was a COM object.
|
|
||||||
- fixed ReflectionBasedDictionaryAdapter when using indexed properties
|
|
||||||
|
|
||||||
2.5.0 (2010-08-21)
|
|
||||||
==================
|
|
||||||
- DynamicProxy will now not replicate non-public attribute types
|
|
||||||
- Applied patch from Kenneth Siewers M<>ller which adds parameterless constructor to DefaultSmtpSender implementation, to be able to configure the inner SmtpClient from the application configuration file (system.net.smtp).
|
|
||||||
- added support for .NET 4 and Silverlight 4, updated solution to VisualStudio 2010
|
|
||||||
- Removed obsolete overload of CreateClassProxy
|
|
||||||
- Added class proxy with taget
|
|
||||||
- Added ability to intercept explicitly implemented generic interface methods on class proxy.
|
|
||||||
- DynamicProxy does not disallow intercepting members of System.Object anymore. AllMethodsHook will still filter them out though.
|
|
||||||
- Added ability to intercept explicitly implemented interface members on class proxy. Does not support generic members.
|
|
||||||
- Merged DynamicProxy into Core binary
|
|
||||||
- fixed DYNPROXY-ISSUE-132 - "MetaProperty equals implementation incorrect"
|
|
||||||
- Fixed bug in DiagnosticsLoggerTestCase, where when running as non-admin, the teardown will throw SecurityException (contributed by maxild)
|
|
||||||
- Split IoC specific classes into Castle.Windsor project
|
|
||||||
- Merged logging services solution
|
|
||||||
- Merged DynamicProxy project
|
|
||||||
|
|
||||||
1.2.0 (2010-01-11)
|
|
||||||
==================
|
|
||||||
|
|
||||||
- Added IEmailSender interface and its default implementation
|
|
||||||
|
|
||||||
1.2.0 beta (2009-12-04)
|
|
||||||
==================
|
|
||||||
|
|
||||||
- BREAKING CHANGE - added ChangeProxyTarget method to IChangeProxyTarget interface
|
|
||||||
- added docs to IChangeProxyTarget methods
|
|
||||||
- Fixed DYNPROXY-ISSUE-108 - Obtaining replicated custom attributes on proxy may fail when property setter throws exception on default value
|
|
||||||
- Moved custom attribute replication from CustomAttributeUtil to new interface - IAttributeDisassembler
|
|
||||||
- Exposed IAttributeDisassembler via ProxyGenerationOptions, so that users can plug their implementation for some convoluted scenarios. (for Silverlight)
|
|
||||||
- Moved IInterceptorSelector from Dynamic Proxy to Core (IOC-ISSUE-156)
|
|
||||||
|
|
||||||
1.1.0 (2009-05-04)
|
|
||||||
==================
|
|
||||||
|
|
||||||
- Applied Eric Hauser's patch fixing CORE-ISSUE-22
|
|
||||||
"Support for environment variables in resource URI"
|
|
||||||
|
|
||||||
- Applied Gauthier Segay's patch fixing CORE-ISSUE-20
|
|
||||||
"Castle.Core.Tests won't build via nant because it use TraceContext without referencing System.Web.dll"
|
|
||||||
|
|
||||||
- Added simple interface to ComponentModel to make optional properties required.
|
|
||||||
|
|
||||||
- Applied Mark's -- <mwatts42@gmail.com> -- patch that changes
|
|
||||||
the Core to support being compiled for Silverlight 2
|
|
||||||
|
|
||||||
- Applied Louis DeJardin's patch adding TraceLogger as a new logger implementation
|
|
||||||
|
|
||||||
- Applied Chris Bilson's patch fixing CORE-15
|
|
||||||
"WebLogger Throws When Logging Outside of an HttpContext"
|
|
||||||
|
|
||||||
Release Candidate 3
|
|
||||||
===================
|
|
||||||
|
|
||||||
- Added IServiceProviderEx which extends IServiceProvider
|
|
||||||
|
|
||||||
- Added Pair<T,S> class.
|
|
||||||
|
|
||||||
- Applied Bill Pierce's patch fixing CORE-9
|
|
||||||
"Allow CastleComponent Attribute to Specify Lifestyle in Constructor"
|
|
||||||
|
|
||||||
- Added UseSingleInterfaceProxy to CompomentModel to control the proxying
|
|
||||||
behavior while maintaining backward compatibility.
|
|
||||||
Added the corresponding ComponentProxyBehaviorAttribute.
|
|
||||||
|
|
||||||
- Made NullLogger and IExtnededLogger
|
|
||||||
|
|
||||||
- Enabled a new format on ILogger interface, with 6 overloads for each method:
|
|
||||||
Debug(string)
|
|
||||||
Debug(string, Exception)
|
|
||||||
Debug(string, params object[])
|
|
||||||
DebugFormat(string, params object[])
|
|
||||||
DebugFormat(Exception, string, params object[])
|
|
||||||
DebugFormat(IFormatProvider, string, params object[])
|
|
||||||
DebugFormat(IFormatProvider, Exception, string, params object[])
|
|
||||||
|
|
||||||
The "FatalError" overloads where marked as [Obsolete], replaced by "Fatal" and "FatalFormat".
|
|
||||||
|
|
||||||
0.0.1.0
|
|
||||||
=======
|
|
||||||
|
|
||||||
- Included IProxyTargetAccessor
|
|
||||||
|
|
||||||
- Removed IMethodInterceptor and IMethodInvocation, that have been replaced
|
|
||||||
by IInterceptor and IInvocation
|
|
||||||
|
|
||||||
- Added FindByPropertyInfo to PropertySetCollection
|
|
||||||
|
|
||||||
- Made the DependencyModel.IsOptional property writable
|
|
||||||
|
|
||||||
- Applied Curtis Schlak's patch fixing IOC-27
|
|
||||||
"assembly resource format only works for resources where the assemblies name and default namespace are the same."
|
|
||||||
|
|
||||||
Quoting:
|
|
||||||
|
|
||||||
"I chose to preserve backwards compatibility by implementing the code in the
|
|
||||||
reverse order as suggested by the reporter. Given the following URI for a resource:
|
|
||||||
|
|
||||||
assembly://my.cool.assembly/context/moo/file.xml
|
|
||||||
|
|
||||||
It will initially look for an embedded resource with the manifest name of
|
|
||||||
"my.cool.assembly.context.moo.file.xml" in the loaded assembly my.cool.assembly.dll.
|
|
||||||
If it does not find it, then it looks for the embedded resource with the manifest name
|
|
||||||
of "context.moo.file.xml".
|
|
||||||
|
|
||||||
- IServiceEnabledComponent Introduced to be used across the project as
|
|
||||||
a standard way to have access to common services, for example, logger factories
|
|
||||||
|
|
||||||
- Added missing log factories
|
|
||||||
|
|
||||||
- Refactor StreamLogger and DiagnosticLogger to be more consistent behavior-wise
|
|
||||||
|
|
||||||
- Refactored WebLogger to extend LevelFilteredLogger (removed duplication)
|
|
||||||
|
|
||||||
- Refactored LoggerLevel order
|
|
||||||
|
|
||||||
- Project started
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
Copyright 2004-2013 Castle Project - http://www.castleproject.org/
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
|||||||
Thanks for downloading this Castle package.
|
|
||||||
You can find full list of changes in changes.txt
|
|
||||||
|
|
||||||
Documentation (work in progress, contributions appreciated):
|
|
||||||
Dictionary Adapter - http://docs.castleproject.org/Tools.Castle-DictionaryAdapter.ashx
|
|
||||||
DynamicProxy - http://docs.castleproject.org/Tools.DynamicProxy.ashx
|
|
||||||
Discusssion group: - http://groups.google.com/group/castle-project-users
|
|
||||||
StackOverflow tags: - castle-dynamicproxy, castle-dictionaryadapter, castle
|
|
||||||
|
|
||||||
Issue tracker: - http://issues.castleproject.org/dashboard
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,93 +0,0 @@
|
|||||||
param($installPath, $toolsPath, $package, $project)
|
|
||||||
|
|
||||||
# open json.net splash page on package install
|
|
||||||
# don't open if json.net is installed as a dependency
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$url = "http://james.newtonking.com/json"
|
|
||||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
|
||||||
|
|
||||||
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
|
||||||
{
|
|
||||||
# user is installing from VS NuGet console
|
|
||||||
# get reference to the window, the console host and the input history
|
|
||||||
# show webpage if "install-package newtonsoft.json" was last input
|
|
||||||
|
|
||||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
|
||||||
|
|
||||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
|
||||||
[System.Reflection.BindingFlags]::NonPublic)
|
|
||||||
|
|
||||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
|
||||||
if ($prop -eq $null) { return }
|
|
||||||
|
|
||||||
$hostInfo = $prop.GetValue($consoleWindow)
|
|
||||||
if ($hostInfo -eq $null) { return }
|
|
||||||
|
|
||||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
|
||||||
|
|
||||||
$lastCommand = $history | select -last 1
|
|
||||||
|
|
||||||
if ($lastCommand)
|
|
||||||
{
|
|
||||||
$lastCommand = $lastCommand.Trim().ToLower()
|
|
||||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
|
||||||
{
|
|
||||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
# user is installing from VS NuGet dialog
|
|
||||||
# get reference to the window, then smart output console provider
|
|
||||||
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
|
||||||
|
|
||||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
|
||||||
[System.Reflection.BindingFlags]::NonPublic)
|
|
||||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
|
||||||
[System.Reflection.BindingFlags]::NonPublic)
|
|
||||||
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
|
||||||
|
|
||||||
$instance = $instanceField.GetValue($null)
|
|
||||||
if ($instance -eq $null) { return }
|
|
||||||
|
|
||||||
$consoleProvider = $consoleField.GetValue($instance)
|
|
||||||
if ($consoleProvider -eq $null) { return }
|
|
||||||
|
|
||||||
$console = $consoleProvider.CreateOutputConsole($false)
|
|
||||||
|
|
||||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
|
||||||
[System.Reflection.BindingFlags]::NonPublic)
|
|
||||||
if ($messagesField -eq $null) { return }
|
|
||||||
|
|
||||||
$messages = $messagesField.GetValue($console)
|
|
||||||
if ($messages -eq $null) { return }
|
|
||||||
|
|
||||||
$operations = $messages -split "=============================="
|
|
||||||
|
|
||||||
$lastOperation = $operations | select -last 1
|
|
||||||
|
|
||||||
if ($lastOperation)
|
|
||||||
{
|
|
||||||
$lastOperation = $lastOperation.ToLower()
|
|
||||||
|
|
||||||
$lines = $lastOperation -split "`r`n"
|
|
||||||
|
|
||||||
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
|
||||||
|
|
||||||
if ($installMatch)
|
|
||||||
{
|
|
||||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
# stop potential errors from bubbling up
|
|
||||||
# worst case the splash page won't open
|
|
||||||
}
|
|
||||||
|
|
||||||
# yolo
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<runtime>
|
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<runtime>
|
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
|
||||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user