Skip to content

Update plugin.xml and plugin-specific services to actual IntelliJ API #2654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 9, 2023
Merged
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
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ allprojects {
"--add-opens", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED"
)

withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

useJUnitPlatform {
excludeTags = setOf("slow", "IntegrationTest")
}
Expand Down
1 change: 0 additions & 1 deletion utbot-intellij/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
id="org.utbot.intellij.plugin.settings.Configurable"
displayName="UnitTestBot"/>
<!--suppress PluginXmlValidity -->
<projectService serviceImplementation="org.utbot.intellij.plugin.settings.Settings" preload="true"/>
<registryKey defaultValue="false" description="Enable editing Kotlin test files" key="kotlin.ultra.light.classes.empty.text.range"/>
<postStartupActivity implementation="org.utbot.intellij.plugin.ui.GotItTooltipActivity"/>
<projectModelModifier implementation="org.androidstudio.plugin.util.UtAndroidGradleJavaProjectModelModifierWrapper" order="first"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package org.utbot.intellij.plugin.settings

import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.project.Project
Expand Down Expand Up @@ -44,6 +45,7 @@ import org.utbot.framework.plugin.api.isSummarizationCompatible
name = "UtBotSettings",
storages = [Storage("utbot-settings.xml")]
)
@Service(Service.Level.PROJECT)
class Settings(val project: Project) : PersistentStateComponent<Settings.State> {
data class State(
var sourceRootHistory: MutableList<String> = mutableListOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.keymap.KeymapUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.wm.WindowManager
import com.intellij.ui.GotItTooltip
import javax.swing.event.HyperlinkEvent
Expand Down Expand Up @@ -187,9 +187,9 @@ object TestReportUrlOpeningListener: NotificationListener.Adapter() {
callbacks[descriptionSuffix]?.map { it() } ?: error("No such command with #utbot prefix: $descriptionSuffix")
}

object GotItTooltipActivity : StartupActivity {
object GotItTooltipActivity : ProjectActivity {
private const val KEY = "UTBot.GotItMessageWasShown"
override fun runActivity(project: Project) {
override suspend fun execute(project: Project) {
ApplicationManager.getApplication().invokeLater {
val shortcut = ActionManager.getInstance()
.getKeyboardShortcut("org.utbot.intellij.plugin.ui.actions.GenerateTestsAction")?:return@invokeLater
Expand Down