fix third party plugins switch
Signed-off-by: pengzhile <pengzhile@gmail.com>pull/8/head
parent
31a76de0b0
commit
0d93cde64d
|
@ -4,7 +4,7 @@ plugins {
|
|||
}
|
||||
|
||||
group 'io.zhile.research.intellij'
|
||||
version '2.1.1'
|
||||
version '2.1.2'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
@ -29,6 +29,8 @@ intellij {
|
|||
|
||||
patchPluginXml {
|
||||
changeNotes """<pre>
|
||||
Release v2.1.2
|
||||
1. fix third party plugins switch
|
||||
Release v2.1.1
|
||||
1. add ide plugin marketplace mechanism
|
||||
Release v2.1.0
|
||||
|
|
|
@ -3,6 +3,7 @@ package io.zhile.research.intellij.ier.helper;
|
|||
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
public class CustomRepository {
|
||||
|
@ -15,5 +16,14 @@ public class CustomRepository {
|
|||
}
|
||||
|
||||
hosts.add(host);
|
||||
|
||||
Method method = Reflection.getMethod(UpdateSettings.class, "setThirdPartyPluginsAllowed", boolean.class);
|
||||
if (method != null) {
|
||||
try {
|
||||
method.invoke(UpdateSettings.getInstance(), true);
|
||||
} catch (Exception e) {
|
||||
NotificationHelper.showError(null, "Enable third party plugins failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue