Skip to content

Commit eefe2b9

Browse files
committed
Merge remote-tracking branch 'origin/dev' into explorer_plugin
2 parents d3ea0e0 + 06d6399 commit eefe2b9

File tree

45 files changed

+158
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+158
-170
lines changed

Doc/app.ico

-31.1 KB
Binary file not shown.

Doc/app.png

-5.91 KB
Loading

Doc/app.psd

-77.5 KB
Binary file not shown.

Doc/app_error.png

-9.06 KB
Loading

Doc/app_error.psd

-77.5 KB
Binary file not shown.

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@
5757
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
5858
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
5959
<PackageReference Include="squirrel.windows" Version="1.5.2" />
60-
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
61-
<PrivateAssets>all</PrivateAssets>
62-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
63-
</PackageReference>
60+
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
6461
<PackageReference Include="SharpZipLib" Version="1.2.0" />
6562
<PackageReference Include="System.Runtime" Version="4.3.1" />
6663
</ItemGroup>

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
55
using System.Reflection;
66
using System.Runtime.Loader;
7+
using System.Threading.Tasks;
8+
using System.Windows.Forms;
79
using Flow.Launcher.Infrastructure;
8-
using Flow.Launcher.Infrastructure.Exception;
910
using Flow.Launcher.Infrastructure.Logger;
1011
using Flow.Launcher.Infrastructure.UserSettings;
1112
using Flow.Launcher.Plugin;
@@ -29,6 +30,8 @@ public static List<PluginPair> Plugins(List<PluginMetadata> metadatas, PluginsSe
2930

3031
public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
3132
{
33+
var erroredPlugins = new List<string>();
34+
3235
var plugins = new List<PluginPair>();
3336
var metadatas = source.Where(o => AllowedLanguage.IsDotNet(o.Language));
3437

@@ -50,28 +53,44 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
5053
}
5154
catch (Exception e)
5255
{
53-
Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for {metadata.Name}", e);
56+
erroredPlugins.Add(metadata.Name);
57+
58+
Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for the plugin: {metadata.Name}", e);
5459
return;
5560
}
56-
var types = assembly.GetTypes();
61+
5762
Type type;
5863
try
5964
{
65+
var types = assembly.GetTypes();
66+
6067
type = types.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IPlugin)));
6168
}
6269
catch (InvalidOperationException e)
6370
{
64-
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{metadata.Name}>", e);
71+
erroredPlugins.Add(metadata.Name);
72+
73+
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find the required IPlugin interface for the plugin: <{metadata.Name}>", e);
74+
return;
75+
}
76+
catch (ReflectionTypeLoadException e)
77+
{
78+
erroredPlugins.Add(metadata.Name);
79+
80+
Log.Exception($"|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for the plugin: <{metadata.Name}>", e);
6581
return;
6682
}
83+
6784
IPlugin plugin;
6885
try
6986
{
7087
plugin = (IPlugin)Activator.CreateInstance(type);
7188
}
7289
catch (Exception e)
7390
{
74-
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't create instance for <{metadata.Name}>", e);
91+
erroredPlugins.Add(metadata.Name);
92+
93+
Log.Exception($"|PluginsLoader.DotNetPlugins|The following plugin has errored and can not be loaded: <{metadata.Name}>", e);
7594
return;
7695
}
7796
#endif
@@ -85,6 +104,26 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
85104
metadata.InitTime += milliseconds;
86105

87106
}
107+
108+
if (erroredPlugins.Count > 0)
109+
{
110+
var errorPluginString = "";
111+
112+
var errorMessage = "The following "
113+
+ (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ")
114+
+ "errored and cannot be loaded:";
115+
116+
erroredPlugins.ForEach(x => errorPluginString += x + Environment.NewLine);
117+
118+
Task.Run(() =>
119+
{
120+
MessageBox.Show($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
121+
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
122+
$"Please refer to the logs for more information","",
123+
MessageBoxButtons.OK, MessageBoxIcon.Warning);
124+
});
125+
}
126+
88127
return plugins;
89128
}
90129

-9.06 KB
Loading

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -12,7 +12,26 @@
1212
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
1313
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1414
</PropertyGroup>
15-
15+
16+
<PropertyGroup>
17+
<Version>1.0.0</Version>
18+
<PackageVersion>1.0.0-beta3</PackageVersion>
19+
<AssemblyVersion>1.0.0</AssemblyVersion>
20+
<FileVersion>1.0.0</FileVersion>
21+
<PackageId>Flow.Launcher.Plugin</PackageId>
22+
<Authors>Flow-Launcher</Authors>
23+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
24+
<RepositoryUrl>https://github.com/Flow-Launcher/Flow.Launcher</RepositoryUrl>
25+
<PackageDescription>Reference this library if you want to develop a Flow Launcher plugin</PackageDescription>
26+
<PackageTags>flowlauncher</PackageTags>
27+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
28+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
29+
</PropertyGroup>
30+
31+
<PropertyGroup Condition="'$(APPVEYOR)' == 'True'">
32+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
33+
</PropertyGroup>
34+
1635
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1736
<DebugSymbols>true</DebugSymbols>
1837
<DebugType>full</DebugType>
@@ -26,7 +45,7 @@
2645
</PropertyGroup>
2746

2847
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29-
<DebugType>pdbonly</DebugType>
48+
<DebugType>embedded</DebugType>
3049
<Optimize>true</Optimize>
3150
<OutputPath>..\Output\Release\</OutputPath>
3251
<DefineConstants>TRACE</DefineConstants>
@@ -37,28 +56,15 @@
3756

3857
<ItemGroup>
3958
<None Include="README.md" />
40-
</ItemGroup>
41-
42-
<ItemGroup>
43-
<None Remove="FodyWeavers.xml" />
44-
</ItemGroup>
45-
46-
<ItemGroup>
47-
<Compile Include="..\SolutionAssemblyInfo.cs" Link="Properties\SolutionAssemblyInfo.cs" />
48-
</ItemGroup>
49-
50-
<ItemGroup>
51-
<Content Include="FodyWeavers.xml" />
59+
<None Include="FodyWeavers.xml" />
5260
</ItemGroup>
5361

5462
<ItemGroup>
63+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
5564
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
5665
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
5766
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
58-
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
59-
<PrivateAssets>all</PrivateAssets>
60-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
61-
</PackageReference>
67+
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
6268
<PackageReference Include="System.Runtime" Version="4.3.1" />
6369
</ItemGroup>
6470

Flow.Launcher.Test/Flow.Launcher.Test.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,4 @@
5757
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
5858
</ItemGroup>
5959

60-
<ItemGroup>
61-
<Folder Include="Properties\" />
62-
</ItemGroup>
63-
6460
</Project>

0 commit comments

Comments
 (0)