Skip to content

Commit ee3079e

Browse files
committed
Merge branch 'develop' into temeletry/operation
2 parents 5a47529 + f6f6c04 commit ee3079e

File tree

47 files changed

+1387
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1387
-115
lines changed

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
id 'java'
3+
id "org.jetbrains.intellij"
4+
}
5+
6+
group 'com.microsoft.azuretools'
7+
8+
intellij {
9+
version = intellij_version
10+
downloadSources = Boolean.valueOf(true)
11+
}
12+
13+
repositories {
14+
mavenLocal()
15+
mavenCentral()
16+
}
17+
18+
dependencies {
19+
// https://mvnrepository.com/artifact/org.projectlombok/lombok
20+
compileOnly 'org.projectlombok:lombok:1.18.8'
21+
annotationProcessor 'org.projectlombok:lombok:1.18.8'
22+
23+
implementation "com.microsoft.azure:azure-toolkit-common-lib:0.5.0-SNAPSHOT"
24+
}

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/AzureFormInputComponent.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/AzureFormInputComponent.java

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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;
7+
8+
import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException;
9+
import com.microsoft.azure.toolkit.lib.common.form.AzureForm;
10+
import com.microsoft.azure.toolkit.lib.common.form.AzureFormInput;
11+
12+
import java.util.Collections;
13+
import java.util.List;
14+
15+
public interface AzureFormPanel<T> extends AzureForm<T> {
16+
default void setVisible(boolean visible) {
17+
// do nothing
18+
}
19+
20+
@Override
21+
default T getData() {
22+
throw new AzureToolkitRuntimeException("method not implemeted");
23+
}
24+
25+
@Override
26+
default List<AzureFormInput<?>> getInputs() {
27+
return Collections.emptyList();
28+
}
29+
30+
// CHECKSTYLE IGNORE check FOR NEXT 1 LINES
31+
default void $$$setupUI$$$() {
32+
}
33+
}

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/SwingUtils.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/SwingUtils.java

File renamed without changes.

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/common/TextDocumentListenerAdapter.java renamed to PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/TextDocumentListenerAdapter.java

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<idea-plugin>
2+
<extensionPoints>
3+
</extensionPoints>
4+
<extensions defaultExtensionNs="com.intellij">
5+
</extensions>
6+
<actions>
7+
</actions>
8+
</idea-plugin>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugins {
2+
id 'java'
3+
id "org.jetbrains.intellij"
4+
}
5+
6+
group 'com.microsoft.azuretools'
7+
8+
intellij {
9+
version = intellij_version
10+
downloadSources = Boolean.valueOf(true)
11+
plugins = ['java', 'maven', 'gradle']
12+
}
13+
14+
repositories {
15+
mavenLocal()
16+
mavenCentral()
17+
}
18+
19+
dependencies {
20+
// https://mvnrepository.com/artifact/org.projectlombok/lombok
21+
compileOnly 'org.projectlombok:lombok:1.18.8'
22+
annotationProcessor 'org.projectlombok:lombok:1.18.8'
23+
24+
compileOnly 'org.jetbrains:annotations:20.1.0'
25+
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2', {
26+
exclude group: "com.fasterxml.jackson", module: "jackson-bom"
27+
}
28+
29+
implementation project(':azure-intellij-plugin-lib')
30+
implementation "com.microsoft.azure:azure-toolkit-common-lib:0.5.0-SNAPSHOT"
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.azuresdk.dependencesurvey.activity;
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.intellij.azuresdk.service.AzureSdkLibraryService;
12+
import org.codehaus.plexus.util.ExceptionUtils;
13+
import org.slf4j.Logger;
14+
import org.slf4j.LoggerFactory;
15+
16+
import java.io.IOException;
17+
18+
public class AzurePreloadingActivity extends PreloadingActivity {
19+
private static final Logger logger = LoggerFactory.getLogger(AzurePreloadingActivity.class);
20+
21+
@Override
22+
public void preload(@org.jetbrains.annotations.NotNull final ProgressIndicator indicator) {
23+
// Using progress manager as azure task manager is not initialized
24+
ApplicationManager.getApplication().executeOnPooledThread(() -> {
25+
try {
26+
AzureSdkLibraryService.getInstance().reloadAzureSDKArtifacts();
27+
} catch (IOException e) {
28+
logger.warn(ExceptionUtils.getStackTrace(e)); // preload exception should not block plugin
29+
}
30+
});
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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.azuresdk.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9+
import lombok.Getter;
10+
import lombok.NoArgsConstructor;
11+
import lombok.Setter;
12+
13+
import java.util.Map;
14+
import java.util.Objects;
15+
16+
@Getter
17+
@Setter
18+
@NoArgsConstructor
19+
@JsonIgnoreProperties(ignoreUnknown = true)
20+
public class AzureSdkArtifactEntity {
21+
private String artifactId;
22+
private String groupId;
23+
private String versionGA;
24+
private String versionPreview;
25+
private String type;
26+
private Map<String, String> links;
27+
private Map<String, String> dependencyPattern;
28+
29+
public String getDependencySnippet(DependencyType type, String version) {
30+
final String strType = type.getName().toLowerCase();
31+
if (Objects.nonNull(dependencyPattern) && dependencyPattern.containsKey(strType)) {
32+
return dependencyPattern.get(strType);
33+
}
34+
return getDefaultDependencySnippet(type, version);
35+
}
36+
37+
private String getDefaultDependencySnippet(final DependencyType type, final String version) {
38+
if (DependencyType.GRADLE == type) {
39+
return String.format("implementation '%s:%s:%s'", this.groupId, this.artifactId, version);
40+
}
41+
return String.join("",
42+
"<dependency>\n",
43+
" <groupId>", this.groupId, "</groupId>\n",
44+
" <artifactId>", this.artifactId, "</artifactId>\n",
45+
" <version>", version, "</version>\n",
46+
"</dependency>"
47+
);
48+
}
49+
50+
public static class Type {
51+
public static final String SPRING = "spring";
52+
public static final String CLIENT = "client";
53+
public static final String MANAGEMENT = "mgmt";
54+
}
55+
56+
@Getter
57+
public enum DependencyType {
58+
MAVEN("Maven", "xml"), GRADLE("Gradle", "gradle");
59+
60+
private final String name;
61+
private final String fileExt;
62+
63+
DependencyType(final String name, final String fileExt) {
64+
this.name = name;
65+
this.fileExt = fileExt;
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)