Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Splat External Dependency #1578

Merged
merged 2 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Setup/FxHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static const int fx472ReleaseVersion = 461808; // Minimum version for .NET 4.7.2

// According to https://msdn.microsoft.com/en-us/library/8z6watww%28v=vs.110%29.aspx,
// to install .NET 4.5 we must be Vista SP2+, Windows 7 SP1+, or later.
// However Paul thinks this is just for customer support, anything >= Vista will generally work.
// However Ana�s thinks this is just for customer support, anything >= Vista will generally work.
bool CFxHelper::CanInstallDotNet4_5()
{
return IsWindowsVistaOrGreater();
Expand Down
3 changes: 1 addition & 2 deletions src/Squirrel.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<metadata>
<version>1.9.1</version>
<authors>GitHub</authors>
<owners>Paul Betts</owners>
<owners>Anaïs Betts</owners>
<licenseUrl>https://github.com/squirrel/Squirrel.Windows/blob/master/COPYING</licenseUrl>
<projectUrl>https://github.com/squirrel/Squirrel.Windows</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Squirrel/Squirrel.Windows/master/docs/artwork/Squirrel-Logo-Square.png</iconUrl>

<dependencies>
<dependency id="DeltaCompressionDotNet" version="[1.1,2.0)" />
<dependency id="Splat" version="[1.6.2,7.0)" />
<dependency id="Mono.Cecil" version="0.9.6.1" />
<dependency id="SharpCompress" version="[0.17.1]" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/Squirrel/DeltaPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Splat;
using Squirrel.SimpleSplat;
using DeltaCompressionDotNet.MsDelta;
using System.ComponentModel;
using Squirrel.Bsdiff;
Expand Down
2 changes: 1 addition & 1 deletion src/Squirrel/FileDownloader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Net;
using System.Threading.Tasks;
using Splat;
using Squirrel.SimpleSplat;

namespace Squirrel
{
Expand Down
2 changes: 1 addition & 1 deletion src/Squirrel/IUpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Win32;
using Splat;
using Squirrel.SimpleSplat;
using NuGet;

namespace Squirrel
Expand Down
2 changes: 1 addition & 1 deletion src/Squirrel/ReleaseEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Text.RegularExpressions;
using NuGet;
using Splat;
using Squirrel.SimpleSplat;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Collections.Concurrent;
Expand Down
2 changes: 1 addition & 1 deletion src/Squirrel/ReleasePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Xml;
using MarkdownSharp;
using NuGet;
using Splat;
using Squirrel.SimpleSplat;
using System.Threading.Tasks;
using SharpCompress.Archives.Zip;
using SharpCompress.Readers;
Expand Down
29 changes: 29 additions & 0 deletions src/Squirrel/SimpleSplat/AssemblyFinder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Linq;
using System.Reflection;

namespace Squirrel.SimpleSplat
{
static class AssemblyFinder
{
public static T AttemptToLoadType<T>(string fullTypeName)
{
var thisType = typeof(AssemblyFinder);

var toSearch = new[] {
thisType.AssemblyQualifiedName.Replace(thisType.FullName + ", ", ""),
thisType.AssemblyQualifiedName.Replace(thisType.FullName + ", ", "").Replace(".Portable", ""),
}.Select(x => new AssemblyName(x)).ToArray();

foreach (var assembly in toSearch) {
var fullName = fullTypeName + ", " + assembly.FullName;
var type = Type.GetType(fullName, false);
if (type == null) continue;

return (T)Activator.CreateInstance(type);
}

return default(T);
}
}
}
Loading