diff --git a/idea-plugin/build.gradle b/idea-plugin/build.gradle index d00fdeb43..6e909c581 100644 --- a/idea-plugin/build.gradle +++ b/idea-plugin/build.gradle @@ -33,7 +33,7 @@ allprojects { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile group: 'junit', name: 'junit', version: '4.13' } } diff --git a/idea-plugin/gradle.properties b/idea-plugin/gradle.properties index ee7d8d966..3b8d8f0a7 100644 --- a/idea-plugin/gradle.properties +++ b/idea-plugin/gradle.properties @@ -11,4 +11,4 @@ idea_version=IU-201.6668.121 plugin_name=Alibaba Java Coding Guidelines gradle_jetbrains_version=0.4.16 systemProp.file.encoding=UTF-8 -plugin_version=2.0.1.x1 +plugin_version=2.0.1.1x diff --git a/idea-plugin/p3c-common/build.gradle b/idea-plugin/p3c-common/build.gradle index 8dbf67d53..3d457b0a5 100644 --- a/idea-plugin/p3c-common/build.gradle +++ b/idea-plugin/p3c-common/build.gradle @@ -1,6 +1,10 @@ plugins { id 'java' - id "org.jetbrains.intellij" version "0.4.16" + id "org.jetbrains.intellij" version "0.4.18" + +// id 'application' + id 'maven' + id "com.github.ben-manes.versions" version "0.28.0" } apply plugin: 'kotlin' apply plugin: 'idea' @@ -47,7 +51,7 @@ ext.isReleaseVersion = !version.endsWith("SNAPSHOT") dependencies { compile group: 'org.freemarker', name: 'freemarker', version: '2.3.25-incubating' - compile 'com.alibaba.p3c:p3c-pmd:2.0.1.x1' + compile 'com.alibaba.p3c:p3c-pmd:2.0.1.1x' compile group: 'org.javassist', name: 'javassist', version: '3.21.0-GA' } diff --git a/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/smartfox/idea/common/util/BalloonNotifications.kt b/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/smartfox/idea/common/util/BalloonNotifications.kt index 6963bbbba..813da44d1 100644 --- a/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/smartfox/idea/common/util/BalloonNotifications.kt +++ b/idea-plugin/p3c-common/src/main/kotlin/com/alibaba/smartfox/idea/common/util/BalloonNotifications.kt @@ -23,6 +23,7 @@ import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.project.Project import com.intellij.openapi.project.ProjectManager import com.intellij.openapi.ui.Messages +import org.apache.http.MethodNotSupportedException import java.awt.Component import java.net.UnknownHostException @@ -34,10 +35,10 @@ import java.net.UnknownHostException */ object BalloonNotifications { val displayId = "SmartFox Intellij IDEA Balloon Notification" - val balloonGroup = NotificationGroup(displayId, NotificationDisplayType.BALLOON, true) + val balloonGroup = buildNotificationGroup(displayId, NotificationDisplayType.BALLOON, true) val stickyBalloonDisplayId = "SmartFox Intellij IDEA Notification" - val stickyBalloonGroup = NotificationGroup(stickyBalloonDisplayId, NotificationDisplayType.STICKY_BALLOON, true) + val stickyBalloonGroup = buildNotificationGroup(stickyBalloonDisplayId, NotificationDisplayType.STICKY_BALLOON, true) val TITLE = "SmartFox Intellij IDEA Plugin" fun showInfoDialog(component: Component, title: String, message: String) { @@ -56,29 +57,29 @@ object BalloonNotifications { } fun showSuccessNotification(message: String, project: Project? = ProjectManager.getInstance().defaultProject, - title: String = TITLE, sticky: Boolean = false) { + title: String = TITLE, sticky: Boolean = false) { showNotification(message, project, title, NotificationType.INFORMATION, null, sticky) } fun showWarnNotification(message: String, project: Project? = ProjectManager.getInstance().defaultProject, - title: String = TITLE, sticky: Boolean = false) { + title: String = TITLE, sticky: Boolean = false) { showNotification(message, project, title, NotificationType.WARNING, null, sticky) } fun showErrorNotification(message: String, project: Project? = ProjectManager.getInstance().defaultProject, - title: String = TITLE, sticky: Boolean = false) { + title: String = TITLE, sticky: Boolean = false) { showNotification(message, project, title, NotificationType.ERROR, null, sticky) } fun showSuccessNotification(message: String, project: Project?, - notificationListener: NotificationListener, title: String = TITLE, sticky: Boolean = false) { + notificationListener: NotificationListener, title: String = TITLE, sticky: Boolean = false) { showNotification(message, project, title, NotificationType.INFORMATION, notificationListener, sticky) } fun showNotification(message: String, project: Project? = ProjectManager.getInstance().defaultProject, - title: String = TITLE, - notificationType: NotificationType = NotificationType.INFORMATION, - notificationListener: NotificationListener? = null, sticky: Boolean = false) { + title: String = TITLE, + notificationType: NotificationType = NotificationType.INFORMATION, + notificationListener: NotificationListener? = null, sticky: Boolean = false) { val group = if (sticky) { stickyBalloonGroup } else { @@ -100,7 +101,8 @@ object BalloonNotifications { } object LogNotifications { - val group = NotificationGroup(BalloonNotifications.displayId, NotificationDisplayType.NONE, true) + + val group = buildNotificationGroup(displayId = BalloonNotifications.displayId, displayType = NotificationDisplayType.NONE, isLogByDefault = true); fun log(message: String, project: Project? = ProjectManager.getInstance().defaultProject, title: String = BalloonNotifications.TITLE, @@ -109,3 +111,15 @@ object LogNotifications { group.createNotification(title, message, notificationType, notificationListener).notify(project) } } + + +fun buildNotificationGroup(displayId: String, displayType: NotificationDisplayType, isLogByDefault: Boolean): NotificationGroup { + var notificationGroupClass = Class.forName("com.intellij.notification.NotificationGroup") + notificationGroupClass.constructors.forEach { + if (it.parameters.size == 3) { + return it.newInstance(displayId, displayType, isLogByDefault) + as NotificationGroup; + } + } + throw MethodNotSupportedException("cannot find a suitable constructor for NotificationGroup who accepts [String,NotificationDisplayType,Boolean]"); +} diff --git a/idea-plugin/p3c-idea/build.gradle b/idea-plugin/p3c-idea/build.gradle index a4581ef24..d6106e5a3 100644 --- a/idea-plugin/p3c-idea/build.gradle +++ b/idea-plugin/p3c-idea/build.gradle @@ -1,6 +1,10 @@ plugins { id 'java' - id "org.jetbrains.intellij" version "0.4.16" + id "org.jetbrains.intellij" version "0.4.18" + +// id 'application' + id 'maven' + id "com.github.ben-manes.versions" version "0.28.0" } apply plugin: 'kotlin' apply plugin: 'idea' diff --git a/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml b/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml index a0c92ce72..d14ce4245 100644 --- a/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml +++ b/idea-plugin/p3c-idea/src/main/resources/META-INF/plugin.xml @@ -1,6 +1,10 @@ com.alibaba.p3c.xenoamess Alibaba Java Coding Guidelines(XenoAmess TPM) + XenoAmess Alibaba Java Coding Guidelines plugin support.


@@ -25,7 +29,7 @@ - 2.0.1.x1 + 2.0.1.1x
  • Fix idea 2020.1 compatibility issue
  • fix javadoc in p3c-cmd
  • fix clinic dependency in p3c-cmd
  • @@ -97,9 +101,9 @@ ]]>
    - XenoAmess - 2.0.1.x1 + + com.intellij.velocity com.intellij.modules.java com.intellij.modules.platform diff --git a/p3c-pmd/pom.xml b/p3c-pmd/pom.xml index 4b619fc69..1ee28afaa 100644 --- a/p3c-pmd/pom.xml +++ b/p3c-pmd/pom.xml @@ -11,7 +11,7 @@ com.alibaba.p3c p3c-pmd - 2.0.1.x1 + 2.0.1.1x jar p3c-pmd