Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ plugins {
group = prop("pluginGroup")
version = prop("pluginVersion")

val platformVersion = prop("platformVersion")
val ideaVersionInt = when {
// e.g. '20XY.Z'
platformVersion.length == 6 -> platformVersion.replace(".", "").substring(2).toInt()
// e.g. '2XY.ABCDE.12'
else -> platformVersion.substringBefore(".").toInt()
}

val quarkusVersion = prop("quarkusVersion")
val lsp4mpVersion = prop("lsp4mpVersion")
val quarkusLsVersion = prop("quarkusLsVersion")
Expand Down Expand Up @@ -79,6 +87,12 @@ dependencies {
// Bundled Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
val platformBundledPlugins = ArrayList<String>()
platformBundledPlugins.addAll(providers.gradleProperty("platformBundledPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }.get())
/*
* platformVersion check for JSON breaking changes since 2024.3
*/
if (ideaVersionInt >= 243) {
platformBundledPlugins.add("com.intellij.modules.json")
}
bundledPlugins(platformBundledPlugins)
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
val platformPlugins = ArrayList<String>()
Expand Down Expand Up @@ -154,7 +168,7 @@ dependencies {
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.JETBRAINS
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ devtools-common-ui-test = "0.4.4-SNAPSHOT"

# plugins
testlogger = "4.0.0"
kotlin = "2.0.20"
kotlin = "2.2.0"
changelog = "2.2.0"
gradleIntelliJPlugin = "2.5.0"
gradleIntelliJPlugin = "2.9.0"

[libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
package com.redhat.devtools.intellij.quarkus.run.dashboard;

import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.dashboard.RunDashboardCustomizationBuilder;
import com.intellij.execution.dashboard.RunDashboardCustomizer;
import com.intellij.execution.dashboard.RunDashboardRunConfigurationNode;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.ide.projectView.PresentationData;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleTextAttributes;
import com.redhat.devtools.intellij.lsp4mp4ij.psi.core.project.PsiMicroProfileProject;
Expand Down Expand Up @@ -47,6 +47,53 @@ public boolean isApplicable(@NotNull RunnerAndConfigurationSettings settings, @N
return settings.getConfiguration() instanceof QuarkusRunConfiguration;
}

@Override
public boolean updatePresentation(@NotNull RunDashboardCustomizationBuilder customizationBuilder,
@NotNull RunnerAndConfigurationSettings settings,
@Nullable RunContentDescriptor descriptor) {
QuarkusRunConfiguration quarkusRunConfiguration = settings.getConfiguration() instanceof QuarkusRunConfiguration config ? config : null;
if (descriptor == null || quarkusRunConfiguration == null) {
return false;
}
ProcessHandler processHandler = descriptor.getProcessHandler();
if (processHandler != null && !processHandler.isProcessTerminated()) {
// The Quarkus run configuration is running
Module module = quarkusRunConfiguration.getModule();
if (QuarkusModuleUtil.isQuarkusWebAppModule(module)) {
PsiMicroProfileProject mpProject = PsiMicroProfileProjectManager.getInstance(module.getProject()).getMicroProfileProject(module);

// It is a Web application, add links for:
// - Opening quarkus application in a browser
// - Opening DevUI in a browser
// Add application Url as hyperlink
String applicationUrl = QuarkusModuleUtil.getApplicationUrl(mpProject);
customizationBuilder.addLink(applicationUrl, new SimpleColoredComponent.BrowserLauncherTag(applicationUrl) {
@Override
public void run() {
// Open Quarkus application in a Web Browser
super.run();
// Send "ui-openApplication" telemetry event
TelemetryManager.instance().send(TelemetryEventName.UI_OPEN_APPLICATION);
}
});

// Add DevUI Url as hyperlink
String devUIUrl = QuarkusModuleUtil.getDevUIUrl(mpProject);
String devUILabel = "Dev UI";
customizationBuilder.addLink(devUILabel, new SimpleColoredComponent.BrowserLauncherTag(devUIUrl) {
@Override
public void run() {
// Open DevUI in a Web Browser
super.run();
// Send "ui-openDevUI" telemetry event
TelemetryManager.instance().send(TelemetryEventName.UI_OPEN_DEV_UI);
}
});
}
}
return true;
}

@Override
public boolean updatePresentation(@NotNull PresentationData presentation, @NotNull RunDashboardRunConfigurationNode node) {
if (!(node.getConfigurationSettings().getConfiguration() instanceof QuarkusRunConfiguration)) {
Expand Down Expand Up @@ -95,7 +142,7 @@ public void run() {
TelemetryManager.instance().send(TelemetryEventName.UI_OPEN_DEV_UI);
}
});
node.putUserData(RunDashboardCustomizer.NODE_LINKS, links);
//node.putUserData(RunDashboardCustomizer.NODE_LINKS, links);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.redhat.qute.commons.jaxrs.JaxRsMethodKind;
import com.redhat.qute.commons.jaxrs.JaxRsParamKind;
import com.redhat.qute.commons.jaxrs.RestParam;
import org.gradle.internal.impldep.org.testng.annotations.IAnnotation;

/**
* Custom Factory to create an {@link ResolvedJavaTypeInfo} instance for Renarde
Expand Down
Loading