-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Improve Plugin Metadata & Path Management #3272
Open
Jack251970
wants to merge
31
commits into
Flow-Launcher:dev
Choose a base branch
from
Jack251970:plugin_settings_cache_path
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
89bca3b
Add plugin cache path
Jack251970 5919418
Add assembly name & plugin settings path & plugin cache path in meta …
Jack251970 f1b5e68
Remove reflection codes for deleting csharp plugin settings
Jack251970 1aaba46
Use constants & data location for code quality
Jack251970 9cd3011
Add documents for plugin metadata
Jack251970 8f7ad27
Remove useless usings
Jack251970 d07b304
Improve code quality
Jack251970 b50db58
Add assembly name & plugin settings path & plugin cache path in meta …
Jack251970 6012111
Add log directory & version log directory & themes directory in data …
Jack251970 3efe550
Use context plugin settings path
Jack251970 126153b
Improve plugin settings directory clean & Support plugin cache direct…
Jack251970 3106b02
Support plugin directory update & validate
Jack251970 012ef49
Fix log directory fetch issue
Jack251970 58de625
Do not validate plugin settings & cache path
Jack251970 47adfd1
Improve code quality
Jack251970 a0c2a42
Let Program plugin use plugin cache path
Jack251970 a29ed64
Use metadata for plugin settings directory
Jack251970 65ae342
Add documents for Flow.Launcher.Plugin
Jack251970 6622815
Fix typos
Jack251970 fe86e23
Add exception handles
Jack251970 f8d0981
Update json rpc plugin directory before loading plugins
Jack251970 7975ab5
Merge branch 'dev' into plugin_settings_cache_path
Jack251970 ce3a3e9
Fix plugin settings delete issue
Jack251970 486cc6a
Fix async task issue
Jack251970 af3b391
Fix dispose
Jack251970 c690e59
Merge branch 'dev' into plugin_settings_cache_path
Jack251970 b0b1a26
Fix build issue & Cleanup codes
Jack251970 e3af882
Merge branch 'dev' into plugin_settings_cache_path
Jack251970 c87b731
Merge branch 'dev' into plugin_settings_cache_path
Jack251970 ee0b039
Merge update plugin directory functions
Jack251970 5f976b9
Remove useless assignment
Jack251970 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
|
@@ -73,9 +74,11 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source) | |
typeof(IAsyncPlugin)); | ||
|
||
plugin = Activator.CreateInstance(type) as IAsyncPlugin; | ||
|
||
metadata.AssemblyName = assembly.GetName().Name; | ||
} | ||
#if DEBUG | ||
catch (Exception e) | ||
catch (Exception) | ||
{ | ||
throw; | ||
} | ||
Jack251970 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -111,7 +114,7 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source) | |
|
||
if (erroredPlugins.Count > 0) | ||
{ | ||
var errorPluginString = String.Join(Environment.NewLine, erroredPlugins); | ||
var errorPluginString = string.Join(Environment.NewLine, erroredPlugins); | ||
|
||
var errorMessage = "The following " | ||
+ (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ") | ||
|
@@ -133,19 +136,35 @@ public static IEnumerable<PluginPair> ExecutablePlugins(IEnumerable<PluginMetada | |
{ | ||
return source | ||
.Where(o => o.Language.Equals(AllowedLanguage.Executable, StringComparison.OrdinalIgnoreCase)) | ||
.Select(metadata => new PluginPair | ||
.Select(metadata => | ||
{ | ||
Plugin = new ExecutablePlugin(metadata.ExecuteFilePath), Metadata = metadata | ||
var plugin = new PluginPair | ||
{ | ||
Plugin = new ExecutablePlugin(metadata.ExecuteFilePath), | ||
Metadata = metadata | ||
}; | ||
|
||
plugin.Metadata.AssemblyName = string.Empty; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need to manually set this? isn't the default is either empty or null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we can remove that |
||
|
||
return plugin; | ||
}); | ||
} | ||
|
||
public static IEnumerable<PluginPair> ExecutableV2Plugins(IEnumerable<PluginMetadata> source) | ||
{ | ||
return source | ||
.Where(o => o.Language.Equals(AllowedLanguage.ExecutableV2, StringComparison.OrdinalIgnoreCase)) | ||
.Select(metadata => new PluginPair | ||
.Select(metadata => | ||
{ | ||
Plugin = new ExecutablePluginV2(metadata.ExecuteFilePath), Metadata = metadata | ||
var plugin = new PluginPair | ||
{ | ||
Plugin = new ExecutablePlugin(metadata.ExecuteFilePath), | ||
Metadata = metadata | ||
}; | ||
|
||
plugin.Metadata.AssemblyName = string.Empty; | ||
|
||
return plugin; | ||
}); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code quality improvement