Skip to content

Commit

Permalink
support IntelliJ IDEA 2024.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nanguoqiang committed Jul 25, 2024
1 parent 14296f9 commit 8121453
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 23 deletions.
46 changes: 28 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.21'
id 'org.jetbrains.intellij' version '1.10.1'
}
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'

group 'com.yujunyang'
version '0.2.3'
version '0.2.4'

sourceCompatibility = 1.8

Expand All @@ -17,33 +17,43 @@ repositories {
}

dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.2'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.11.2'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.11.2'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.9'
implementation group: 'com.squareup.retrofit2', name: 'retrofit', version: '2.9.0'
implementation group: 'com.squareup.retrofit2', name: 'converter-jackson', version: '2.9.0'
implementation group: 'com.squareup.retrofit2', name: 'converter-scalars', version: '2.9.0'
implementation group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.14.9'
implementation group: 'org.sonarsource.scanner.api', name: 'sonar-scanner-api', version: '2.16.1.361'
implementation group: 'org.sonarsource.sonarqube', name: 'sonar-scanner-protocol', version: '7.9.6'
implementation 'com.fasterxml.jackson.core:jackson-core:2.11.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.2'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.2'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.2'
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.9'
implementation 'org.sonarsource.scanner.api:sonar-scanner-api:2.16.1.361'
implementation 'org.sonarsource.sonarqube:sonar-scanner-protocol:7.9.6'
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2019.3.1'
version.set('2022.3')
// version '2021.3.1'

pluginName 'sonar-intellij-plugin'
pluginName.set('sonar-intellij-plugin')

plugins = ['java', 'Git4Idea']
plugins.set(['java', 'Git4Idea'])

updateSinceUntilBuild = false
updateSinceUntilBuild.set(false)
}
patchPluginXml {
// sinceBuild '191'
// untilBuild '213.*'

}
tasks {

verifyPluginConfiguration {
enabled = false
}

buildSearchableOptions {
enabled = false
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Wed Aug 26 12:51:46 CST 2020
distributionUrl=file:///C:/gradle/gradle-6.5.1-all.zip
distributionUrl=file:///Users/nanusl/develop/gradle-7.2-all.zip
#distributionUrl=file:///Users/yujunyang/sources/gradle/gradle-6.5.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.yujunyang.intellij.plugin.sonar.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -92,4 +93,9 @@ public abstract void actionPerformedImpl(
@NotNull final ToolWindow toolWindow,
@NotNull final AnalyzeState state
);

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.yujunyang.intellij.plugin.sonar.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
Expand Down Expand Up @@ -49,6 +50,11 @@ public final void actionPerformedImpl(
);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

public abstract void analyze(
@NotNull final AnActionEvent e,
@NotNull final Project project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.yujunyang.intellij.plugin.sonar.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.compiler.CompileScope;
import com.intellij.openapi.compiler.CompilerManager;
Expand Down Expand Up @@ -75,4 +76,9 @@ protected AnalyzeScope createAnalyzeScope() {
}
}.start();
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.yujunyang.intellij.plugin.sonar.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.Project;
Expand All @@ -47,4 +48,9 @@ public void update(@NotNull AnActionEvent e) {
super.update(e);
e.getPresentation().setText(ResourcesLoader.getString("action.autoScrollToSource"));
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javax.swing.event.HyperlinkEvent;

import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.yujunyang.intellij.plugin.sonar.common.IdeaUtils;
Expand Down Expand Up @@ -51,6 +52,11 @@ public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(ResourcesLoader.getString("action.help"));
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

private StringBuilder createHelpInfo() {
final StringBuilder ret = new StringBuilder();
ret.append("<h2>").append(PluginConstants.PLUGIN_NAME + " " + IdeaUtils.getPluginVersion()).append("</h2>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.yujunyang.intellij.plugin.sonar.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.yujunyang.intellij.plugin.sonar.common.SettingsUtils;
Expand All @@ -37,4 +38,9 @@ public void actionPerformed(@NotNull AnActionEvent e) {
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(ResourcesLoader.getString("action.settings"));
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class ToolWindowFactoryImpl implements ToolWindowFactory {
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
JBPanel reportPanel = new ReportPanel(project);
JBPanel logPanel = new LogPanel(project);
toolWindow.getContentManager().addContent(ContentFactory.SERVICE.getInstance().createContent(reportPanel, ResourcesLoader.getString("toolWindow.tab.report"), false));
toolWindow.getContentManager().addContent(ContentFactory.SERVICE.getInstance().createContent(logPanel, ResourcesLoader.getString("toolWindow.tab.log"), false));
toolWindow.getContentManager().addContent(ContentFactory.getInstance().createContent(reportPanel, ResourcesLoader.getString("toolWindow.tab.report"), false));
toolWindow.getContentManager().addContent(ContentFactory.getInstance().createContent(logPanel, ResourcesLoader.getString("toolWindow.tab.log"), false));
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiFile;
import com.intellij.ui.UI;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBPanel;
import com.intellij.util.ui.JBUI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private ResourcesLoader() {}

@NotNull
public static Icon loadIcon(final String fileName) {
return IconLoader.getIcon(ICON_RESOURCES_PATH_PREFIX + fileName);
return IconLoader.getIcon(ICON_RESOURCES_PATH_PREFIX + fileName, ResourcesLoader.class);
}

@NotNull
Expand Down

0 comments on commit 8121453

Please sign in to comment.