14 comments

Hi Michael,

Please share the full project setup.

0

Hi, what exactly do you need?

0

Gradle build script and plugin.xml, at least.

0
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML

fun properties(key: String) = project.findProperty(key).toString()
fun environment(key: String) = providers.environmentVariable(key)
plugins {
  id("java")
  id("org.jetbrains.intellij") version "1.12.0"
  id("org.jetbrains.changelog") version "2.0.0"
}

group = properties("pluginGroup")
version = properties("pluginVersion")

repositories {
    mavenCentral()
}

intellij {
    pluginName.set(properties("pluginName"))
    version.set(properties("platformVersion"))
    type.set(properties("platformType"))
  plugins.set(listOf("Git4Idea"))
}

changelog {
    groups.set(emptyList())
    repositoryUrl.set(properties("pluginRepositoryUrl"))
}

tasks {
    wrapper {
        gradleVersion = properties("gradleVersion")
    }

  withType<JavaCompile> {
      sourceCompatibility = "17"
        targetCompatibility = "17"
    }

    patchPluginXml {
        version.set(properties("pluginVersion"))
        sinceBuild.set(properties("pluginSinceBuild"))
        untilBuild.set(properties("pluginUntilBuild"))

      pluginDescription.set(
                file("README.md").readText().lines().run {
                    val start = "<!-- Plugin description -->"
                    val end = "<!-- Plugin description end -->"

                    if (!containsAll(listOf(start, end))) {
                        throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
                    }
                    subList(indexOf(start) + 1, indexOf(end))
                }.joinToString("\n").let { markdownToHTML(it) }
        )

      changeNotes.set(provider {
            with(changelog) {
                renderItem(
                        getOrNull(properties("pluginVersion"))
                                ?: runCatching { getLatest() }.getOrElse { getUnreleased() },
                        Changelog.OutputType.HTML,
                )
            }
        })

    }
}

 

# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
pluginGroup=org.myname.plugins
pluginName=Plugin Name
pluginRepositoryUrl=https://github.com/myspace/myplugin
# SemVer format -> https://semver.org
pluginVersion=3.0.7
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=223
pluginUntilBuild=999
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
#https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
#type.set("IU")
#type.set("IC")
#type.set("PS")
#platformType=IC
platformType=PS
#version.set("LATEST-EAP-SNAPSHOT")
#version.set("2022.3.1") // 223
#version.set("2022.3") // 223 -
#version.set("2022.2") // 222 - Java 17 (Settings | Build, Execution, Deployment | Build Tools | Gradle)
#version.set("2022.1") // 221
#version.set("2021.1") // 211
#version.set("2020.3") // 203
#platformVersion="LATEST-EAP-SNAPSHOT"
platformVersion=2023.1
#platformVersion=2022.1.4
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins=Git4Idea
# Gradle Releases -> https://github.com/gradle/gradle/releases
#gradleVersion=8.0.2
gradleVersion=7.6
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency=false
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
# suppress inspection "UnusedProperty"
org.gradle.unsafe.configuration-cache=true

<idea-plugin>
  <id>pluginName</id>
  <name>Plugin Name</name>
  <vendor>Firstname Latname</vendor>

    <depends>com.intellij.modules.platform</depends>
  <depends>Git4Idea</depends>

    <projectListeners>
        <listener
                class="listener.MyToolWindowListener"
                topic="com.intellij.openapi.wm.ex.ToolWindowManagerListener"/>
        <listener
                class="listener.VcsStartup"
                topic="com.intellij.dvcs.repo.VcsRepositoryMappingListener"/>
    </projectListeners>


    <applicationListeners>
        <listener
                class="listener.MyVfsListener"
                topic="com.intellij.openapi.vfs.newvfs.BulkFileListener"/>

    </applicationListeners>


    <extensions defaultExtensionNs="com.intellij">

        <toolWindow
              id="PlugiNname"
                secondary="true"
                icon="AllIcons.Actions.Diff"
                anchor="left"
                factoryClass="ui.ToolWindowUIFactory"
        />
      <projectService serviceImplementation="state.State"/>

        <projectService serviceImplementation="implementation.Manager"/>
        <projectService
                serviceInterface="service.ToolWindowServiceInterface"
              serviceImplementation="service.ToolWindowService"/>
    </extensions>

    <actions>
        <action id="ToggleHead" class="system.ToggleHeadAction" text="ToggleHead" description="ToggleHead">
            <add-to-group group-id="ToolsMenu" anchor="last"/>
            <keyboard-shortcut keymap="$default" first-keystroke="alt H"/>
        </action>
    </actions>
</idea-plugin>
0

Hi, I checked this setup, and all elements are correctly displayed.

I suggest updating Gradle IntelliJ Plugin to the latest version and reimporting the Gradle project configuration.

If it doesn't help, try "File | Invalidate Caches...".

0

Still red.

gradle -v

Welcome to Gradle 8.1!

Here are the highlights of this release:
 - Stable configuration cache
 - Experimental Kotlin DSL assignment syntax
 - Building with Java 20

For more details see https://docs.gradle.org/8.1/release-notes.html


------------------------------------------------------------
Gradle 8.1

 

gradleVersion=8.1

 

 

0

Please share the project sources. It can be the minimal reproducible example.

0

After switching to Ultimate my project shows projectListeners red again. there is really no reason why, because the last time as i leaved the project everthing was fine. this is really annoying. after removing the .gradle cache it shows now yet another different error:

Its really OFTEN the case that something not work.

I wanted to implement new features and instead of that i need to fix essential issues. 

 

How can i improve my local setup?

0

I do get managed to get the error of the beginning:

the plugin can be startet though. but this is such a flow-killer. please invent anything which avoid such errors. i want to develop something and not fix stupid errors. sorry for the rant but i am really frustrated now

0

Hi Michael,

We need a reproducible example to understand how it is caused to be able to fix it. If it happens to you very often, then please share the reproducible example.

0

Its not a problem anymore. i didnt change anything. maybe a combination of cache clearing and restart fixed the issue.  can i add you as user to my private git hub repo (if problems continues someday)?

0

In case of the future problems requiring access to the code, please upload it to https://uploads.jetbrains.com/ and share the ID in the post. The uploaded files can be accessed only by JetBrains employees.

0

2023_08_30_ce1MKnkFVdeBqYrs5fQFhS

At the moment i do not have this issue anymore, but it would be nice to know what it causes

0

I cannot reproduce the issue after opening the project. Please share the steps to reproduce if you find out what causes it.

0

Please sign in to leave a comment.