Skip to content

Commit 0425dbc

Browse files
Merge branch 'master' into fix/take-hierarchy-into-account
# Conflicts: # CHANGELOG.md # src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/CommandHandlerInterceptorSearcher.kt # src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/types/CommandHandlerInterceptor.kt
2 parents a270349 + bf15afa commit 0425dbc

27 files changed

+123
-110
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Verify plugin
2020
uses: gradle/gradle-build-action@v2.9.0
2121
with:
22-
arguments: runPluginVerifier
22+
arguments: verifyPlugin
2323

2424
- name: Publish plugin
2525
uses: gradle/gradle-build-action@v2.9.0

.github/workflows/qodana.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ jobs:
1515
uses: JetBrains/qodana-action@v2023.2.8
1616
with:
1717
linter: jetbrains/qodana-jvm-community
18+
- uses: github/codeql-action/upload-sarif@v2
19+
with:
20+
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Verify plugin
2828
uses: gradle/gradle-build-action@v2.9.0
2929
with:
30-
arguments: runPluginVerifier
30+
arguments: verifyPlugin
3131
concurrency:
3232
group: ${{github.workflow}}-${{github.head_ref || github.run_id }}
3333
cancel-in-progress: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
## Directory-based project format
77
.idea/
8+
.intellijPlatform
89
# if you remove the above rule, at least ignore user-specific stuff:
910
# .idea/workspace.xml
1011
# .idea/tasks.xml
@@ -77,4 +78,4 @@ pom.xml.next
7778
release.properties
7879

7980
### IntelliJ plugin ###
80-
META-INF/plugin.xml
81+
META-INF/plugin.xml

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Axon Framework plugin Changelog
44

55
## [0.8.8]
6+
- Fix classes not rendering the correct value in popup of classes
7+
- Plugin is now compatible with IDEA 2024.3 (IDEA 243.*) with minimum version of 2024.2
8+
- Fix various deprecation warnings
9+
- Fix various javadoc issues
610
- Fix class hierarchy not being taken into account for handler and creator resolving.
711
- Remove wrong implementation of interceptor support, to possibly be re-implemented in a future release in a better form.
812

build.gradle.kts

Lines changed: 83 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17+
import org.jetbrains.changelog.Changelog
1718
import org.jetbrains.changelog.markdownToHTML
19+
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
20+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
21+
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
1822
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1923

2024
fun properties(key: String) = project.findProperty(key).toString()
@@ -25,29 +29,75 @@ plugins {
2529
// Kotlin support
2630
id("org.jetbrains.kotlin.jvm") version "1.9.10"
2731
// Gradle IntelliJ Plugin
28-
id("org.jetbrains.intellij") version "1.16.0"
32+
id("org.jetbrains.intellij.platform") version "2.1.0"
2933
// Gradle Changelog Plugin
30-
id("org.jetbrains.changelog") version "2.2.0"
34+
id("org.jetbrains.changelog") version "2.2.1"
3135
// Gradle Qodana Plugin
3236
id("org.jetbrains.qodana") version "0.1.13"
3337
}
3438

3539
group = properties("pluginGroup")
3640
version = properties("pluginVersion")
3741

38-
// Configure project's dependencies
39-
repositories {
40-
mavenCentral()
41-
}
4242

