Skip to content

Commit

Permalink
Merge pull request Squirrel#1578 from nickhodge/remove_splat_dependency
Browse files Browse the repository at this point in the history
Remove Splat External Dependency
  • Loading branch information
anaisbetts authored May 15, 2020
2 parents ecaeb93 + 745aa4e commit 2a769f4
Show file tree
Hide file tree
Showing 39 changed files with 1,415 additions and 47 deletions.
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

0 comments on commit 2a769f4

Please sign in to comment.