Skip to content

Commit 66b27f9

Browse files
Merge pull request #10946 from microsoft/wangmi/remove-unused-app-id
remove dependency on app: Azure Toolkit for Eclipse and IntelliJ
2 parents 14e9bdd + 5bdf410 commit 66b27f9

File tree

8 files changed

+9
-145
lines changed

8 files changed

+9
-145
lines changed

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/resources/settings.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

PluginsAndFeatures/azure-toolkit-for-eclipse/com.microsoft.azuretools.core/src/com/microsoft/azuretools/core/Activator.java

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
import com.microsoft.azuretools.core.utils.PluginUtil;
6969
import com.microsoft.tooling.msservices.components.DefaultLoader;
7070
import com.microsoft.tooling.msservices.components.PluginComponent;
71-
import com.microsoft.tooling.msservices.components.PluginSettings;
7271

7372
/**
7473
* The activator class controls the plug-in life cycle
@@ -94,7 +93,6 @@ public class Activator extends AbstractUIPlugin implements PluginComponent {
9493
// save temporary value of telemetry preference in case of preference page navigation
9594
public static String prefState = "";
9695

97-
private PluginSettings settings;
9896
public static final String CONSOLE_NAME = Messages.consoleName;
9997

10098
private static final EventListenerList DEPLOYMENT_EVENT_LISTENERS = new EventListenerList();
@@ -133,13 +131,6 @@ public void start(BundleContext context) throws Exception {
133131
AzureConfigInitializer.initialize(InstallationIdUtils.getHashMac(), "Azure Toolkit for Eclipse", Activator.getDefault().getBundle().getVersion().toString());
134132
initAzureToolsCoreLibsSettings();
135133
EclipseAzureActionManager.register();
136-
137-
// load up the plugin settings
138-
try {
139-
loadPluginSettings();
140-
} catch (IOException e) {
141-
showException("Azure Core Plugin", "An error occurred while attempting to load settings for the Azure Core plugin.", e);
142-
}
143134
findObsoletePackages(context);
144135

145136
super.start(context);
@@ -266,32 +257,6 @@ public static ImageDescriptor getImageDescriptor(String path) {
266257
return imageDescriptorFromPlugin(PLUGIN_ID, path);
267258
}
268259

269-
private void loadPluginSettings() throws IOException {
270-
BufferedReader reader = null;
271-
try {
272-
reader = new BufferedReader(new FileReader(getResourceAsFile("/resources/settings.json")));
273-
// reader = new BufferedReader(
274-
// new InputStreamReader(
275-
// MSOpenTechToolsApplication.class.getResourceAsStream("/resources/settings.json")));
276-
StringBuilder sb = new StringBuilder();
277-
String line;
278-
279-
while ((line = reader.readLine()) != null) {
280-
sb.append(line);
281-
}
282-
283-
Gson gson = new Gson();
284-
settings = gson.fromJson(sb.toString(), PluginSettings.class);
285-
} finally {
286-
if (reader != null) {
287-
try {
288-
reader.close();
289-
} catch (IOException ignored) {
290-
}
291-
}
292-
}
293-
}
294-
295260
public static File getResourceAsFile(String fileEntry) {
296261
File file = null;
297262
try {
@@ -328,13 +293,13 @@ public static void setPrefState(String prefState) {
328293
}
329294

330295
@Override
331-
public PluginSettings getSettings() {
332-
return settings;
296+
public String getPluginId() {
297+
return PLUGIN_ID;
333298
}
334299

335300
@Override
336-
public String getPluginId() {
337-
return PLUGIN_ID;
301+
public String getPluginVersion() {
302+
return "0.1.145";
338303
}
339304

340305
public static void removeUnNecessaryListener() {

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-hdinsight-base/src/main/java/com/microsoft/intellij/AzureActionsListener.java

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import com.microsoft.azure.toolkit.intellij.common.CommonConst;
1414
import com.microsoft.azure.toolkit.lib.Azure;
1515
import com.microsoft.azure.toolkit.lib.common.messager.ExceptionNotification;
16-
import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation;
1716
import com.microsoft.azuretools.authmanage.CommonSettings;
1817
import com.microsoft.azuretools.azurecommons.util.FileUtil;
1918
import com.microsoft.azuretools.core.mvp.ui.base.AppSchedulerProvider;
@@ -25,18 +24,14 @@
2524
import com.microsoft.intellij.helpers.MvpUIHelperImpl;
2625
import com.microsoft.intellij.helpers.UIHelperImpl;
2726
import com.microsoft.intellij.secure.IdeaTrustStrategy;
28-
import com.microsoft.intellij.util.PluginUtil;
2927
import com.microsoft.tooling.msservices.components.DefaultLoader;
3028
import com.microsoft.tooling.msservices.components.PluginComponent;
31-
import com.microsoft.tooling.msservices.components.PluginSettings;
3229
import lombok.extern.slf4j.Slf4j;
3330
import org.apache.http.ssl.TrustStrategy;
3431
import rx.internal.util.PlatformDependent;
3532

3633
import javax.annotation.Nonnull;
37-
import java.io.BufferedReader;
3834
import java.io.IOException;
39-
import java.io.InputStreamReader;
4035
import java.util.List;
4136
import java.util.logging.FileHandler;
4237

@@ -47,8 +42,6 @@ public class AzureActionsListener implements AppLifecycleListener, PluginCompone
4742
private static final String AZURE_TOOLS_FOLDER_DEPRECATED = "AzureToolsForIntelliJ";
4843
private static final FileHandler logFileHandler = null;
4944

50-
private PluginSettings settings;
51-
5245
@Override
5346
@ExceptionNotification
5447
public void appFrameCreated(@Nonnull List<String> commandLineArgs) {
@@ -60,12 +53,6 @@ public void appFrameCreated(@Nonnull List<String> commandLineArgs) {
6053
SchedulerProviderFactory.getInstance().init(new AppSchedulerProvider());
6154
MvpUIHelperFactory.getInstance().init(new MvpUIHelperImpl());
6255
HDInsightLoader.setHHDInsightHelper(new HDInsightHelperImpl());
63-
try {
64-
loadPluginSettings();
65-
} catch (final IOException e) {
66-
PluginUtil.displayErrorDialogAndLog("Error", "An error occurred while attempting to load settings", e);
67-
}
68-
6956
ServiceManager.setServiceProvider(TrustStrategy.class, IdeaTrustStrategy.INSTANCE);
7057
CommonSettings.setUserAgent(Azure.az().config().getUserAgent());
7158
initAuthManage();
@@ -94,28 +81,13 @@ private void initAuthManage() {
9481
}
9582
}
9683

97-
@Override
98-
public PluginSettings getSettings() {
99-
return settings;
100-
}
101-
10284
@Override
10385
public String getPluginId() {
10486
return PLUGIN_ID;
10587
}
10688

107-
private void loadPluginSettings() throws IOException {
108-
try (final BufferedReader reader = new BufferedReader(new InputStreamReader(
109-
AzureActionsListener.class.getResourceAsStream("/settings.json")))) {
110-
final StringBuilder sb = new StringBuilder();
111-
String line;
112-
113-
while ((line = reader.readLine()) != null) {
114-
sb.append(line);
115-
}
116-
117-
final Gson gson = new Gson();
118-
settings = gson.fromJson(sb.toString(), PluginSettings.class);
119-
}
89+
@Override
90+
public String getPluginVersion() {
91+
return "0.1.1";
12092
}
12193
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-hdinsight-base/src/main/resources/settings.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

Utils/azure-toolkit-ide-hdinsight-libs/azure-explorer-common/src/com/microsoft/tooling/msservices/components/PluginComponent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package com.microsoft.tooling.msservices.components;
77

88
public interface PluginComponent {
9-
public PluginSettings getSettings();
10-
119
public String getPluginId();
10+
public String getPluginVersion();
1211
}

Utils/azure-toolkit-ide-hdinsight-libs/azure-explorer-common/src/com/microsoft/tooling/msservices/components/PluginSettings.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

Utils/azure-toolkit-ide-hdinsight-libs/azure-explorer-common/src/com/microsoft/tooling/msservices/helpers/azure/rest/RestServiceManagerBaseImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected static HttpResponse getResponse(@NotNull final String method,
136136

137137
@NotNull
138138
private static String getPlatformUserAgent() {
139-
String version = DefaultLoader.getPluginComponent().getSettings().getPluginVersion();
139+
String version = DefaultLoader.getPluginComponent().getPluginVersion();
140140
return String.format(
141141
"%s/%s (lang=%s; os=%s; version=%s)",
142142
DefaultLoader.getPluginComponent().getPluginId(),

Utils/azure-toolkit-ide-hdinsight-libs/azuretools-core/src/com/microsoft/azuretools/Constants.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
public class Constants {
99
public static String resourceVault = "https://vault.azure.net";
10-
11-
public static String tenant = "72f988bf-86f1-41af-91ab-2d7cd011db47";
12-
public static String clientId = "61d65f5a-6e3b-468b-af73-a033f5098c5c";
1310
public static String redirectUri = "https://msopentech.com/";
1411
public static int connection_read_timeout_ms = 10000;
1512

0 commit comments

Comments
 (0)