43-
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
44-
intellij {
45-
pluginName.set(properties("pluginName"))
46-
version.set(properties("platformVersion"))
47-
type.set(properties("platformType"))
43+
intellijPlatform {
44+
pluginConfiguration {
45+
name = properties("pluginName")
46+
version = properties("pluginVersion")
47+
ideaVersion {
48+
sinceBuild = properties("pluginSinceBuild")
49+
untilBuild = properties("pluginUntilBuild")
50+
}
51+
4852

49-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
50-
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
53+
description = projectDir.resolve("README.md").readText().lines().run {
54+
val start = "<!-- Plugin description -->"
55+
val end = "<!-- Plugin description end -->"
56+
if (!containsAll(listOf(start, end))) {
57+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
58+
}
59+
subList(indexOf(start) + 1, indexOf(end))
60+
}.joinToString("\n").run { markdownToHTML(this) }
61+
62+
changeNotes = provider {
63+
changelog.renderItem(
64+
changelog
65+
.get(properties("pluginVersion"))
66+
.withHeader(false)
67+
.withEmptySections(false),
68+
Changelog.OutputType.HTML
69+
)
70+
}
71+
}
72+
73+
publishing {
74+
token = System.getenv("PUBLISH_TOKEN")
75+
channels = listOf("default")
76+
}
77+
78+
signing {
79+
certificateChain = System.getenv("CERTIFICATE_CHAIN")
80+
privateKey = System.getenv("PRIVATE_KEY")
81+
password = System.getenv("PRIVATE_KEY_PASSWORD")
82+
}
83+
84+
pluginVerification {
85+
ides {
86+
select {
87+
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
88+
channels = listOf(ProductRelease.Channel.RELEASE, ProductRelease.Channel.EAP)
89+
sinceBuild = properties("pluginSinceBuild")
90+
untilBuild = properties("pluginUntilBuild")
91+
}
92+
}
93+
94+
freeArgs = listOf(
95+
// Mute some inspections that should be ignored (as we already uploaded and the id can't be changed)
96+
"-mute", "TemplateWordInPluginId,ForbiddenPluginIdPrefix"
97+
)
98+
99+
100+
}
51101
}
52102

53103
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -76,59 +126,6 @@ tasks {
76126
}
77127
}
78128

79-
wrapper {
80-
gradleVersion = properties("gradleVersion")
81-
}
82-
83-
patchPluginXml {
84-
version.set(properties("pluginVersion"))
85-
sinceBuild.set(properties("pluginSinceBuild"))
86-
untilBuild.set(properties("pluginUntilBuild"))
87-
88-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
89-
pluginDescription.set(
90-
projectDir.resolve("README.md").readText().lines().run {
91-
val start = "<!-- Plugin description -->"
92-
val end = "<!-- Plugin description end -->"
93-
94-
if (!containsAll(listOf(start, end))) {
95-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
96-
}
97-
subList(indexOf(start) + 1, indexOf(end))
98-
}.joinToString("\n").run { markdownToHTML(this) }
99-
)
100-
101-
// Get the latest available change notes from the changelog file
102-
changeNotes.set(provider {
103-
changelog.run {
104-
getOrNull(properties("pluginVersion")) ?: getLatest()
105-
}.toHTML()
106-
})
107-
}
108-
109-
// Configure UI tests plugin
110-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
111-
runIdeForUiTests {
112-
systemProperty("robot-server.port", "8082")
113-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
114-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
115-
systemProperty("jb.consents.confirmation.enabled", "false")
116-
}
117-
118-
signPlugin {
119-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
120-
privateKey.set(System.getenv("PRIVATE_KEY"))
121-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
122-
}
123-
124-
publishPlugin {
125-
dependsOn("patchChangelog")
126-
token.set(System.getenv("PUBLISH_TOKEN"))
127-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
128-
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
129-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
130-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
131-
}
132129
runIde {
133130
jvmArgs("-Xmx2G")
134131
}
@@ -140,11 +137,31 @@ tasks {
140137
}
141138

142139
dependencies {
140+
intellijPlatform {
141+
intellijIdeaCommunity(properties("platformVersion"))
142+
bundledPlugin("com.intellij.java")
143+
bundledPlugin("org.jetbrains.kotlin")
144+
pluginVerifier()
145+
zipSigner()
146+
instrumentationTools()
147+
148+
testFramework(TestFrameworkType.Plugin.Java)
149+
}
150+
143151
implementation("io.sentry:sentry:6.32.0")
144152

153+
testImplementation("junit:junit:4.13.2")
145154
testImplementation("org.axonframework:axon-modelling:${properties("axonVersion")}")
146155
testImplementation("org.axonframework:axon-messaging:${properties("axonVersion")}")
147156
testImplementation("org.axonframework:axon-eventsourcing:${properties("axonVersion")}")
148157
testImplementation("org.axonframework:axon-configuration:${properties("axonVersion")}")
149158
testImplementation("org.assertj:assertj-core:3.24.2")
150159
}
160+
161+
// Configure project's dependencies
162+
repositories {
163+
mavenCentral()
164+
intellijPlatform {
165+
defaultRepositories()
166+
}
167+
}

