Can't find IgnoreFileActionKt with the Idea build 242

Answered

vesion:

update from 2024.1.4 (build 241) to 2024.2 (build 242)

 

api

com.intellij.openapi.vcs.changes.ignore.actions.IgnoreFileActionKt

 

usage:

    private static void ignoreFiles(@NotNull Project project, List<VirtualFile> filesToAdd,
        VirtualFile excludeVirtualFile, GitVcs gitVcs, GitRepository gitRepository) {
        List<IgnoredFileBean> ignores =
            filesToAdd.stream().map(file -> IgnoredBeanFactory.ignoreFile(file, project)).collect(Collectors.toList());
        WriteCommandAction.writeCommandAction(project)
            .withName("Git Ignore Writer")
            .run(() -> IgnoreFileActionKt.writeIgnoreFileEntries(project, excludeVirtualFile, ignores, gitVcs,
                gitRepository.getRoot()));
    }

 

I can see it's still be used at this kt class : git4idea.ignore.actions.AddToGitExcludeAction

but I can't use that class or found it in the lib. Looks like it's been deleted in the build 242.

How can I use this function in the new build ?  (BTW,  how can I check the source code when I'm developing plugin. It's hard to read the decompiled code)

0
4 comments

You must use IntelliJ Platform Gradle Plugin (2.x) https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html when targeting 2024.2, see big warning on https://plugins.jetbrains.com/docs/intellij/api-notable-list-2024.html and corresponding error message when trying to use Gradle IntelliJ Plugin (1.x).

1

Took some time to migrate. And It works fine,  thanks a lot.

And may I ask one more question: I'd like to use the customPluginRepository like this:

repositories {
  intellijPlatform {
    customPluginRepository("https://example.com/plugins.xml", CustomPluginRepositoryType.SIMPLE) {
      credentials<HttpHeaderCredentials> {
        name = "Authorization"
        value = "Automation amFrdWJfdGVzdDotX...MkV2UkFwekFWTnNwZjA="
      }
    }
  }
}

But there is a problem : unable to resolve class credentials  or Could not get unknown property 'CustomPluginRepositoryType' 

May be I need to wait the next version of Gradle Plugin ?

 

 

 

0

Are you using Groovy instead of Kotlin DSL?

Try using the following class instead com.jetbrains.plugin.structure.intellij.repository.CustomPluginRepositoryListingType

1

yeah, I'm using Groovy. It worked with CustomPluginRepositoryListingType, thanks for that。

But there is another problem when I continue : 

exception is :

> Could not create an instance of type org.jetbrains.intellij.platform.gradle.artifacts.repositories.PluginArtifactRepository.
   > Could not generate a decorated class for type PluginArtifactRepository.
      > Cannot have abstract method AuthenticationSupported.getAuthentication().

I don't know where it come from . So I use the localPlugin instead

0

Please sign in to leave a comment.