Skip to content

Commit 6c01501

Browse files
committed
Merge branch 'develop' into temeletry/operation
2 parents ee3079e + ab9b963 commit 6c01501

File tree

34 files changed

+302
-260
lines changed

34 files changed

+302
-260
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*/
5+
6+
package com.microsoft.azure.toolkit.intellij.common.preload;
7+
8+
import com.intellij.openapi.application.ApplicationManager;
9+
import com.intellij.openapi.application.PreloadingActivity;
10+
import com.intellij.openapi.progress.ProgressIndicator;
11+
import com.microsoft.azure.toolkit.lib.common.cache.Preloader;
12+
import lombok.extern.java.Log;
13+
14+
@Log
15+
public class AzurePreloadingActivity extends PreloadingActivity {
16+
17+
@Override
18+
public void preload(@org.jetbrains.annotations.NotNull final ProgressIndicator indicator) {
19+
// Using progress manager as azure task manager is not initialized
20+
ApplicationManager.getApplication().executeOnPooledThread(Preloader::load);
21+
}
22+
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/resources/META-INF/azure-intellij-plugin-lib.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<extensionPoints>
33
</extensionPoints>
44
<extensions defaultExtensionNs="com.intellij">
5+
<preloadingActivity implementation="com.microsoft.azure.toolkit.intellij.common.preload.AzurePreloadingActivity"/>
56
</extensions>
67
<actions>
78
</actions>

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java'
33
id "org.jetbrains.intellij"
4+
id "io.freefair.aspectj.post-compile-weaving"
45
}
56

67
group 'com.microsoft.azuretools'
@@ -26,6 +27,8 @@ dependencies {
2627
exclude group: "com.fasterxml.jackson", module: "jackson-bom"
2728
}
2829

29-
implementation project(':azure-intellij-plugin-lib')
30-
implementation "com.microsoft.azure:azure-toolkit-common-lib:0.5.0-SNAPSHOT"
30+
compile project(':azure-intellij-plugin-lib')
31+
compile "com.microsoft.azure:azure-toolkit-common-lib:0.5.0-SNAPSHOT"
32+
33+
aspect "com.microsoft.azure:azure-toolkit-common-lib:0.5.0-SNAPSHOT"
3134
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/dependencesurvey/activity/AzurePreloadingActivity.java

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

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkTreePanel.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ private void filter(final String text) {
9595
this.loadData(this.services, filters);
9696
}
9797

