extend Plugin host api to supply a version

This commit is contained in:
Michael Starke
2018-10-04 19:15:20 +02:00
parent 6b00ca71de
commit 72dabf0338
2 changed files with 6 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ FOUNDATION_EXPORT NSString *const MPPluginHostPluginBundleIdentifiyerKey;
/* List of all plugins known to the plugin manager. Disabled plugins are also present! */
@property (readonly, copy) NSArray <MPPlugin __kindof*> *plugins;
@property (nonatomic, readonly) BOOL loadUnsecurePlugins;
@property (readonly, copy) NSString *version;
+ (instancetype)sharedHost;

View File

@@ -93,6 +93,11 @@ NSString *const MPPluginHostPluginBundleIdentifiyerKey = @"MPPluginHostPluginBun
return self;
}
- (NSString *)version {
NSString *version = NSBundle.mainBundle.infoDictionary[(NSString *)kCFBundleVersionKey];
return version;
}
- (NSArray<MPPlugin *> *)plugins {
return [self.mutablePlugins copy];
}