-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gradle|Daemon|JVM] patch: create notification to migrate project to …
…Daemon Jvm criteria closes #2882 Issues: IDEA-358562 GitOrigin-RevId: eb7201530f268ad9e89c4643f8d9062eaadb58bb
- Loading branch information
1 parent
a2be41b
commit c866044
Showing
4 changed files
with
54 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...etbrains/kotlin/idea/gradleJava/toolchain/GradleDaemonJvmCriteriaMigrationNotification.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
package org.jetbrains.kotlin.idea.gradleJava.toolchain | ||
|
||
import com.intellij.ide.BrowserUtil | ||
import com.intellij.ide.util.propComponentProperty | ||
import com.intellij.notification.NotificationAction | ||
import com.intellij.notification.NotificationType | ||
import com.intellij.openapi.project.Project | ||
import org.jetbrains.plugins.gradle.service.project.GradleNotification | ||
import org.jetbrains.plugins.gradle.service.project.GradleNotificationIdsHolder | ||
import org.jetbrains.plugins.gradle.util.GradleBundle | ||
|
||
|
||
object GradleDaemonJvmCriteriaMigrationNotification { | ||
|
||
private const val DISABLE_DAEMON_TOOLCHAIN_MIGRATION = "GradleDaemonJvmCriteriaMigrationNotification.isNotificationDisabled" | ||
|
||
fun show(project: Project, externalProjectPath: String) { | ||
var isNotificationDisabled: Boolean by propComponentProperty(project, DISABLE_DAEMON_TOOLCHAIN_MIGRATION, false) | ||
|
||
if (isNotificationDisabled) return | ||
|
||
GradleNotification.gradleNotificationGroup.createNotification( | ||
title = GradleBundle.message("gradle.notifications.daemon.toolchain.migration.title", project.name), | ||
content = GradleBundle.message("gradle.notifications.daemon.toolchain.migration.description"), | ||
type = NotificationType.INFORMATION | ||
) | ||
.setDisplayId(GradleNotificationIdsHolder.daemonToolchainMigration) | ||
.addAction(NotificationAction.createSimple(GradleBundle.message("gradle.notifications.daemon.toolchain.migration.info.action.text")) { | ||
BrowserUtil.browse(GradleBundle.message("gradle.notifications.daemon.toolchain.migration.info.url")) | ||
}) | ||
.addAction(NotificationAction.createSimpleExpiring(GradleBundle.message("gradle.notifications.daemon.toolchain.migration.accept.action.text")) { | ||
isNotificationDisabled = true | ||
GradleDaemonJvmCriteriaMigrationHelper.migrateToDaemonJvmCriteria(project, externalProjectPath) | ||
}) | ||
.addAction(NotificationAction.createSimpleExpiring(GradleBundle.message("gradle.notifications.daemon.toolchain.migration.cancel.action.text")) { | ||
isNotificationDisabled = true | ||
}) | ||
.notify(project) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
...rg/jetbrains/kotlin/idea/gradleJava/toolchain/GradleDaemonToolchainMigrateNotification.kt
This file was deleted.
Oops, something went wrong.