gradle.properties

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,18 @@
1414
# limitations under the License.
1515
#
1616

17-
# IntelliJ Platform Artifacts Repositories
18-
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
1917

18+
# Basic plugin information
2019
pluginGroup=io.axoniq.ide.intellij
2120
pluginName=Axon Framework
22-
pluginVersion=0.8.7
23-
axonVersion=4.9.0
24-
25-
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
26-
# for insight into build numbers and IntelliJ Platform versions.
27-
pluginSinceBuild = 232
28-
pluginUntilBuild = 242.*
29-
30-
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
31-
platformType = IC
32-
platformVersion = 2024.1
33-
34-
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
35-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
36-
platformPlugins =com.intellij.java,org.jetbrains.kotlin
37-
38-
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
21+
pluginVersion=0.8.8
22+
axonVersion=4.10.1
3923
javaVersion = 17
4024

41-
# Gradle Releases -> https://github.com/gradle/gradle/releases
42-
gradleVersion = 7.3
25+
# Define the plugin version range. This is used to determine the compatibility of the plugin with the IDE.
26+
pluginSinceBuild = 242
27+
pluginUntilBuild = 243.*
28+
platformVersion = 2024.2
4329

4430
# Opt-out flag for bundling Kotlin standard library.
4531
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.

src/main/kotlin/org/axonframework/intellij/ide/plugin/api/AxonAnnotation.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ enum class AxonAnnotation(val annotationName: String) {
2525
EVENT_SOURCING_HANDLER("org.axonframework.eventsourcing.EventSourcingHandler"),
2626
QUERY_HANDLER("org.axonframework.queryhandling.QueryHandler"),
2727
COMMAND_HANDLER_INTERCEPTOR("org.axonframework.modelling.command.CommandHandlerInterceptor"),
28+
MESSAGE_HANDLER_INTERCEPTOR("org.axonframework.messaging.interceptors.MessageHandlerInterceptor"),
2829
SAGA_EVENT_HANDLER("org.axonframework.modelling.saga.SagaEventHandler"),
2930
DEADLINE_HANDLER("org.axonframework.deadline.annotation.DeadlineHandler"),
3031
RESET_HANDLER("org.axonframework.eventhandling.ResetHandler"),

src/main/kotlin/org/axonframework/intellij/ide/plugin/api/Handler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import javax.swing.Icon
2525
* Parent interface of any Handler, providing methods to describe the handler in interface elements.
2626
*
2727
* @see org.axonframework.intellij.ide.plugin.resolving.MessageHandlerResolver
28-
* @see org.axonframework.intellij.ide.plugin.handlers.searchers.AbstractHandlerSearcher
28+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.searchers.AbstractHandlerSearcher
2929
*/
3030
interface Handler : PsiElementWrapper {
3131
/**

src/main/kotlin/org/axonframework/intellij/ide/plugin/markers/ClassLineMarkerProvider.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class ClassLineMarkerProvider : LineMarkerProvider {
5555
val publishers = element.creatorResolver().getCreatorsForPayload(qualifiedName)
5656
handlers + publishers
5757
})
58+
.setTargetRenderer { AxonNavigationTargetRenderer.INSTANCE }
5859
.createLineMarkerInfo(element)
5960
}
6061
}
@@ -67,6 +68,7 @@ class ClassLineMarkerProvider : LineMarkerProvider {
6768
.setTooltipText("Navigate to entities in the same command model hierarchy")
6869
.setEmptyPopupText("No related entities were found")
6970
.setTargets(NotNullLazyValue.lazy { items })
71+
.setTargetRenderer { AxonNavigationTargetRenderer.INSTANCE }
7072
.createLineMarkerInfo(element)
7173
}
7274

src/main/kotlin/org/axonframework/intellij/ide/plugin/markers/publishers/DeadlinePublisherLineMarkerProvider.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import org.jetbrains.uast.toUElementOfType
4848
*
4949
* @see DeadlineHandler
5050
* @see org.axonframework.intellij.ide.plugin.resolving.DeadlineManagerMethodResolver
51-
* @see org.axonframework.intellij.ide.plugin.creators.searchers.DeadlineMessageCreatorSearcher
5251
*/
5352
class DeadlinePublisherLineMarkerProvider : LineMarkerProvider {
5453
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<*>? {

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/AnnotationResolver.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class AnnotationResolver(val project: Project) {
7878
.firstOrNull { it.value.any { annClass -> annClass.psiClass.qualifiedName == qualifiedName } }
7979
?.key
8080
?: return null
81-
return MessageHandlerType.values().firstOrNull { it.annotation == annotation }
81+
return MessageHandlerType.entries.firstOrNull { it.annotation == annotation }
8282
}
8383

8484
/**
@@ -108,7 +108,7 @@ class AnnotationResolver(val project: Project) {
108108
*/
109109
private fun computeAnnotations(): Map<AxonAnnotation, List<ResolvedAnnotation>> {
110110
val libAnnotations = libraryAnnotationCache.getLibraryAnnotations()
111-
return AxonAnnotation.values().associateWith { axonAnn ->
111+
return AxonAnnotation.entries.associateWith { axonAnn ->
112112
val specificLibAnnotations = libAnnotations.filter { axonAnn == it.axonAnnotation }
113113
specificLibAnnotations.flatMap { descAnn ->
114114
scanDescendants(axonAnn, descAnn, project.axonScope())
@@ -175,7 +175,7 @@ class AnnotationResolver(val project: Project) {
175175
}
176176

177177
private fun updateLibraryAnnotations() {
178-
libraryAnnotations = AxonAnnotation.values().flatMap { scanAnnotation(it, project.allScope()) }
178+
libraryAnnotations = AxonAnnotation.entries.flatMap { scanAnnotation(it, project.allScope()) }
179179
libraryInitialized = true
180180
}
181181
}

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/CommandHandlerSearcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
2828
/**
2929
* Searches for any command handlers
3030
*
31-
* @see org.axonframework.intellij.ide.plugin.handlers.types.CommandHandler
31+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.CommandHandler
3232
*/
3333
class CommandHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.COMMAND) {
3434
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler? {

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/DeadlineHandlerSearcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
3131
* If there is not payload specific, the payload is java.lang.Object as fallback.
3232
* In addition, deadline handlers have a name.
3333
*
34-
* @see org.axonframework.intellij.ide.plugin.handlers.types.DeadlineHandler
34+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.DeadlineHandler
3535
*/
3636
class DeadlineHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.DEADLINE) {
3737
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler {

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/EventHandlerSearcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
2828
/**
2929
* Searches for any event handlers that are not part of the aggregate model.
3030
*
31-
* @see org.axonframework.intellij.ide.plugin.handlers.types.EventHandler
31+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.EventHandler
3232
*/
3333
class EventHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.EVENT) {
3434
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler? {

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/EventSourcingHandlerSearcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
2828
/**
2929
* Searches for any event handlers in aggregates that source the state of the aggregates.
3030
*
31-
* @see org.axonframework.intellij.ide.plugin.handlers.types.EventSourcingHandler
31+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.EventSourcingHandler
3232
*/
3333
class EventSourcingHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.EVENT_SOURCING) {
3434
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler? {

src/main/kotlin/org/axonframework/intellij/ide/plugin/resolving/handlers/searchers/QueryHandlerSearcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.axonframework.intellij.ide.plugin.util.toQualifiedName
2828
/**
2929
* Searches for any query handlers.
3030
*
31-
* @see org.axonframework.intellij.ide.plugin.handlers.types.QueryHandler
31+
* @see org.axonframework.intellij.ide.plugin.resolving.handlers.types.QueryHandler
3232
*/
3333
class QueryHandlerSearcher : AbstractHandlerSearcher(MessageHandlerType.QUERY) {
3434
override fun createMessageHandler(method: PsiMethod, annotation: PsiClass?): Handler? {

0 commit comments

Comments
 (0)