98-
public void refresh() {
99-
final AzureSdkLibraryService service = AzureSdkLibraryService.getInstance();
98+
public void refresh(boolean... force) {
10099
try {
101-
service.reloadAzureSDKArtifacts();
102-
this.services = service.getServices();
100+
this.services = AzureSdkLibraryService.loadAzureSdkServices(force);
103101
this.filter.debounce();
104102
Optional.ofNullable(this.lastNodePath).ifPresent(p -> TreeUtil.selectPath(this.tree, p));
105103
} catch (final IOException e) {
@@ -176,7 +174,7 @@ public final void actionPerformed(@NotNull final AnActionEvent e) {
176174
this.loading = true;
177175
ActivityTracker.getInstance().inc();
178176
AzureTaskManager.getInstance().runLater(() -> {
179-
AzureSdkTreePanel.this.refresh();
177+
AzureSdkTreePanel.this.refresh(true);
180178
this.loading = false;
181179
});
182180
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/service/AzureSdkLibraryService.java

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,23 @@
1111
import com.fasterxml.jackson.databind.ObjectReader;
1212
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
1313
import com.microsoft.azure.toolkit.intellij.azuresdk.model.AzureSdkServiceEntity;
14+
import com.microsoft.azure.toolkit.lib.common.cache.Cacheable;
15+
import com.microsoft.azure.toolkit.lib.common.cache.Preload;
1416

1517
import java.io.IOException;
1618
import java.net.URL;
17-
import java.util.ArrayList;
18-
import java.util.Collections;
1919
import java.util.List;
2020

2121
public class AzureSdkLibraryService {
2222
private static final ObjectMapper mapper = new YAMLMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
2323
private static final String SDK_METADATA_URL = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/spring/spring-reference.yml";
24-
private List<AzureSdkServiceEntity> services = new ArrayList<>();
2524

26-
public static AzureSdkLibraryService getInstance() {
27-
return Holder.instance;
28-
}
29-
30-
public List<AzureSdkServiceEntity> getServices() {
31-
return Collections.unmodifiableList(services);
32-
}
33-
34-
public void reloadAzureSDKArtifacts() throws IOException {
25+
@Preload
26+
@Cacheable(value = "sdk-services", condition = "!(force&&force[0])")
27+
public static List<AzureSdkServiceEntity> loadAzureSdkServices(boolean... force) throws IOException {
3528
final URL destination = new URL(SDK_METADATA_URL);
3629
final ObjectReader reader = mapper.readerFor(AzureSdkServiceEntity.class);
3730
final MappingIterator<AzureSdkServiceEntity> data = reader.readValues(destination);
38-
synchronized (this) {
39-
this.services = data.readAll();
40-
}
41-
}
42-
43-
private static class Holder {
44-
private static final AzureSdkLibraryService instance = new AzureSdkLibraryService();
31+
return data.readAll();
4532
}
4633
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/resources/META-INF/azure-sdk-reference-book.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<idea-plugin>
22
<extensionPoints>
33
</extensionPoints>
4-
<extensions defaultExtensionNs="com.intellij">
5-
<preloadingActivity implementation="com.microsoft.azure.toolkit.intellij.azuresdk.dependencesurvey.activity.AzurePreloadingActivity"/>
6-
</extensions>
74
<actions>
85
<action id="AzureToolkit.OpenSdkReferenceBook"
96
class="com.microsoft.azure.toolkit.intellij.azuresdk.referencebook.OpenReferenceBookAction"

PluginsAndFeatures/azure-toolkit-for-intellij/build.gradle

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
plugins {
2-
id "org.jetbrains.intellij" version "0.4.21"
3-
id "org.jetbrains.kotlin.jvm" version "1.3.41"
2+
id "org.jetbrains.intellij" version "0.5.0"
3+
id "org.jetbrains.kotlin.jvm" version "1.3.72"
44
id "de.undercouch.download" version "4.0.4"
55
id "com.github.ben-manes.versions" version "0.28.0"
6+
id 'org.openjfx.javafxplugin' version '0.0.9'
67
id "io.freefair.aspectj.post-compile-weaving" version "5.3.0"
78
id "com.github.spotbugs" version "4.6.0"
89
}
@@ -43,6 +44,11 @@ compileTestKotlin {
4344
kotlinOptions.jvmTarget = javaVersion
4445
}
4546

47+
javafx {
48+
version = '11'
49+
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing']
50+
}
51+
4652
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
4753

4854
//apply plugin: 'checkstyle'
@@ -57,8 +63,8 @@ intellij {
5763
pluginName = 'azure-toolkit-for-intellij'
5864
version = intellij_version
5965
updateSinceUntilBuild = Boolean.valueOf(updateVersionRange)
60-
plugins = ['java', 'maven', 'gradle', dep_plugins, "properties", 'markdown', 'terminal']
61-
downloadSources = Boolean.valueOf(true)
66+
plugins = ['java', 'maven', 'maven-model', 'gradle', dep_plugins, "properties", 'markdown', 'terminal']
67+
downloadSources = Boolean.valueOf(sources)
6268
}
6369

6470
sourceSets {
@@ -98,8 +104,8 @@ configurations {
98104
apply plugin: 'java'
99105

100106
dependencies {
101-
implementation project(':azure-intellij-plugin-lib')
102-
implementation project(':azure-sdk-reference-book')
107+
compile project(':azure-intellij-plugin-lib')
108+
compile project(':azure-sdk-reference-book')
103109
compile 'com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8'
104110
compile 'commons-io:commons-io:2.7'
105111
compile group: 'org.apache.commons', name: 'commons-text', version: '1.8'
@@ -136,6 +142,8 @@ dependencies {
136142
compile group: 'jaxen', name: 'jaxen', version: '1.2.0'
137143
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
138144

145+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72")
146+
139147
// https://mvnrepository.com/artifact/org.projectlombok/lombok
140148
compileOnly 'org.projectlombok:lombok:1.18.8'
141149
annotationProcessor 'org.projectlombok:lombok:1.18.8'
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
javaVersion=1.8
1+
javaVersion=11
22
org.gradle.jvmargs='-Duser.language=en'
33
sources=false
4-
intellij_version=IC-2020.2
5-
dep_plugins=org.intellij.scala:2020.2.14
4+
intellij_version=IC-LATEST-EAP-SNAPSHOT
5+
dep_plugins=org.intellij.scala:2020.3.8
66
applicationinsights.key=57cc111a-36a8-44b3-b044-25d293b8b77c
77
updateVersionRange=true
8-
patchPluginXmlSinceBuild=202.6397.94
8+
patchPluginXmlSinceBuild=203.5419.21

0 commit comments

Comments
 (0)